开发者

Where are the other ASCII control characters?

It seems that we only use '\0'(null),'\a'(bell),'\b'(backspace),'\t'(horizontal tab),'\n'(line fee),'\r'(carriage return),'\v'(vertical tab),'\e'(escape).

Where are the开发者_开发百科 other ASCII control characters?Whats the usage of other ASCII contorl characters?Do they still act as control command of printer?

thanks.


They are all here.


They were designed for control of terminals really, not just printers. It was pretty common back in the day on 80x24 character terminals to need to hit Ctrl-S (0x13 or XOFF) to pause output and Ctrl-Q (0x11 or XON) to unpause it again. Ctrl-G (0x07 or BEL) make the terminal beep. I suppose that could have worked on a printer too, but it would have to have been a really loud beep to be heard over those old chain printers.

Ctrl-S, Q, and G still work on most shells. The Windows shell doesn't do anything with G, but S and Q work.

CR and LF are of course still used in terminals, although they don't do quite what you'd expect from their printer definitions. On most OSes LF is used to terminate lines. Some old Macs just use CR, and Windows likes to use both.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