3 ms·
Why's that? In my terminal emulator, CTRL-; just outputs a semicolon. Are there any cases where CTRL plus a character in the first or fourth columns has the sam
by Twisol 7y ago
Why's that? In my terminal emulator, CTRL-; just outputs a semicolon. Are there any cases where CTRL plus a character in the first or fourth columns has the same kind of behavior?
It seems to me that it's only the elements in the third column that can be used to generate elements of the first column. This is consistent with the description in the article, and still explains why ESC is represented by ^[.
- retzkek 7y agoSpecifically I'm questioning this bit: > Pressing CTRL simply sets all bits but the last 5 to zero in the character that you typed. You can imagine it as a bitwise AND. If that were the case then CTRL-(any column) would result in the first column. Edit: I suppose at this point terminal emulators are just hardcoding in CTRL modifiers rather than the truly emulating what a hardware terminal would have done.
- PhasmaFelis 7y agoThe article says: > Pressing CTRL simply sets all bits but the last 5 to zero in the character that you typed. You can imagine it as a bitwise AND. But it can't be quite that simple, or Ctrl-[, Ctrl-;, and Ctrl-{ would all have the same effect. There must (as you said, and contrary to the article) be additional logic that only zeroes the leading bits if they are "10".
- Twisol 7y agoAhh, I understand. I must have scanned right over that part. As the sibling says, it’s probably the case that terminal emulators have this historic behavior for specific combinations, and not for the more general mechanism of merely setting the high bits of whatever symbol was generated. It’s probably a bit fallacious to test things in an emulator... perhaps the article is correct for the original systems?
- _kst_ 7y agoI vaguely remember using CTRL-7 to get the ASCII BEL character (0x07). This was a long time ago, and I don't see it on any current systems. Another special case: On most keyboards (I suppose it's the terminal emulator that implements it), CTRL-SPACE emits the NUL character. (I find that useful because I use C-@ as the prefix key in tmux.)