restore terminal UP4/XFCE

Archived topics about LMDE 1 and LMDE 2
Locked
tamerlane

restore terminal UP4/XFCE

Post by tamerlane »

Upgraded to pack 4 the other day, and discovered it trashed the previous default terminal colors. Now its a bland gray on black, making it very hard to distinguish commands from the prompt itself, as well as no colours in the dirlist. Screenshot attached.

I'd prefer the old style green/blue for users, and red for root. I know the line in /etc/bash.bashrc to edit, just don't know the previous values.

[edit] ~/.bashrc is non-existant, only config file I have is /etc/bash.bashrc

Image
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
jjaythomas

Re: restore terminal LMDE/XFCE

Post by jjaythomas »

Not sure if on XFCE or Gnome version...

in the XFCE Terminal you can change the colors under edit->preferences then a tab called colors

Don't know if both XFCE and Gnome version uses same terminal. :wink:

J.Jay
jjaythomas

Re: restore terminal LMDE/XFCE

Post by jjaythomas »

Sorry didn't see using XFCE terminal

P.S. I'm a GUI 'cut & paste' kinda guy :P

J.Jay
tamerlane

Re: restore terminal LMDE/XFCE

Post by tamerlane »

You can only change text & background color under the prefs; I was more referring to restoring the original color scheme for the user & path, and coloring for various file types / dirs when you do ls
jjaythomas

Re: restore terminal LMDE/XFCE

Post by jjaythomas »

Oh :oops:

thought might help. In that file aren't they referenced in the hex number for the color? I'm sure their a reference table on web some where, or try (if have LiveCD of LMDE) to get specific hex codes needed.

P.S. I'm on UP4 and still have that file. I'd be happy to copy the file, or the values you need (I'm not a programer so tell me what/where to look) :)

[img]file:///home/manage/Desktop/Screenshot%20-%2004102012%20-%2012:54:03%20AM.png
[/img] Tried screen shot of terminal (not sure if I did right) :roll:


J.Jay
tamerlane

Re: restore terminal LMDE/XFCE

Post by tamerlane »

This is the line in question -- it has been changed on suggestion from another user but the scheme isn't right. It was somewhat useful to experiment with the color settings, but I can't recall the exact scheme used by default. Attached is the result of the following modification:

# set a fancy prompt (non-color, overwrite the one in /etc/profile)
PS1='\[\e[0;32m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[1;32m\]\$\[\e[m\] \[\e[1;37m\]'

Image

[edit] Oh, and to display a screenshot, upload it to an image host, such as Imageshack :)
jasondevj

Re: restore terminal LMDE/XFCE

Post by jasondevj »

Hi

I had the same problem. you can use the following snippet to restore the the color scheam add the following to /etc/bash.bashrc

Code: Select all

use_color=true

