5 ms·
> For example, if you run > stty intr '^X' > then your interrupt character sequence will be Ctrl+X instead of Ctrl+C (!). I have a feeling that if you actual
by tonnydourado 4y ago
> For example, if you run
> stty intr '^X'
> then your interrupt character sequence will be Ctrl+X instead of Ctrl+C (!).
I have a feeling that if you actually do this in a real Linux system, a sysadmin will hunt you down and dismember you alive, but I might be wrong.
- deadbunny 4y agoCan confirm.
- jwilk 4y agoFun fact: it doesn't have to be Ctrl+something. If you feel paricularly evil today, you might try this: stty intr y
- psydvl 4y agoIs it fun enough to be 1st April joke?
- Brian_K_White 4y agoIt can be any single byte, except probably not 0x00. It cannot be a multi-byte sequence, which means it cannot be any keyboard key. On SCO systems intr/break is the Del key, which on a scoansi terminal emits ^? (I don't remember the ascii value just that ctrl-? is another way to produce it) So to break out of programs is the Del key instead of Ctrl-C. But on a vtxx terminal like the linux console or xterm, even if you were perverse enough to want to, you can not assign break/intr to the Del key like that, because on a vtxx terminal the Del key emits a multi byte escape sequence, not a single byte. hot keys like ctrl-c require multiple fingers, but what's produced is a single byte. (you can actually modify both the console and xterm to change what a key emits, but then the resulting terminal no longer matches the definition of a linux or xterm terminal)
- jwilk 4y ago^? = 0x7F
- jwilk 4y ago> It can be any single byte, except probably not 0x00. At least on Linux, indeed you can't use 0x00 (aka ^@), because _POSIX_VDISABLE (the thing you use for disabling special characters) is 0.
- kps 4y ago> Del key, which on a scoansi terminal emits ^? ^? = ASCII DEL[elete] = 0x7F. Terminals where the Delete key sends Delete are doing it right. Why is DEL 0x7F, when other control codes are <0x20? Because the American Standard Code for Information Interchange descended from teletype codes, and teletypes often used paper tape ‘storage’ where a 1 bit was a hole. So teletype codes would normally have a delete function punch all holes, because that would obliterate any other possible character (and typical of punches, advance to the next position, making DEL semantically a forward delete operation). > on a vtxx terminal the Del key emits a multi byte escape sequence Only VTxxx where xxx ≥ 200. The VT100 series and earlier had ASCII Delete and Backspace keys, but in the VT2xx era DEC got some funny ideas and provided only a ⌫ key, which left us an enduring mess.
- codesnik 4y agojoke aside, it is a per-tty setting, right?
- jwilk 4y agoYes.
- BaseballPhysics 4y agoSure, which is why you put it in /etc/profile so you don't have to remember to run the command all the time!
- grymoire1 4y agoNope. As someone who administered a VAX with 50 simultaneous users, it's not a problem. It only affect that process and that user during that session. A logout resets everything. A more interesting problem was trying to read or write to a serial port that was hardwired to use a different baud rate. You could type "stty 9600 /dev/tty4"; cat file >/dev/tty4" and it wouldn't work because when stty exited, the system would reset the terminal baud rate. The proper way to do this (assuming you weren't the sysadmin and couldn't modify the default per-terminal baud rate), was to type the following (stty 9600; cat file)>/dev/tty4