When I try to make the Python shell get color:
python 2>&1 | source-highlight --failsafe -f esc -s python
the >>>
prompt seems to be always delayed by 1 command.
Why is this happening, and how do I fix this?
I don't think this will ever work quite that way. The You might consider using an editor that has real-time syntax highlighting and setting up some macros to execute the file in the python interpreter or looking for alternate readline environment wrappers for python, but I'm pretty sure the solution you were trying won't work so don't beat yourself up over it too much. |
|||||||||||||||||||||
|
\n
is seen after Python echoes the command. Also, for input the readline module is reading and echoing characters in raw mode, so you won't see those highlighted as you type. Since most what you enter is not hightlight, and a lot of the output is not actually in Python source syntax I don't see what the value of this is. – Keith Jul 27 '11 at 5:18