# Set colorful PS1 only on colorful terminals.
# dircolors --print-database uses its own built-in database
# instead of using /etc/DIR_COLORS.  Try to use the external file
# first to take advantage of user additions.  Use internal bash
# globbing instead of external grep binary.
safe_term=${TERM//[^[:alnum:]]/?}   # sanitize TERM
match_lhs=""
[[ -f ~/.dir_colors   ]] && match_lhs="${match_lhs}$(<~/.dir_colors)"
[[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(</etc/DIR_COLORS)"
[[ -z ${match_lhs}    ]] \
        && type -P dircolors >/dev/null \
        && match_lhs=$(dircolors --print-database)
[[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true

if ${use_color} ; then
        # Enable colors for ls, etc.  Prefer ~/.dir_colors #64489
        if type -P dircolors >/dev/null ; then
                if [[ -f ~/.dir_colors ]] ; then
                        eval $(dircolors -b ~/.dir_colors)
                elif [[ -f /etc/DIR_COLORS ]] ; then
                        eval $(dircolors -b /etc/DIR_COLORS)
                fi
        fi

        if [[ ${EUID} == 0 ]] ; then
                PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
        else
                PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
        fi

        alias ls='ls --color=auto'
        alias grep='grep --colour=auto'
else
        if [[ ${EUID} == 0 ]] ; then
                # show root@ when we don't have colors
                PS1='\u@\h \W \$ '
        else
                PS1='\u@\h \w \$ '
        fi
fi

tamerlane

Re: restore terminal LMDE/XFCE

Post by tamerlane »

Smashing .. terminal is back to normal. Thank you both for your input :)
rhodry
Level 4
Level 4
Posts: 343
Joined: Mon Jun 04, 2007 7:32 am

Re: restore terminal LMDE/XFCE

Post by rhodry »

I had the same problem. you can use the following snippet to restore the the color scheam add the following to /etc/bash.bashrc
Just a suggestion if I may.

When you want to make these sorts of changes, that are by & large quite personal to each user's own preferences, consider copying /etc/bash.bashrc to ~/.bashrc and making your changes to your local user copy. If there is no local version, just create one. Making changes to "global" config files can have unexpected consequences. In this case, Linux always looks in /etc/bash.bashrc THEN in ~/.bashrc to set these variables; so local version wins!

Just a thought.
rhodry.
Life isn't about waiting for the storm to pass...
it's about learning to dance in the rain.
tamerlane

Re: restore terminal LMDE/XFCE

Post by tamerlane »

I'm just happy that my terminal is back to its pre-pack 4 update, but I've noted your advice for future issues. A little knowledge goes a long way, especially when there's a large empty space up top to fill :)
User avatar
dritzominous
Level 3
Level 3
Posts: 161
Joined: Sat Nov 14, 2009 12:49 am

Re: restore terminal LMDE/XFCE

Post by dritzominous »

Yeah, I figured someone would have this problem.

UP4 does ask you if you want to allow it to overwrite the .bashrc files. You just have to make sure that you say "NO".

Such a pain... But, hopefully not too many people didn't see that in the update.
Inkit

Re: restore terminal LMDE/XFCE

Post by Inkit »

you can use the following snippet to restore the the color scheam add the following to /etc/bash.bashrc
Thanks Jason.
Monsta
Level 10
Level 10
Posts: 3071
Joined: Fri Aug 19, 2011 3:46 am

Re: restore terminal LMDE/XFCE

Post by Monsta »

dritzominous wrote:UP4 does ask you if you want to allow it to overwrite the .bashrc files. You just have to make sure that you say "NO".
Well, I was stupid enough to answer "yes". :) Should've read the diff file more thoroughly, I just skimmed through it. Luckily, the old config file is always saved as *.dpkg-old in such cases, so I've just reverted these changes and got my terminal with blackjack and - err, I mean, colors and completion - back.

Now I wonder if I should remove /etc/skel/.bashrc. It came with the same bash update.
A little googling made me think that I should remove it, because it's only needed when you create a new user. If I understand correctly, it'll be copied to that user's home directory - and that's what we don't need in LMDE, just look at the empty .bashrc in pre-UP4 installations. :)

P.s. Neither modified /etc/bash.bashrc nor /etc/skel/.bashrc are in the clean installation from the latest RC ISO. I've made one in my VirtualBox just to find out the differences, and, well, I found them. :D
Joking aside, this may be considered a regression, though not a big one.
User avatar
xenopeek
Level 25
Level 25
Posts: 29510
Joined: Wed Jul 06, 2011 3:58 am

Re: restore terminal UP4/XFCE

Post by xenopeek »

Moved here by moderator
Image
on4aa

Re: restore terminal LMDE/XFCE

Post by on4aa »

jjaythomas wrote: P.S. I'm a GUI 'cut & paste' kinda guy :P

J.Jay
@jjaythomas: Here is an "appliance user friendly" way of restoring the color scheme in bash:

Code: Select all

sudo apt-get install meld
cd /etc
gksu meld
When meld opens, set as original file /etc/bash.bashrc.dpkg-old and as the new file /etc/bash.bashrc
Restore the use_color block by clicking the left arrow (that points to the right) in meld as indicated in below screenshot.
Locked

Return to “LMDE Archive”