Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue Mar 22, 2015 · 6 comments
Open

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

GoogleCodeExporter opened this issue Mar 22, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant