[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Solved] Re: Problem with colors in terminal



Le 12-07-2017, à 11:05:22 +0200, deloptes a écrit :

steve wrote:

We see that LS_COLORS is set in xterm but not in xfce4-terminal. I don't
understand why since both should read ~/.bashrc when executed.

Any ideas?

I think .bashrc is read only if you use bash as login shell.
You can try bash --login and see if color works, or check if it is executed
as login shell

You're my hero!

Trying 'bash --login' gave me colors. xfce4-terminal was treated as a
non-login interactive shell, and thus was not reading $HOME/.bashrc.

So I created a file $HOME/.bash_profile with the following in it:

[ -f "$HOME/.profile" ] && source "$HOME/.profile"
[ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc"

Now if bash is started as an interactive login shell it will read the following
files:

   ~/.bash_profile
   ~/.profile
   ~/.bashrc

and if bash is started as an interactive non-login shell:

   ~/.bashrc

(one can read https://askubuntu.com/questions/132276/configure-gnome-terminal-to-start-bash-as-a-login-shell-doesnt-read-bashrc/132319 for more info)


I also had to change my TERM variable to xterm-color in order to work.

(Rem: I also tried to check the box for that option in the preferences, but
that didn't work)

Question remains on why this behaviour changed from Jessie -> Stretch.

Thanks a lot, this issue was driving me insane.

Best,
Steve



Reply to: