[issue17337] input() and raw_input() do not work correctly with colored prompts

2013-03-15 Thread Michael Enßlin
Michael Enßlin added the comment: Terry, i guess you are right; it is indeed not the job of python to know how its terminal will print characters; there is a whole lot of issues to consider, such as terminal unicode support, control characters, ansi escape sequences, terminal-specific escape

[issue17337] input() and raw_input() do not work correctly with colored prompts

2013-03-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: Please suggest the specific change in a specific place that you would like to see. Message is ok, patch even better. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17337

[issue17337] input() and raw_input() do not work correctly with colored prompts

2013-03-08 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe tshep...@gmail.com: -- nosy: +tshepang ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17337 ___ ___

[issue17337] input() and raw_input() do not work correctly with colored prompts

2013-03-08 Thread Terry J. Reedy
Terry J. Reedy added the comment: On Windows, both the command prompt interpreter and IDLE ignore special meanings and print prompt as is. Line wrap to physical next line occurs at 80 chars and movable edge of window respectively. Michael, in light of your last post, do you still believe a

[issue17337] input() and raw_input() do not work correctly with colored prompts

2013-03-02 Thread mic_e
New submission from mic_e: With a prompt that uses ANSI color escape codes, python3 input() and python2 raw_input() behave incorrectly when it comes to the wrapping of the first line - almost certainly due to the wrong string length calculation. The line breaking occurs k characters early,

[issue17337] input() and raw_input() do not work correctly with colored prompts

2013-03-02 Thread Ezio Melotti
Ezio Melotti added the comment: I can reproduce the issue, but only from the interactive interpreter while using input() directly (Linux/py3). I tried the following things: $ ./python -c 'print(\x1b[31;1mthis is a bold red prompt \x1b[m, end=); input()' $ ./python -c 'input(\x1b[31;1mthis is

[issue17337] input() and raw_input() do not work correctly with colored prompts

2013-03-02 Thread Michael Enßlin
Michael Enßlin added the comment: The issue might very well be strictly related to GNU readline. I have both successfully reproduced it in a C program: #include stdio.h #include readline/readline.h int main() { readline(\x1b[31;1mthis is a bold red prompt\x1b[m ); } gcc -lreadline