No color in terminal on KDE












1














I have no colors in my terminal on KDE Kubuntu 16.04.1.



Here it doesn't work



here is my .bashrc (I copied it from an Ubuntu-Server 16.04.1 but I always used this one also on former KUbuntu 12.04.)



# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi

# 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)}[]u[] @ []h[]:[]w[]$ '
else
PS1='${debian_chroot:+($debian_chroot)}u@h:w$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="[]$PS1"
;;
*)
;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi

# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '''s/^s*[0-9]+s‍/;s/[;&|]s*alert$ //''')"'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi


I also tried this and this but I have no color in terminal nor via ssh though



> echo $TERM
xterm-color


Anyway the colored output of apt update or ls -a e.g. works



la works to so color in general works



only not the prompt which I would expect to look like on the other server where I copied the .bashrc from and where it is working:



Here it works



Is there something I'm missing? How can I get the colored prompt working? (Especially asking because I want my green and the root's red but none of both work)










share|improve this question
























  • What if you remove the conditional and just set the colored PS1? If you get a colored PS1 in that way, it means somehow the conditional doesn't work for you.
    – AlvaroGMJ
    Sep 21 '17 at 13:36










  • @AlvaroGMJ Thanks for your help. As John Smith already pointed out I copied the script the wrong way into the server so that PS1 never was set correctly
    – derHugo
    Sep 22 '17 at 17:26


















1














I have no colors in my terminal on KDE Kubuntu 16.04.1.



Here it doesn't work



here is my .bashrc (I copied it from an Ubuntu-Server 16.04.1 but I always used this one also on former KUbuntu 12.04.)



# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi

# 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)}[]u[] @ []h[]:[]w[]$ '
else
PS1='${debian_chroot:+($debian_chroot)}u@h:w$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="[]$PS1"
;;
*)
;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi

# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '''s/^s*[0-9]+s‍/;s/[;&|]s*alert$ //''')"'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi


I also tried this and this but I have no color in terminal nor via ssh though



> echo $TERM
xterm-color


Anyway the colored output of apt update or ls -a e.g. works



la works to so color in general works



only not the prompt which I would expect to look like on the other server where I copied the .bashrc from and where it is working:



Here it works



Is there something I'm missing? How can I get the colored prompt working? (Especially asking because I want my green and the root's red but none of both work)










share|improve this question
























  • What if you remove the conditional and just set the colored PS1? If you get a colored PS1 in that way, it means somehow the conditional doesn't work for you.
    – AlvaroGMJ
    Sep 21 '17 at 13:36










  • @AlvaroGMJ Thanks for your help. As John Smith already pointed out I copied the script the wrong way into the server so that PS1 never was set correctly
    – derHugo
    Sep 22 '17 at 17:26
















1












1








1







I have no colors in my terminal on KDE Kubuntu 16.04.1.



Here it doesn't work



here is my .bashrc (I copied it from an Ubuntu-Server 16.04.1 but I always used this one also on former KUbuntu 12.04.)



# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi

# 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)}[]u[] @ []h[]:[]w[]$ '
else
PS1='${debian_chroot:+($debian_chroot)}u@h:w$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="[]$PS1"
;;
*)
;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi

# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '''s/^s*[0-9]+s‍/;s/[;&|]s*alert$ //''')"'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi


I also tried this and this but I have no color in terminal nor via ssh though



> echo $TERM
xterm-color


Anyway the colored output of apt update or ls -a e.g. works



la works to so color in general works



only not the prompt which I would expect to look like on the other server where I copied the .bashrc from and where it is working:



Here it works



Is there something I'm missing? How can I get the colored prompt working? (Especially asking because I want my green and the root's red but none of both work)










share|improve this question















I have no colors in my terminal on KDE Kubuntu 16.04.1.



Here it doesn't work



here is my .bashrc (I copied it from an Ubuntu-Server 16.04.1 but I always used this one also on former KUbuntu 12.04.)



# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi

# 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)}[]u[] @ []h[]:[]w[]$ '
else
PS1='${debian_chroot:+($debian_chroot)}u@h:w$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="[]$PS1"
;;
*)
;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi

# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '''s/^s*[0-9]+s‍/;s/[;&|]s*alert$ //''')"'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi


I also tried this and this but I have no color in terminal nor via ssh though



> echo $TERM
xterm-color


Anyway the colored output of apt update or ls -a e.g. works



la works to so color in general works



only not the prompt which I would expect to look like on the other server where I copied the .bashrc from and where it is working:



Here it works



Is there something I'm missing? How can I get the colored prompt working? (Especially asking because I want my green and the root's red but none of both work)







terminal kde xterm kubuntu






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 20 '18 at 0:00









Rui F Ribeiro

39k1479130




39k1479130










asked Sep 21 '17 at 11:02









derHugo

1125




1125












  • What if you remove the conditional and just set the colored PS1? If you get a colored PS1 in that way, it means somehow the conditional doesn't work for you.
    – AlvaroGMJ
    Sep 21 '17 at 13:36










  • @AlvaroGMJ Thanks for your help. As John Smith already pointed out I copied the script the wrong way into the server so that PS1 never was set correctly
    – derHugo
    Sep 22 '17 at 17:26




















  • What if you remove the conditional and just set the colored PS1? If you get a colored PS1 in that way, it means somehow the conditional doesn't work for you.
    – AlvaroGMJ
    Sep 21 '17 at 13:36










  • @AlvaroGMJ Thanks for your help. As John Smith already pointed out I copied the script the wrong way into the server so that PS1 never was set correctly
    – derHugo
    Sep 22 '17 at 17:26


















What if you remove the conditional and just set the colored PS1? If you get a colored PS1 in that way, it means somehow the conditional doesn't work for you.
– AlvaroGMJ
Sep 21 '17 at 13:36




What if you remove the conditional and just set the colored PS1? If you get a colored PS1 in that way, it means somehow the conditional doesn't work for you.
– AlvaroGMJ
Sep 21 '17 at 13:36












@AlvaroGMJ Thanks for your help. As John Smith already pointed out I copied the script the wrong way into the server so that PS1 never was set correctly
– derHugo
Sep 22 '17 at 17:26






@AlvaroGMJ Thanks for your help. As John Smith already pointed out I copied the script the wrong way into the server so that PS1 never was set correctly
– derHugo
Sep 22 '17 at 17:26












1 Answer
1






active

oldest

votes


















1














I may be wrong, but I do not see any color-related syntax in your script



PS1='${debian_chroot:+($debian_chroot)}[]u[] @ []h[]:[]w[]$ '


When I call your code from my bash prompt



PS1='[]u[] @ []h[]:[]w[]$ '


I see just white letters. You do not even have export PS1, which means that this variable never affects anything outside the script. My guess is that on your old machine some other script was responsible for colors.



In order to get the colors, which you have posted, try to call the following from your terminal



PS1='[33[1;32m]u[33[0m] @ [33[0;32m]h[33[0m]:[33[31m]W[33[0m]$ '


if it works, put



export PS1='[33[1;32m]u[33[0m] @ [33[0;32m]h[33[0m]:[33[31m]W[33[0m]$ '


into your ~/.bashrc.






