LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-13-2008, 05:24 PM   #1
ninja master
Member
 
Registered: May 2008
Distribution: funtoo/gentoo amd64 xwrt
Posts: 412

Rep: Reputation: 31
konsole under xfce


does not show me as "user@home.org" it shows "sh" or "bash" when root. how do i fix this and set it back to "user@home.org" and also have it show the directory im working in?

THANKS!
 
Old 11-13-2008, 05:33 PM   #2
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
This has nothing to do with konsole or xfce try this:
Code:
export PS1="\u@\H \w > "
that should do the trick to make it permenent add it to your ~/.bashrc file
 
Old 11-13-2008, 05:33 PM   #3
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
- Deleted double post -

Last edited by johnson_steve; 11-13-2008 at 05:36 PM.
 
Old 11-13-2008, 05:36 PM   #4
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
I believe that would be the $PS1 variable. Try the following:
Code:
export PS1=\u@\h:\w\$
That should work temporarily. You can edit your ~/.bash_profile or ~/.bashrc to make that permanent. From `man bash`:
Code:
       When bash is invoked as an interactive login shell, or as a  non-inter-
       active  shell with the --login option, it first reads and executes com-
       mands from the file /etc/profile, if that file exists.   After  reading
       that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,
       in that order, and reads and executes commands from the first one  that
       exists  and  is  readable.  The --noprofile option may be used when the
       shell is started to inhibit this behavior.

       When a login shell exits, bash reads and  executes  commands  from  the
       file ~/.bash_logout, if it exists.

       When  an  interactive  shell that is not a login shell is started, bash
       reads and executes commands from ~/.bashrc, if that file exists.   This
       may  be inhibited by using the --norc option.  The --rcfile file option
       will force bash to read and  execute  commands  from  file  instead  of
       ~/.bashrc.
