yash069 / puttycyg

Automatically exported from code.google.com/p/puttycyg
0 stars 0 forks source link

Word-wrap at bash prompt doesn't work properly #59

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
At the bash (or probably other shells) prompt, start typing a long command (in 
my case, an svn merge command). When the text should wrap to the next line, it 
instead only does a carriage return and overwrites the current line.

This does not seem to affect the actual command that bash executes when hitting 
ENTER, but it interferes with editing.

Is there a setting somewhere to avoid this? Or is something wrong in my 
particular setup?

PutTTYcyg version: 20101029
Cygwin version: how do I find this?
`uname` -> CYGWIN_NT-6.1-WOW64
`uname -v` -> 2011-03-29 10:10
Windows version: Win7_64

Original issue reported on code.google.com by steve.ar...@gmail.com on 2 May 2011 at 11:13

GoogleCodeExporter commented 8 years ago
This is unlikely to be a PuTTYcyg issue. You need to make sure you've enclosed 
any non-printing characters in your prompt with '\[' and '\]', so that readline 
can correctly calculate the length of the prompt. See also 
http://www.gnu.org/software/bash/manual/html_node/Printing-a-Prompt.html#Printin
g-a-Prompt.

Original comment by andy.koppe on 6 May 2011 at 5:02

GoogleCodeExporter commented 8 years ago
I occasionally experience the same behavior, but so far I have not been able to 
consistently reproduce it, which is why I have not reported any issue.

I am using the default Cygwin prompt, as set by /etc/bash.bashrc, i.e. 
PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '

I do not see anything wrong with this prompt. Do you ?

Original comment by dre...@gmail.com on 19 May 2011 at 7:34

GoogleCodeExporter commented 8 years ago
Nope, looks fine to me to. I'd check whether the number of columns reported by 
`stty -a` tallies with the actual window size.

Original comment by andy.koppe on 20 May 2011 at 7:36

GoogleCodeExporter commented 8 years ago
I have the same problem too. And I found it occurs under Win7_64 but not WinXP.

A quick but dirty solution:
Change "Property" of PuTTYcfy.exe by right click on the file, "Compatibility", 
check "Run this program in compatibility mode for", select "Windows XP (Service 
Pack 3), and then "Apply/OK".

Wish it helpful.

Original comment by dyz...@gmail.com on 22 Oct 2011 at 2:12

GoogleCodeExporter commented 8 years ago
Update: It seems my solution yetoday will cause some weird problem. Wish anyone 
can fix the bug. Thanks.

Original comment by dyz...@gmail.com on 23 Oct 2011 at 8:38

GoogleCodeExporter commented 8 years ago
Update2: I downloaded source code of PuTTY, and tried to have a look at the 
bug. Fortunately, I found that there is a "PuTTY wish cygwin-terminal-window
" feature in version 0.61. I tried, it works well.

Reference: 
http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/cygwin-terminal-windo
w.html

Original comment by dyz...@gmail.com on 23 Oct 2011 at 1:04