Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As you can see in the screenshot, I have an unneeded newline character in my prompt. Anyone know how to do remove this character from my prompt?

enter image description here

share|improve this question
Then stop pressing Enter? – Ignacio Vazquez-Abrams Jan 18 '12 at 10:55
-1, this is not a diagram, and this question means nothing. – Ravachol Jan 18 '12 at 11:01
Can you explain a bit more about what you mean? – Paul Jan 18 '12 at 11:01
@Ravachol Please use comments to provide constructive guidance to help the OP provide enough information – Paul Jan 18 '12 at 11:04
The thing is that the questioner knows the answer to the question as it is asked. Xe stated it in this almost identical question that xe asked three hours earlier. – JdeBP Jan 18 '12 at 17:45
up vote 4 down vote accepted

This "new line character" is part of your Bash prompt, kept in the $PS1 variable:

PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\] \$ '

Remove it and put the updated PS1 in your ~/.bashrc.

See Customizing bash prompt for further information.

share|improve this answer
That's great!, how do you my PS1 having the \n? – Kit Ho Jan 19 '12 at 1:10
@Kit: I guessed. – grawity Jan 19 '12 at 9:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .