How to change the prompt color in kde?

image
I just like the default ubuntu prompt color.

Is that Konsole?

And of course why should people here know about what Ubuntu does? Maybe some do, but for the rest you better tell exactly what you want.

Yes it is. I just want to make the prompt color green and the ~ blue, maybe change the > to a $.
Like this.

What you show has almost nothing to do with KDE, not even Konsole. It is the shell (bash I assume) that creates the prompts. the documentation about the several prompts in man bash will tel you all about it.

To shorten your study, you should first take a look at what PS1 is now. In my case:

henk@boven:~> echo $PS1
\[$(ppwd)\]\u@\h:\w>
henk@boven:~>

You could do the same echo $PS1 in your Ubuntu to see how it’s value is there. Then you can configure your own environment with it in ~/.profile by adding the line

export PS1="fill in here what you found in Ubuntu"

Regarding colors in Konsole: create a profile and adapt it to your wish…
Settings->Mange Profiles->+New (make it default afterwards)
In the profile menu you have the appearance sub menu…

Additionally you need to adapt the settings as mentioned by Henk.

When I export it, it doesn’t save when I exit out of konsole.

zasto@localhost:~> export PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$"
zasto@localhost:~$

Sorry that I said its a Konsole issue. I just don’t have enough technical expertise to determine if its the actual application itself or some other factor.

I did not say that you should do that in a shell session (it will of course then only be valid inside that shell session), I did say:

I do not know how to explain that more clear. So maybe re-read this. And when you still have questions about this, then ask.

BTW I see that you have pointers to the variable debian_chroot in there. I doubt very much that that is defined within openSUSE.

It is the application :laughing:. The application is bash . And it is running as a child process of a konsole (and vissible inside it), which is also an application (which is in any case a loose term with many meanings).

I finally understood it.

First go to the bashrc file

sudo nano ~/.bashrc

next paste your prompt color at the bottom.(I thought my bash was a error beacause it had nothing on it.)

# Sample .bashrc for SUSE Linux
# Copyright (c) SUSE Software Solutions Germany GmbH

# There are 3 different types of shells in bash: the login shell, normal shell
# and interactive shell. Login shells read ~/.profile and interactive shells
# read ~/.bashrc; in our setup, /etc/profile sources ~/.bashrc - thus all
# settings made here will also take effect in a login shell.
#
# NOTE: It is recommended to make language settings in ~/.profile rather than
# here, since multilingual X sessions would not work properly if LANG is over-
# ridden in every subshell.

test -s ~/.alias && . ~/.alias || true
export PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u>

after that save it by hiting ctrl+x, Yes, and enter. to let it take effect go and do this command.

source ~/.bashrc

And your done.(My eyes hurt after doing something easy, cuz I didn’t know how)

Why the sudo ???
This is about a user’s configuration file in the users home directory. this is not task for root at all!

And why not in .profile?

Because ~/.profile is only processed by the login shell.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.