Setting PS1 variable for KDE Konsole shell (RH9)
Howdy All!
I have set PS1 in my .bash_profile, but this has no effect on KDE's Konsole. I seem to remember reading somewhere that it is a slightly different program and doesn't read the profile? So how do I alter PS1 for Konsole so it will 'stick'? Thanks for any advice! Rob :) |
Go into settings, configure knosole, click sessions.
In there click linux console, and look at how it's beeing invoked. I usually use: bash --init-file ~/.bash_profile It starts up bash with the bash_profile as the initfile |
Its ~/.bashrc that you'll need to modify.
For example - add something like this - PS1=”\w Hello $” choose your own characters. |
CAUTION!!!
Before messing with these files, always make a copy of the original. IE: cp .bashrc .bashrc.org Just in case PS1 can be set in .bashrc or .bash_profile, but it has to be exported. IE: PS1=Waiting$ PS2=OOPS! export PS1 PS2 to test the new .bashrc enter . .bashrc at the user prompt. $ . .bashrc This will re-execute the .bashrc file without rebooting either XWindows or the OS. Walt R. |
Thanks for the help - I just had to source ~/.bash_profile from ~/.bashrc:
# Source bash profile if [ -f ~/.bash_profile ] then . ~/.bash_profile fi And remove the code in .bash_profile that sources .bashrc (to prevent an infinite loop!): # Get the aliases and functions #if [ -f ~/.bashrc ]; then # . ~/.bashrc #fi Then it worked! Rob :) |
All times are GMT -5. The time now is 08:48 AM. |