rheostat2718 / conemu-maximus5

Automatically exported from code.google.com/p/conemu-maximus5
7 stars 1 forks source link

Cygwin & Long Lines Give Wrong Cursor Position #1585

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Required information!
OS version: Win7 SP1 x64
ConEmu version: 140505

*Bug description*
When I type long lines using cygwin on conemu, it will wrap the line but 
hitting the home key doesn't visually take me back to the beginning of the 
command prompt. The prompt text has now taken up some of the command text but 
this is only a visual quirk because it's actually editing the beginning of the 
command. Visually it will show you editing elsewhere. See screenshot for an 
example of me hitting home key and adding the letter a.

*Steps to reproduction*
1. Type long line that wraps.
2. Once the line wraps, hit the home key
3. Start typing to see visual display quirk

*Further Notes*
It always seems to visually engulf 10 characters of the command text. Also I 
changed my PS1 variable to be what's shown below.

PS1 = \e[0;32m[\u@\h:\W]$ \e[m

Original issue reported on code.google.com by bliss...@gmail.com on 22 May 2014 at 5:56

Attachments:

GoogleCodeExporter commented 9 years ago
CygwinMsys
Again, again and again...

Original comment by ConEmu.Maximus5 on 22 May 2014 at 5:58

GoogleCodeExporter commented 9 years ago
Should add I'm using the 64bit version of conemu.

Original comment by bliss...@gmail.com on 22 May 2014 at 6:07

GoogleCodeExporter commented 9 years ago
=Abstract=
Report cygwin and msys bugs to their authors! ConEmu is terminal! It just the 
display for output of console applications. Bugs in applications will lead 
wrong display output in ConEmu. Of course.

Still thinking the problem is inside ConEmu? Read the rest of this wiki.
CygwinMsys

Original comment by ConEmu.Maximus5 on 22 May 2014 at 6:10

GoogleCodeExporter commented 9 years ago
Appologies, I failed to test in cygwin before reporting the bug. 

Original comment by bliss...@gmail.com on 22 May 2014 at 6:12

GoogleCodeExporter commented 9 years ago
Didn't mean to upset you. 8(

Original comment by bliss...@gmail.com on 22 May 2014 at 6:13

GoogleCodeExporter commented 9 years ago
As in #1568, the issue is not in ConEmu, as we know.

CygwinMsys is a great reading.

Anyway, I think, there is a problem. I have been using msysgit (a fork of a 
fork of cygwin, as you know), the bash shell is 3.1 and, reading msysgit 
forums, it will be unlikely updated.

My suggestion is to find an hack in ConEmu, as proposed in #1568 ("to lock" the 
cursor), to fix or to mitigate this kind of issues. Thanks.

Original comment by albertos...@gmail.com on 23 May 2014 at 7:31

GoogleCodeExporter commented 9 years ago
I don't know if it helps, but the WebStorm terminal uses winpty agent 
(https://github.com/rprichard/winpty).

There the git bash shell does not seems to suffer this kind of issue.

Original comment by albertos...@gmail.com on 26 May 2014 at 11:52

GoogleCodeExporter commented 9 years ago
This is what fixed my issue.

If you mess with the PS1 variable with colors or other stuff that should not be 
counted as part of wrapping, enclose it with \[ and \].

example...
\e[0;32m[\u@\h:\W]$ \e[m
change to...
\[\e[0;32m\][\u@\h:\W]$ \[\e[m\]

Same thing if you use tput for coloring instead.

Original comment by bliss...@gmail.com on 26 May 2014 at 7:08