share|improve this answer





















  • A big huge facepalm here on my side :D ... What I did: I used cat .bashrc on the one server and copy pasted the output to the other server... What happened: Ofcourse (stupid me) when I did cat .bashrc the code e.g. }[^[[01;32m]u[^[[00m] got printed out as a fad green string like ]u[ :D :D didn't notice that line when I just copied the whole output of cat.
    – derHugo
    Sep 21 '17 at 16:33












  • no problem, similar things happened to me too on numerous occasions) thanks for marking my answer. but in future better use scp or rsync for moving files between servers.
    – John Smith
    Sep 21 '17 at 16:39












  • yeah I usually use those or sometimes even nano .. but this time I wanted to be fast ... :P turned out to be slower than the usual :D
    – derHugo
    Sep 21 '17 at 16:45











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f393606%2fno-color-in-terminal-on-kde%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














I may be wrong, but I do not see any color-related syntax in your script



PS1='${debian_chroot:+($debian_chroot)}[]u[] @ []h[]:[]w[]$ '


When I call your code from my bash prompt



PS1='[]u[] @ []h[]:[]w[]$ '


I see just white letters. You do not even have export PS1, which means that this variable never affects anything outside the script. My guess is that on your old machine some other script was responsible for colors.



In order to get the colors, which you have posted, try to call the following from your terminal



PS1='[33[1;32m]u[33[0m] @ [33[0;32m]h[33[0m]:[33[31m]W[33[0m]$ '


if it works, put



export PS1='[33[1;32m]u[33[0m] @ [33[0;32m]h[33[0m]:[33[31m]W[33[0m]$ '


into your ~/.bashrc.






share|improve this answer





















  • A big huge facepalm here on my side :D ... What I did: I used cat .bashrc on the one server and copy pasted the output to the other server... What happened: Ofcourse (stupid me) when I did cat .bashrc the code e.g. }[^[[01;32m]u[^[[00m] got printed out as a fad green string like ]u[ :D :D didn't notice that line when I just copied the whole output of cat.
    – derHugo
    Sep 21 '17 at 16:33












  • no problem, similar things happened to me too on numerous occasions) thanks for marking my answer. but in future better use scp or rsync for moving files between servers.
    – John Smith
    Sep 21 '17 at 16:39












  • yeah I usually use those or sometimes even nano .. but this time I wanted to be fast ... :P turned out to be slower than the usual :D
    – derHugo
    Sep 21 '17 at 16:45
















1














I may be wrong, but I do not see any color-related syntax in your script



PS1='${debian_chroot:+($debian_chroot)}[]u[] @ []h[]:[]w[]$ '


When I call your code from my bash prompt



PS1='[]u[] @ []h[]:[]w[]$ '


I see just white letters. You do not even have export PS1, which means that this variable never affects anything outside the script. My guess is that on your old machine some other script was responsible for colors.



In order to get the colors, which you have posted, try to call the following from your terminal



PS1='[33[1;32m]u[33[0m] @ [33[0;32m]h[33[0m]:[33[31m]W[33[0m]$ '


if it works, put



export PS1='[33[1;32m]u[33[0m] @ [33[0;32m]h[33[0m]:[33[31m]W[33[0m]$ '


into your ~/.bashrc.






share|improve this answer





















  • A big huge facepalm here on my side :D ... What I did: I used cat .bashrc on the one server and copy pasted the output to the other server... What happened: Ofcourse (stupid me) when I did cat .bashrc the code e.g. }[^[[01;32m]u[^[[00m] got printed out as a fad green string like ]u[ :D :D didn't notice that line when I just copied the whole output of cat.
    – derHugo
    Sep 21 '17 at 16:33












  • no problem, similar things happened to me too on numerous occasions) thanks for marking my answer. but in future better use scp or rsync for moving files between servers.
    – John Smith
    Sep 21 '17 at 16:39












  • yeah I usually use those or sometimes even nano .. but this time I wanted to be fast ... :P turned out to be slower than the usual :D
    – derHugo
    Sep 21 '17 at 16:45














1












1








1






I may be wrong, but I do not see any color-related syntax in your script



PS1='${debian_chroot:+($debian_chroot)}[]u[] @ []h[]:[]w[]$ '


When I call your code from my bash prompt



PS1='[]u[] @ []h[]:[]w[]$ '


I see just white letters. You do not even have export PS1, which means that this variable never affects anything outside the script. My guess is that on your old machine some other script was responsible for colors.



In order to get the colors, which you have posted, try to call the following from your terminal



PS1='[33[1;32m]u[33[0m] @ [33[0;32m]h[33[0m]:[33[31m]W[33[0m]$ '


if it works, put



export PS1='[33[1;32m]u[33[0m] @ [33[0;32m]h[33[0m]:[33[31m]W[33[0m]$ '


into your ~/.bashrc.






share|improve this answer












I may be wrong, but I do not see any color-related syntax in your script



PS1='${debian_chroot:+($debian_chroot)}[]u[] @ []h[]:[]w[]$ '


When I call your code from my bash prompt



PS1='[]u[] @ []h[]:[]w[]$ '


I see just white letters. You do not even have export PS1, which means that this variable never affects anything outside the script. My guess is that on your old machine some other script was responsible for colors.



In order to get the colors, which you have posted, try to call the following from your terminal



PS1='[33[1;32m]u[33[0m] @ [33[0;32m]h[33[0m]:[33[31m]W[33[0m]$ '


if it works, put



export PS1='[33[1;32m]u[33[0m] @ [33[0;32m]h[33[0m]:[33[31m]W[33[0m]$ '


into your ~/.bashrc.







share|improve this answer












share|improve this answer



share|improve this answer










answered Sep 21 '17 at 16:05









John Smith

1,12868




1,12868












  • A big huge facepalm here on my side :D ... What I did: I used cat .bashrc on the one server and copy pasted the output to the other server... What happened: Ofcourse (stupid me) when I did cat .bashrc the code e.g. }[^[[01;32m]u[^[[00m] got printed out as a fad green string like ]u[ :D :D didn't notice that line when I just copied the whole output of cat.
    – derHugo
    Sep 21 '17 at 16:33












  • no problem, similar things happened to me too on numerous occasions) thanks for marking my answer. but in future better use scp or rsync for moving files between servers.
    – John Smith
    Sep 21 '17 at 16:39












  • yeah I usually use those or sometimes even nano .. but this time I wanted to be fast ... :P turned out to be slower than the usual :D
    – derHugo
    Sep 21 '17 at 16:45


















  • A big huge facepalm here on my side :D ... What I did: I used cat .bashrc on the one server and copy pasted the output to the other server... What happened: Ofcourse (stupid me) when I did cat .bashrc the code e.g. }[^[[01;32m]u[^[[00m] got printed out as a fad green string like ]u[ :D :D didn't notice that line when I just copied the whole output of cat.
    – derHugo
    Sep 21 '17 at 16:33












  • no problem, similar things happened to me too on numerous occasions) thanks for marking my answer. but in future better use scp or rsync for moving files between servers.
    – John Smith
    Sep 21 '17 at 16:39












  • yeah I usually use those or sometimes even nano .. but this time I wanted to be fast ... :P turned out to be slower than the usual :D
    – derHugo
    Sep 21 '17 at 16:45
















A big huge facepalm here on my side :D ... What I did: I used cat .bashrc on the one server and copy pasted the output to the other server... What happened: Ofcourse (stupid me) when I did cat .bashrc the code e.g. }[^[[01;32m]u[^[[00m] got printed out as a fad green string like ]u[ :D :D didn't notice that line when I just copied the whole output of cat.
– derHugo
Sep 21 '17 at 16:33






A big huge facepalm here on my side :D ... What I did: I used cat .bashrc on the one server and copy pasted the output to the other server... What happened: Ofcourse (stupid me) when I did cat .bashrc the code e.g. }[^[[01;32m]u[^[[00m] got printed out as a fad green string like ]u[ :D :D didn't notice that line when I just copied the whole output of cat.
– derHugo
Sep 21 '17 at 16:33














no problem, similar things happened to me too on numerous occasions) thanks for marking my answer. but in future better use scp or rsync for moving files between servers.
– John Smith
Sep 21 '17 at 16:39






no problem, similar things happened to me too on numerous occasions) thanks for marking my answer. but in future better use scp or rsync for moving files between servers.
– John Smith
Sep 21 '17 at 16:39














yeah I usually use those or sometimes even nano .. but this time I wanted to be fast ... :P turned out to be slower than the usual :D
– derHugo
Sep 21 '17 at 16:45




yeah I usually use those or sometimes even nano .. but this time I wanted to be fast ... :P turned out to be slower than the usual :D
– derHugo
Sep 21 '17 at 16:45


















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f393606%2fno-color-in-terminal-on-kde%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Morgemoulin

Scott Moir

Souastre