restore terminal UP4/XFCE

Post your update and upgrade related errors here
Forum rules
Before you post please read how to get help

restore terminal UP4/XFCE

Postby tamerlane on Tue Apr 10, 2012 12:39 am

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
tamerlane
Level 1
Level 1
 
Posts: 5
Joined: Tue Apr 10, 2012 12:34 am

Linux Mint is funded by ads and donations.
 

Re: restore terminal LMDE/XFCE

Postby jjaythomas on Tue Apr 10, 2012 12:48 am

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
Level 5
Level 5
 
Posts: 597
Joined: Sun Mar 07, 2010 12:52 pm

Re: restore terminal LMDE/XFCE

Postby jjaythomas on Tue Apr 10, 2012 12:54 am

Sorry didn't see using XFCE terminal

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

J.Jay
jjaythomas
Level 5
Level 5
 
Posts: 597
Joined: Sun Mar 07, 2010 12:52 pm

Re: restore terminal LMDE/XFCE

Postby tamerlane on Tue Apr 10, 2012 1:16 am

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
tamerlane
Level 1
Level 1
 
Posts: 5
Joined: Tue Apr 10, 2012 12:34 am

Re: restore terminal LMDE/XFCE

Postby jjaythomas on Tue Apr 10, 2012 1:38 am

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
jjaythomas
Level 5
Level 5
 
Posts: 597
Joined: Sun Mar 07, 2010 12:52 pm

Re: restore terminal LMDE/XFCE

Postby tamerlane on Tue Apr 10, 2012 3:26 am

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 :)
tamerlane
Level 1
Level 1
 
Posts: 5
Joined: Tue Apr 10, 2012 12:34 am

Re: restore terminal LMDE/XFCE

Postby jasondevj on Wed Apr 11, 2012 3:20 am

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

jasondevj
Level 1
Level 1
 
Posts: 1
Joined: Wed Apr 11, 2012 2:58 am

Re: restore terminal LMDE/XFCE

Postby tamerlane on Wed Apr 11, 2012 11:07 am

Smashing .. terminal is back to normal. Thank you both for your input :)
tamerlane
Level 1
Level 1
 
Posts: 5
Joined: Tue Apr 10, 2012 12:34 am

Re: restore terminal LMDE/XFCE

Postby rhodry on Thu Apr 12, 2012 3:17 am

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.
rhodry
Level 4
Level 4
 
Posts: 347
Joined: Mon Jun 04, 2007 7:32 am

Re: restore terminal LMDE/XFCE

Postby tamerlane on Thu Apr 12, 2012 11:35 pm

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 :)
tamerlane
Level 1
Level 1
 
Posts: 5
Joined: Tue Apr 10, 2012 12:34 am

Re: restore terminal LMDE/XFCE

Postby dritzominous on Thu Apr 19, 2012 5:23 pm

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.
User avatar
dritzominous
Level 3
Level 3
 
Posts: 160
Joined: Sat Nov 14, 2009 12:49 am

Re: restore terminal LMDE/XFCE

Postby Inkit on Thu Apr 19, 2012 11:04 pm

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


Thanks Jason.
Inkit
Level 5
Level 5
 
Posts: 681
Joined: Fri Jun 25, 2010 4:44 am

Re: restore terminal LMDE/XFCE

Postby Monsta on Fri Apr 20, 2012 6:40 am

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.
Monsta
Level 9
Level 9
 
Posts: 2513
Joined: Fri Aug 19, 2011 3:46 am

Re: restore terminal UP4/XFCE

Postby xenopeek on Fri Apr 20, 2012 6:47 am

Moved here by moderator
User avatar
xenopeek
Level 21
Level 21
 
Posts: 15280
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: restore terminal LMDE/XFCE

Postby on4aa on Thu Oct 04, 2012 8:50 am

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.
Attachments
bash.bashrc.meld.png
bash.bashrc.meld.png (247.27 KiB) Viewed 2032 times
User avatar
on4aa
Level 2
Level 2
 
Posts: 57
Joined: Wed Nov 18, 2009 5:30 am
Location: Hasselt, Belgium

Linux Mint is funded by ads and donations.
 

Return to Update/Upgrade Issues

Who is online

Users browsing this forum: No registered users and 3 guests