Monday, April 29, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 901  / 1 Year ago, sun, december 25, 2022, 2:54:40

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?


More From » command-line

 Answers
5

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.


[#44017] Sunday, December 25, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
odenanno

Total Points: 207
Total Questions: 113
Total Answers: 94

Location: South Korea
Member since Sat, Oct 2, 2021
3 Years ago
;