Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

2 Answers 2

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

 
discard

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.