LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-16-2005, 09:34 AM   #1
lasindi
Member
 
Registered: Apr 2004
Distribution: Slackware, Ubuntu
Posts: 101

Rep: Reputation: 15
How to configure Konsole bash prompt?


This is a problem I've had for a while and I want to finally fix it. If I log in from the console the bash prompt looks fine, and if I do 'ls', directories will appear blue, executable files appear green, and all that neat stuff. However, if I start up Konsole inside KDE, I get an ugly prompt with nothing more than 'bash-2.05b$' (or # if I'm root) and 'ls' doesn't produce colors. Why doesn't Konsole simply rely on the bash configuration files like the non-X console?

Also, I'm just curious how you can erase the command history in Konsole. I know that if you delete ~/.bash_history, it stays there. Where does Konsole store this stuff?

lasindi
 
Old 01-16-2005, 09:44 AM   #2
Linux~Powered
Member
 
Registered: Jan 2004
Location: /lost+found
Distribution: Slackware 14.2
Posts: 849

Rep: Reputation: 33
Create the file ~/.bash_profile and add what ever you want into it.

For your colors...

#Set up the LS_COLORS and LS_OPTIONS environment variables for color ls:
if [ "$SHELL" = "/bin/zsh" ]; then
eval `dircolors -z`
elif [ "$SHELL" = "/bin/ash" ]; then
eval `dircolors -s`
else
eval `dircolors -b`
fi

To get rid of the bash-2.05b$...

PS1="\u\[@\H\w\[$"

After your done run...

source .bash_profile

To cleary your bash_history on every logout...

(I think it's...)

history -c In your ~/.logout file

Last edited by Linux~Powered; 01-16-2005 at 09:51 AM.
 
Old 01-16-2005, 10:44 AM   #3
lasindi
Member
 
Registered: Apr 2004
Distribution: Slackware, Ubuntu
Posts: 101

Original Poster
Rep: Reputation: 15
What you said will work, except it won't last I load up a new Konsole window. What I mean is, I made the changes to .bash_profile, open Konsole, and enter

Code:
source .bash_profile
and the nice pretty bash prompt I want pops up. However, if I close the window and open Konsole again, we're back to ugly old 'bash-2.05b$'. Any more ideas?

lasindi
 
Old 01-16-2005, 10:48 AM   #4
Linux~Powered
Member
 
Registered: Jan 2004
Location: /lost+found
Distribution: Slackware 14.2
Posts: 849

Rep: Reputation: 33
Put it into a .bashrc file then.
 
Old 01-16-2005, 03:34 PM   #5
lasindi
Member
 
Registered: Apr 2004
Distribution: Slackware, Ubuntu
Posts: 101

Original Poster
Rep: Reputation: 15
It works! Thanks a lot.

I don't even have a ~/.logout file. Do you have any other clues as to where the file(s) are?

lasindi
 
Old 01-16-2005, 05:31 PM   #6
Linux~Powered
Member
 
Registered: Jan 2004
Location: /lost+found
Distribution: Slackware 14.2
Posts: 849

Rep: Reputation: 33
Make a ~/.logout file and put...

Code:
history -c
into it so that every time you logout your bash history will be erased. If you're clearing it for security reasons you can also limit the amount of lines that the history will save before it start to rewrite itself. The default it 500... i think.
 
Old 01-16-2005, 05:38 PM   #7
lasindi
Member
 
Registered: Apr 2004
Distribution: Slackware, Ubuntu
Posts: 101

Original Poster
Rep: Reputation: 15
Oh, I see. 'history -c' is just a command. OK, thanks again!

lasindi
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
no konsole prompt in mandrake 9.1 bcf2 Linux - Newbie 4 08-05-2009 11:13 PM
configure bash to not show what you type until the prompt juanbobo Linux - Software 1 04-01-2005 01:55 PM
Konsole prompt drguitarum2005 Linux - Newbie 1 02-21-2005 01:57 AM
Suse Konsole prompt ? blavo SUSE / openSUSE 6 10-13-2004 05:01 AM
Konsole prompt/commands UB_KMA Linux - Newbie 4 07-12-2002 12:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration