Why does PS1 get unset when I run X Windows / KDE?
by emmet from LinuxQuestions.org on (#5PXV4)
So today was a day of reckoning. I finally grew sufficiently weary of being reminded by every shell prompt in Xfce Terminal or Konsole that I was running bash-5.1 to actually do something about it. So after a bit of fumbling about and relearning for the nth time the difference between .bash_profile and .bashrc, I got the perfectly cromulent bash prompt that I already had in the console by default.
What did I do in .bashrc? I assigned a value to PS1 and exported that assignment:
#!/bin/bash
export PS1='\u@\h:\w\$ '
Issue solved. But why did I have this issue?
PS1 gets defined and exported in /etc/profile. That definition endures all the trials and tribulations of console life, but when I run startx (runlevel 3 rules!) PS1 gets crushed. Why the PS1 hate in the gui? Is this some kind of anti-terminal bias? Why has my terminal emulator been having to deal with a hostile work environment? This terminal emulator is now safe. Going forward, PS1 is always going to be there. But what about all the other terminal emulators out there? Why does PS1 get unset?
What did I do in .bashrc? I assigned a value to PS1 and exported that assignment:
#!/bin/bash
export PS1='\u@\h:\w\$ '
Issue solved. But why did I have this issue?
PS1 gets defined and exported in /etc/profile. That definition endures all the trials and tribulations of console life, but when I run startx (runlevel 3 rules!) PS1 gets crushed. Why the PS1 hate in the gui? Is this some kind of anti-terminal bias? Why has my terminal emulator been having to deal with a hostile work environment? This terminal emulator is now safe. Going forward, PS1 is always going to be there. But what about all the other terminal emulators out there? Why does PS1 get unset?