<SOLVED> Changing the default terminal text to pre-19 style

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
coolfatdude
Level 1
Level 1
Posts: 4
Joined: Fri Aug 24, 2018 5:46 am

<SOLVED> Changing the default terminal text to pre-19 style

Post by coolfatdude » Fri Aug 24, 2018 6:01 am

I recently performed a fresh install of Linux Mint 19 Cinnamon, and found that the terminal formats its text strangely - there are no spaces between anything and there is no color formatting on the "$" symbol. Here are some screenshots comparing them; I'm using Arc as my theme, but that doesn't seem to have any impact on it:

Linux Mint 19 Cinnamon:
Image

Linux Mint 18.3 Cinnamon:
Image

It's a nitpick for sure, but it would be appreciated if there were a way to get the old style back...
Last edited by coolfatdude on Fri Aug 24, 2018 2:35 pm, edited 1 time in total.

User avatar
catweazel
Level 19
Level 19
Posts: 9486
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Changing the default terminal text to pre-19 style

Post by catweazel » Fri Aug 24, 2018 6:20 am

coolfatdude wrote:
Fri Aug 24, 2018 6:01 am
It's a nitpick for sure, but it would be appreciated if there were a way to get the old style back...
https://www.cyberciti.biz/tips/howto-li ... rompt.html
¡uʍop ǝpısdn sı buıɥʇʎɹǝʌǝ os ɐıןɐɹʇsnɐ ɯoɹɟ ɯ,ı

User avatar
AndyMH
Level 8
Level 8
Posts: 2497
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Changing the default terminal text to pre-19 style

Post by AndyMH » Fri Aug 24, 2018 6:21 am

I think it's the theme, default on 18.3 (or at least what mine's set to) is Mint-X. Default in 19 is different (not on a LM19 machine at the moment so can't say what it is).

I'm 'playing' with 19 on another T430 before I update my main machine and noticed the different appearance, you can go back to the old theme.
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

User avatar
catweazel
Level 19
Level 19
Posts: 9486
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Changing the default terminal text to pre-19 style

Post by catweazel » Fri Aug 24, 2018 6:25 am

AndyMH wrote:
Fri Aug 24, 2018 6:21 am
I think it's the theme
The prompt is set in .bashrc, not by any theme.
¡uʍop ǝpısdn sı buıɥʇʎɹǝʌǝ os ɐıןɐɹʇsnɐ ɯoɹɟ ɯ,ı

User avatar
AndyMH
Level 8
Level 8
Posts: 2497
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Changing the default terminal text to pre-19 style

Post by AndyMH » Fri Aug 24, 2018 7:49 am

You're right, just checked :(
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

User avatar
catweazel
Level 19
Level 19
Posts: 9486
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Changing the default terminal text to pre-19 style

Post by catweazel » Fri Aug 24, 2018 8:01 am

AndyMH wrote:
Fri Aug 24, 2018 7:49 am
You're right, just checked :(
No big deal at all. We all learn from one another.
¡uʍop ǝpısdn sı buıɥʇʎɹǝʌǝ os ɐıןɐɹʇsnɐ ɯoɹɟ ɯ,ı

coolfatdude
Level 1
Level 1
Posts: 4
Joined: Fri Aug 24, 2018 5:46 am

Re: Changing the default terminal text to pre-19 style

Post by coolfatdude » Fri Aug 24, 2018 2:35 pm

Okay, playing around with .bashrc did the trick! Here's what I did, for anyone else interested:

Open up ~/.bashrc and scroll down to the color prompt code. If you're on a fresh Linux Mint 19 installation, the relevant code should stretch from line 59 to line 63. It should look something like this:

Code: Select all

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
Now, what you want to do is replace those lines with THIS block of code, which I just took from a Linux Mint 18.3 installation I had lying around:

Code: Select all

if [ "$color_prompt" = yes ]; then
    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[00m\] \[\033[01;34m\]\w \$\[\033[00m\] '
    fi
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h \w \$ '
fi
Now just save, and open a new terminal window:
Image
Looks good!

I'm not sure why this was ever changed, but I guess it doesn't matter to me anymore :D Big thanks to catweazel for helping me out!

logithack
Level 1
Level 1
Posts: 17
Joined: Wed Jun 22, 2016 11:38 am

Re: <SOLVED> Changing the default terminal text to pre-19 style

Post by logithack » Sat Aug 25, 2018 1:15 pm

coolfatdude's putting it straight. That's exactly what you need to do if you wish to have the old terminal prompt colours back. I was just going to make a post about this showing how to do it. Then I thought I'd better search the forums to see if this had already been solved and I found this thread, which says exactly what I've found out.

What you shouldn't forget, though, is to uncomment the line

Code: Select all

#force_color_prompt=yes
above the block coolfatdude mentioned.

Thanks for posting the solution!

coolfatdude
Level 1
Level 1
Posts: 4
Joined: Fri Aug 24, 2018 5:46 am

Re: <SOLVED> Changing the default terminal text to pre-19 style

Post by coolfatdude » Mon Aug 27, 2018 10:36 pm

logithack wrote:
Sat Aug 25, 2018 1:15 pm
What you shouldn't forget, though, is to uncomment the line

Code: Select all

#force_color_prompt=yes
above the block coolfatdude mentioned.
I'm not sure it's required; the old pre-19 .bashrc also had that line commented out and it always worked fine... I don't even know what it does...

I mean, if it doesn't break anything then it's totally up to you. Glad I could help out regardless!

Post Reply

Return to “Newbie Questions”