Nessesarius / mintty

Automatically exported from code.google.com/p/mintty
GNU General Public License v3.0
0 stars 0 forks source link

Wrong positioning for output if color escape sequences used... #296

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I found this bug when set in PS1 color escape codes.

If mintty make color output then putting chars near the end of line in 
canonycal mode garbage output.

To reproduce: Win+R mintty -s 20,10 RET, next type:

  PS1='# ' RET
  printf '\033[31maaaaaaaaaa\033[0m' RET

You get 'aaaaaaaaaa# ' prompt. Next type any sequence and look to cursor 
position. Cursor was randomly jumped when cursor reach some position near the 
end of line and same happen whe cursor move to next line.

Without using colors and in row mode (if I run Vim or Emacs) all work fine.

Look like mintty does not properly calculate string length with color escape 
sequences.

Original issue reported on code.google.com by gavenkoa on 17 Oct 2011 at 8:31

GoogleCodeExporter commented 8 years ago
Originaly I discover bug with

  PS1='\[\033[31m\033[1m\]\h\033[35m\]+bash# \[\033[0m\]'

Just type long line (that require line wrapping) and see how cursor position 
was changed.

Original comment by gavenkoa on 17 Oct 2011 at 8:44

GoogleCodeExporter commented 8 years ago

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

GoogleCodeExporter commented 8 years ago
I read bug #191 and see that my PS1 have unescaped non-printable part...

Thanks for support!

Original comment by gavenkoa on 17 Oct 2011 at 7:32