Linux terminals vs Windows consoles - was Re: python 2.7.12 on Linux behaving differently than on Windows
Michael Torrie
torriem at gmail.com
Thu Dec 8 12:08:43 EST 2016
On 12/08/2016 09:35 AM, Michael Torrie wrote:
> Yes Control codes are, well control codes. Any ascii value under 32.
> They are more or less common across terminal types. I don't know of any
> way around that with terminals.
That is to say that on all terminal types that I'm aware of, the ENTER
key is encoded as Control-M, or 13. Since they are the same key,
there's no way in any terminal to differentiate between pressing
control-M and the enter key. I guess this limitation has been with us
so long that people did other things. In unix terminal apps, often the
meta key is used as a modifier. This is usually the "Alt" key.
If you need to differentiate between ENTER and control-M specifically,
you'll have to build a GUI app instead. One that won't be able to run
remotely over a tty stream.
I know you want your apps to be exactly the same across platforms, but
that's not always possible, nor always desirable. For example, on Macs,
control-key is not normally used, but rather the Command-key (the apple
key) which happens to be where the Alt key is on our PC keyboards.
More information about the Python-list
mailing list