Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

Let's say I type a shell command in gnome-terminal/bash that spans multiple lines and run it.

shell> abcdef ghijk lmn
opq rstuv wxyz

Then when I want to run the same command again, I hit the up-arrow. Instead of seeing the same command again (which always used to be the case), gnome-terminal now only shows me parts of the last line with a < at the beginning of the line:

<stuv wxyz

That is, no prompt, just that line.

If I hit CTRL-A at that point, I will get the first line of the original command with a > at the end.

shell> abcdef ghijk l>

Here, the prompt is back.

How can I configure my setup so that hitting the up-arrow after a long command will simply display the complete long command again, spanning multiple lines and including the prompt?

share|improve this question
This do not seems the default behavior. Can you please tell if the terminal profile has been changed, what shell are you using, if you modified ~/.bashrc, if you are using screen or every other possibly interesting information. – enzotib Aug 3 '11 at 7:58
I actually found out right after posting this that I screwed up my TERM variable, but I do not have enough points to answer my own question yet. – Thomas Aug 3 '11 at 9:47
up vote 2 down vote accepted

Make sure that your TERM variable is set correctly, i.e. reflecting the type of terminal you are on. Typically, you would export the TERM variable in your ~/.bashrc file, as outlined by Justin Andrusk's answer:

export TERM=xterm

In the case of the question, I had played with a complex command to extract search terms from a file, and I used a variable named TERM for the search terms, without realizing the significance of that variable name.

share|improve this answer

Modify your XTERM variable to 'xterm' in ~/.bashrc with:

export TERM=xterm


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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