Why does default shell prompt PS1 contain newlines (\n)?

"\"[[\"Dr. Matthias H. Fröhlich" Dr.M.H.Froehlich@IEEE.org
Wed Apr 5 16:53:00 GMT 2017

After installing "plain vanilla" cygwin I noticed, that default definition of PS1 from /etc/bash.bashrc contains newline characters '\n':
     # Set a default prompt of: user@host and current_directory
     PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '

This does immediately lead to the strange effect, that shell (bash) in interactive terminal window (C:\cygwin64\bin\mintty.exe -i /Cygwin-Terminal.ico -) always advances 2 lines on every single CR.

This definition seems to be around pretty long already, as it is mentioned in several discussions on superuser &c. There is probably a very good reason for this - however, I could not figure out on my own, neither found any rationale in FAQ. Would be grateful for short explanation - thanks in advance.

Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

More information about the Cygwin mailing list