SUMMARY Custom colorful "$PS1" env. variables causes editing the previous command or navigitaion via keys like "home" and "end" or "ctrl+tab" etc. STEPS TO REPRODUCE 1. Make colorful custom $PS1 var 2. Write some commands 3. Use arrow keys to get the previous command and try to edit it via the keys i mentioned above. OBSERVED RESULT Nothing works normally if i won't change to the default $PS1 var. EXPECTED RESULT Colorful PS1 var is useful. But it is not working great for me. SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: 5.17.5 KDE Frameworks Version: 5.66.0 Qt Version: 5.14.1 ADDITIONAL INFORMATION May be my $PS1 variable is broken or somewhat i missed sth. But i tried every posibility.
What do you set PS1 to?
(In reply to Ahmad Samir from comment #1) > What do you set PS1 to? It was: PS1='\e[1m[\e[35m\u\e[97m@\e[34m\h \W\e[97m]\$ \e[0m' I used tput instead of "\e[xxx" but it was not good either. Now, it is: PS1='[\u@\h \W]\$ '
Try: PS1='\[\e[1m[\e[35m\]\u\[\e[97m\]@\[\e[34m\]\h \W\[\e[97m]\]$ \[\e[0m\]' From `man bash`: \[ begin a sequence of non-printing characters, which could be used to embed a terminal control sequence into the prompt \] end a sequence of non-printing characters Also remove the "\" before "$".
(In reply to Ahmad Samir from comment #3) > Try: > PS1='\[\e[1m[\e[35m\]\u\[\e[97m\]@\[\e[34m\]\h \W\[\e[97m]\]$ \[\e[0m\]' > > From `man bash`: > \[ begin a sequence of non-printing characters, which could be used to > embed a terminal control sequence into the prompt > \] end a sequence of non-printing characters > > Also remove the "\" before "$". Thanks, it worked.