Not an important issue, but...I like the way Konsole now uses a green color for the prompt while keeping white or grey for the rest. However, I can't seem to do that. When I try to change the colors, everything changes. How can I get the prompt only to appear in green?
Announcement
Collapse
No announcement yet.
Konsole Kolors
Collapse
This topic is closed.
X
X
-
Originally posted by oldgeek View PostNot an important issue, but...I like the way Konsole now uses a green color for the prompt while keeping white or grey for the rest. However, I can't seem to do that. When I try to change the colors, everything changes. How can I get the prompt only to appear in green?If you think Education is expensive, try ignorance.
The difference between genius and stupidity is genius has limits.
- Top
- Bottom
-
Yes, but I don't get what you posted, just a list of color schemes to choose. I'm currently using Breeze. How do I get the prompt to go green? By the way, my configuration if Konsole is probably 16.04 (I'm using 18.04) since I copied it directly from Aptik before I started using btrfs. Does that make any difference?
- Top
- Bottom
Comment
-
In the konsole, I like green text on a black background.
Using the konsole Settings, then the Appearance tab, about half way to the bottom of choices select green on black. As a personal choice, I also up the text size to 11. Click OK to exit SettingsLinux User #454271
- Top
- Bottom
Comment
-
Edit .bashrc (it's in your user /home directory). User your favorite editor.
Find and then change to match the following section:
Code:# set a fancy prompt (non-color, unless we know we "want" color)case "$TERM" in xterm-color|*-256color) color_prompt=yes;; esac # uncomment for a colored prompt, if the terminal has the capability; turned # off by default to not distract the user: the focus in a terminal window # should be on the output of commands, not on the prompt #force_color_prompt=yes if [ -n "$force_color_prompt" ]; then if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then # We have color support; assume it's compliant with Ecma-48 # (ISO/IEC-6429). (Lack of such support is extremely rare, and such # a case would tend to support setf rather than setaf.) color_prompt=yes else color_prompt= fi fi if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' else PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' fi unset color_prompt force_color_prompt
Windows no longer obstructs my view.
Using Kubuntu Linux since March 23, 2007.
"It is a capital mistake to theorize before one has data." - Sherlock Holmes
- Top
- Bottom
Comment
-
My answer is essentially the same as snowhog's, but a bit more simplified and elucidated.
First, choose your colour, or colours. To see the basic set of 16, run this in bash:Code:csi=$'\e[' for n in $(seq 30 37);do echo -n "${csi}${n}m $n${csi}1;${n}m $n${csi}0m";done
If the basic 16 are not enough, konsole does RGB. F.ex., runCode:csi=$'\e[' c=($(seq 8 32 255)) for r in ${c[@]};do for g in ${c[@]};do for b in ${c[@]};do echo -n "${csi}38;2;$r;$g;${b}m$r;$g:$b ";done ;done ;done
Having picked your colour, you can then put the codes for it in your PS1 variable. snowhog has pasted the standard debian stuff for this, but I think it's needlessly general; for example, mostly you know who you are, what system you're on, and that your konsole can do colour. I think also that you're very unlikely to be doing a debian chroot most of the time, if ever, so being reminded of that is unnecessary. So, I leave out the chroot stuff, \u for your user name, and \h for the host name. The \w for the "working directory" is useful, though. I also suggest adding the history number, it makes it easy to repeat stuff, that's "\!".
So I suggest:Code:csi=$'\e[' code="38;2;128;255;40" # greenish light yellow PS1='\[$csi${code}m\]\! \w \$\[${csi}0m\] '
Regards, John Little
- Top
- Bottom
Comment
Comment