Jump to content
Sign in to follow this  
orts

Name in konsole [solved]

Recommended Posts

Hi All

 

How can I change the name in konsole from bash-3.2$ to [orts@localhost] $? like it was in the older versions of Mandriva.

 

I find this pretty annoying, because when I change to another directory, I can't see that I really are in the wanted directory.

If I'm logged in as admin in konsole I have the old "name" [root@localhost] # and can see which directory I'm working in at the time. like this [root@localhost orts] #

 

I really hope that someone can help me, this is the only thing that I find is wrong with Mandriva 2008.

 

 

[moved from Software by spinynorman]

Share this post


Link to post
Share on other sites

I'm not booted in Linux now, but this is usually set in .bash_profile from what I remember. I'll have to check my system when I next boot into it, unless someone beats me to it. Either that or /etc/profile or something.

 

It's a combination of prompt=$whatever, or similar to get that output you desire.

Share this post


Link to post
Share on other sites

Something like this:

 

if [ -n "${BASH_VERSION}" ]; then
	# Newer bash ebuilds include /etc/bash/bashrc which will setup PS1
	# including color.  We leave out color here because not all
	# terminals support it.
	if [ -f /etc/bash/bashrc ]; then
			# Bash login shells run only /etc/profile
			# Bash non-login shells run only /etc/bash/bashrc
			# Since we want to run /etc/bash/bashrc regardless, we source it
			# from here.  It is unfortunate that there is no way to do
			# this *after* the user's .bash_profile runs (without putting
			# it in the user's dot-files), but it shouldn't make any
			# difference.
			. /etc/bash/bashrc
	else
			PS1='\u@\h \w \$ '
	fi
else
	# Setup a bland default prompt.  Since this prompt should be useable
	# on color and non-color terminals, as well as shells that don't
	# understand sequences such as \h, don't put anything special in it.
	PS1="`whoami`@`uname -n | cut -f1 -d.` \$ "
fi

 

will do it. From my /etc/profile in Gentoo, but should more or less be the same. Compare your Mandriva distros. Alternatively look at the bashrc file.

Share this post


Link to post
Share on other sites

I have tried to compare /etc/bashrc and /etc/profile in Mandriva 2008.0 and Mandriva 2007.1.

And they look exactly alike, I really cant find anything written in another way.

 

Now I do belive the problem are somewhere els, any ideas?

Share this post


Link to post
Share on other sites

If you want to change "localhost" to something else, you have change your PC's host name in mcc, don't remember where exactly (i don't use mandriva), but it should be somewhere in network>>alter misc' network options.

 

P.S. I use a LAN connection so that might not work for you

 

here how it looks in PCLinuxOS:

 

Edited by ilia_kr

Share this post


Link to post
Share on other sites

Here's my entry in ~/.bashrc :

# customize prompt
PS1='\[\033[1;33m\]\u \W $ \[\033[0m\]'

I don't care about localhost, that's where I always am, so I've just got username \u and working directory \W. The rest of it just makes the prompt yellow so it stands out from all the other text in the console.

 

This is assuming you do mean the command prompt, or do you really mean the title of the window?

Share this post


Link to post
Share on other sites

Thanks for all your help.

 

Of some reason the .bashrc file, didn't excist in my home folder, so I installed Mandriva 2007.1 in Virtualbox, and copied the .bashrc from 2007.1 to Mandriva 2008, and now it works. :D

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...