I'm using Cygwin bash prompt, and for long commands the text will wrap around on the same line as opposed to going to the next line despite setting my PS1 to simply ' $'.

Here's a screenshot,
screenshot

link|improve this question

80% accept rate
What's the TERM environment variable set to? For the Cygwin console, it should be cygwin. – ak2 May 14 '11 at 5:55
feedback

2 Answers

Something is broken in your terminal settings (probably).
I guess you would have already tried exiting that session and restarting a new one.

While you don't get a solution for the Cygwin terminal, give MinTTY a try (its actually better).

link|improve this answer
I see this problem in Cygwin across multiple machines, but MinTTY looks better and solves the wrapping problem. Two birds with one stone! – William Ting May 14 '11 at 21:10
feedback

I had the same problem with MinTTY as well. The problem probably has something to do with the primary prompt (PS1).

The solution for me was removing the last 'new line' character from PS1 (right before the '$' sign):

user@host ~
echo $PS1
\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$

user@host ~
export $PS1="\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\$"

user@host ~

see http://cygwin.com/ml/cygwin/2001-07/msg00140.html for reference.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.