[issue12972] Color prompt + readline

2014-05-25 Thread Damian

Damian added the comment:

Just a quick comment that I ran into this again, but turns out that it's not an 
issue with python. Rather, this is a quirk with how readline works...

https://stackoverflow.com/questions/9468435/look-how-to-fix-column-calculation-in-python-readline-if-use-color-prompt

Color prompts need to be wrapped by RL_PROMPT_START_IGNORE and 
RL_PROMPT_END_IGNORE.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12972
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12972] Color prompt + readline

2014-05-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Thanks for the followup. This should be useful info for anyone who finds this 
issue.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12972
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12972] Color prompt + readline

2011-09-18 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

Since 2.7 was released after 3.1, I will assumed any bugfix was applied there 
also until someone determines otherwise. Thanks for checking.

--
resolution:  - out of date
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12972
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12972] Color prompt + readline

2011-09-17 Thread Damian

Damian atag...@gmail.com added the comment:

Retested with Python 3.1.1 and this issue doesn't manifest. This can be 
resolved - sorry about the noise. :)

--
nosy: +atagar

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12972
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12972] Color prompt + readline

2011-09-16 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

From your version choice, you apparently are using 2.6, which is in 
security-fix only mode. Please test with the latest 2.7 and/or 3.2.

--
nosy: +terry.reedy
stage:  - test needed
versions: +Python 2.7 -Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12972
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12972] Color prompt + readline

2011-09-13 Thread Damian

New submission from Damian atag...@gmail.com:

Hi, when using terminal coloring codes (for instance '\x1b[32mhello 
world\x1b[0m' for a green 'hello world') the raw_input function and readline 
module behave well except under a very specific use case...



import readline # provides history via up/down

prompt = '\x1b[32m \x1b[0m' # green ' ' prompt

while True:
  raw_input(prompt)



This provides a green prompt and up/down cycles through prior input. This works 
well as long as the input is shorter than the prompt string length (in this 
case 13 characters). However, if the input is longer than the prompt then 
up/down thinks that the first thirteen rendered characters now belong to the 
prompt. For instance...

atagar@fenrir:~/Desktop/arm$ python tmp.py 
 http://docs.python.org/library/readline

Press up, then down to get back to a blank prompt. You'll have...
 http://do

This is probably due to a len() check on the raw_input argument...
 len(' http://do')
13
 len('\x1b[32m \x1b[0m')
13

I'm at a bit of a loss for investigating this further - help would be 
appreciated! -Damian

--
messages: 143977
nosy: atagar1
priority: normal
severity: normal
status: open
title: Color prompt + readline
type: behavior
versions: Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12972
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com