Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 952  / 2 Years ago, sat, august 6, 2022, 10:54:41

In a terminal emulator like xterm my prompt looks like this:



[august@macmini ~]$


but in a virtual console the string ;linux is prepended to the prompt to make it look like this:



;linux[august@macmini ~]$


Does anyone know where the "linux" string may come from?


More From » bash

 Answers
5

It turns out that things go wrong when a command to set the window title is executed in a virtual console (where there is no window). Changing



PROMPT_COMMAND='printf "e]0;%sa" "$TERM"'


to



if [[ $TERM = xterm* ]]; then
PROMPT_COMMAND='printf "e]0;%sa" "$TERM"'
fi


solves the problem.


[#31376] Monday, August 8, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
strhen

Total Points: 27
Total Questions: 111
Total Answers: 103

Location: Angola
Member since Tue, Apr 25, 2023
1 Year ago
;