From that, I would guess you would want to put the PS1 settings in .bashrc instead of .bash_profile so it is read every time a shell is started. Note that you have to run
Code:
$ . ~/.bashrc
(or `source ~/.bashrc) to load the setting immediately following the change (or log out and back in).

[edit]Too late, I see. [/edit]
 
Old 11-13-2008, 09:30 PM   #5
ninja master
Member
 
Registered: May 2008
Distribution: funtoo/gentoo amd64 xwrt
Posts: 412

Original Poster
Rep: Reputation: 31
Code:
export PS1="\u@\H:\w$ "
this is what i was looking for

as for .bashrc i dont have one?!?!?

ok i created a .bashrc, and put
Code:
PS1="\u@\H:\w$ "
but on restart of Konsole it does not work =(

export PS1 command works fine, but as soon as i restart the konsole it goes back to the sh =(
 
Old 11-13-2008, 09:39 PM   #6
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
Log out and back in and it should work, as long as the ~/.bashrc file exists and is readable by your user.
 
Old 11-13-2008, 09:41 PM   #7
SqdnGuns
Senior Member
 
Registered: Aug 2005
Location: Pensacola, FL
Distribution: Slackware64® Current & Arch
Posts: 1,092

Rep: Reputation: 174Reputation: 174
Quote:
Originally Posted by ninja master View Post
Code:
export PS1="\u@\H:\w$ "
this is what i was looking for

as for .bashrc i dont have one?!?!?

ok i created a .bashrc, and put
Code:
PS1="\u@\H:\w$ "
but on restart of Konsole it does not work =(

export PS1 command works fine, but as soon as i restart the konsole it goes back to the sh =(
You need a ~/.bash_profile

Code:
#.bash_profile
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
Create it like you did for the .bashrc
 
Old 11-13-2008, 09:41 PM   #8
ninja master
Member
 
Registered: May 2008
Distribution: funtoo/gentoo amd64 xwrt
Posts: 412

Original Poster
Rep: Reputation: 31
ok i fixed it for good this time! it did have something to do with Konsole.

i had to go to settings, configure konsole.

under the session tab, get this, the "shell" didnt execute anything.

i added a line for it to execute "bash" and viola! i had to change the color scheme as a bright white console is not very friendly to the eyes.
 
Old 11-13-2008, 09:43 PM   #9
ninja master
Member
 
Registered: May 2008
Distribution: funtoo/gentoo amd64 xwrt
Posts: 412

Original Poster
Rep: Reputation: 31
i did log back in and out, but due to the "shell" instance not running bash it did NOTHING. im so happy its fixed now, that was soooo retarded wondering where the heck i was in my directory tree. =)
 
Old 11-13-2008, 09:43 PM   #10
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
Quote:
Originally Posted by SqdnGuns View Post
You need a ~/.bash_profile

Code:
#.bash_profile
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
Create it like you did for the .bashrc
I have that in my .bash_profile, but is I don't think it's necessary for a non-login shell, is it? Unless I'm reading the man page incorrectly, I think .bashrc is sourced when any non-login shell is started (like Konsole). Right?

Good to hear it's working. Yes, I guess you should be using bash in order for that to work. Strange that it wasn't automatically selected though.
 
Old 11-13-2008, 09:47 PM   #11
ninja master
Member
 
Registered: May 2008
Distribution: funtoo/gentoo amd64 xwrt
Posts: 412

Original Poster
Rep: Reputation: 31
and i did create .bash_rc .bashrc .bash_profile and restarted many many times. i was really at the point of wtfings. then i did a "session" "linux console" and it showed up the way i wanted it. i inspected the linux console configuration, and thats how i figured out it was not executing bash.
 
Old 11-13-2008, 09:47 PM   #12
SqdnGuns
Senior Member
 
Registered: Aug 2005
Location: Pensacola, FL
Distribution: Slackware64® Current & Arch
Posts: 1,092

Rep: Reputation: 174Reputation: 174
Quote:
Originally Posted by T3slider View Post
I have that in my .bash_profile, but is I don't think it's necessary for a non-login shell, is it? Unless I'm reading the man page incorrectly, I think .bashrc is sourced when any non-login shell is started (like Konsole). Right?

Good to hear it's working. Yes, I guess you should be using bash in order for that to work. Strange that it wasn't automatically selected though.
Dude, I believe you're right now that I think about it. Well, at least it won't break anything.
 
Old 11-13-2008, 09:48 PM   #13
ninja master
Member
 
Registered: May 2008
Distribution: funtoo/gentoo amd64 xwrt
Posts: 412

Original Poster
Rep: Reputation: 31
i was really confused as my konsole under kde and gnome works fine with the ps1, and under xfce it started doing the sh[it] =)
 
Old 11-13-2008, 09:58 PM   #14
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
Quote:
Originally Posted by SqdnGuns View Post
Dude, I believe you're right now that I think about it. Well, at least it won't break anything.
No, it definitely won't break anything. I just have that in my .bash_profile so in a login shell (ie in runlevel 3) all of my aliases will still work since .bashrc is not sourced in a login shell. It just depends on your usage patterns.
 
Old 11-15-2008, 05:07 AM   #15
ninja master
Member
 
Registered: May 2008
Distribution: funtoo/gentoo amd64 xwrt
Posts: 412

Original Poster
Rep: Reputation: 31
ok back to this sh problem.... when ever i "su" to root, it goes back to "bash" instead of showing my working directory =(

maybe this is because i do not have my .bashrc or .bash_profile in the /root/ directory??? =(
 
  


Reply



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
Konsole always give SuperUser Konsole - can't get regular shell checkmate3001 Linux - Desktop 3 08-05-2008 10:00 AM
XFce and Compiz : xfce doesn't manage the desktop naaman Linux - Desktop 0 07-16-2008 01:39 AM
konsole acts as "Root Konsole" ab44045 Linux - General 11 06-11-2007 05:18 PM
XFCE Network ServersI use XFCE (sometimes) but I can not find my network folders on a holzster Ubuntu 0 10-24-2006 05:48 PM
Xfce problems with task bar and xfce-panel aeruzcar Linux - Software 4 06-26-2006 05:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:32 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