Maximus5 / conemu-old-issues

Old issues imported from googlecode. Project was moved to
https://conemu.github.io
6 stars 1 forks source link

Cygwin & Long Lines Give Wrong Cursor Position #1585

Open Maximus5 opened 9 years ago

Maximus5 commented 9 years ago

Originally reported on Google Code with ID 1585

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

Reported by blissend on 2014-05-22 17:56:04


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

Reported by ConEmu.Maximus5 on 2014-05-22 17:58:30

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

Reported by blissend on 2014-05-22 18:07:36

Maximus5 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

Reported by ConEmu.Maximus5 on 2014-05-22 18:10:32

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

Reported by blissend on 2014-05-22 18:12:08

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

Reported by blissend on 2014-05-22 18:13:33

Maximus5 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.

Reported by albertosantini on 2014-05-23 07:31:02

Maximus5 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.

Reported by albertosantini on 2014-05-26 11:52:18

Maximus5 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.

Reported by blissend on 2014-05-26 19:08:49