OhmNomNom / thyme

A fork of mintty, for the modern world
GNU General Public License v3.0
0 stars 0 forks source link

Editing long lines from history #191

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run a command with a long line
2. Scroll back in the history (e.g. up arrow) and enter the command
3. Edit the command line

What is the expected output? What do you see instead?
* expected: can edit line, cursor matches up with characters shown
* actual: can edit line, cursor does not match up with characters shown
There seems to be an "off by one" situation here; when the line is 
sufficiently long, editing it is not possible due to this problem. I have a 
multi-line command prompt, and this is possibly a factor.

What version of the product are you using? On what operating system?
0.7.0b3; have noticed the same problem with 0.6 and 0.7b1 as well. OS is XP 
64-bit, cygwin is "CYGWIN_NT-5.2-WOW64 my-machine 1.7.5(0.225/5/3) 2010-04-
12 19:07 i686 Cygwin"

Please provide any additional information below.
When the problem occurs, I am forced to use an alternate (read: less 
desirable) command line tool. I haven't had the time to dig into the source 
to provide a patch. If I do get some time, I'll look into it some more.

Original issue reported on code.google.com by thomas.e...@gmail.com on 7 Jun 2010 at 4:31

GoogleCodeExporter commented 9 years ago
Sounds like you might have a problem with your prompt setting, i.e. PS1. All 
non-
printing parts of it need to be enclosed in \[ and \] to tell bash/readline not 
to 
count them towards the prompts length, otherwise it gets confused about cursor 
position.

Here's the default Cygwin prompt as an example:

PS1=\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$

Original comment by andy.koppe on 7 Jun 2010 at 5:30

GoogleCodeExporter commented 9 years ago
Update: doesn't seem to matter if I'm using a fancy command prompt or the 
default 
cygwin prompt.

Original comment by thomas.e...@gmail.com on 7 Jun 2010 at 5:31

GoogleCodeExporter commented 9 years ago
err ... ummm ... ahem ... 

*thank you*

Original comment by thomas.e...@gmail.com on 7 Jun 2010 at 6:03

GoogleCodeExporter commented 9 years ago

Original comment by andy.koppe on 7 Jun 2010 at 6:10

GoogleCodeExporter commented 9 years ago
Issue 296 has been merged into this issue.

Original comment by andy.koppe on 17 Oct 2011 at 9:37

GoogleCodeExporter commented 9 years ago
Issue 355 has been merged into this issue.

Original comment by andy.koppe on 21 Oct 2012 at 5:00