In this question I'm asking of one specific bit of functionality of readline:
The Readline library includes additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those lines
Now on Windows with Visual Studio you ain't need no stinking readline
. You can use fgets and arrow keys will happily recall what you typed previously. Of course you can edit these too.
On linux the very same code (fgets
in a loop ) does not work like this. Up arrow is shown as ^[[A
and left and right arrows also does not allow you navigating the line as shown by experiment and also described here.
My question is, what part of Windows makes the editing possible?
I think it can be either conhost.exe or how fgets
, et al, are implemented. Somehow I suspect that it's the former. In any case, I'd like to know how exactly it works if it's documented anywhere, etc. For example, what other keys, apart from arrows have a special meaning and processed differently instead of being returned as par of the buffer fgets
writes to.