Terminal prompt is not changing. [SOLVED]

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
ForestH11
Level 1
Level 1
Posts: 11
Joined: Mon Oct 17, 2016 11:07 pm

Terminal prompt is not changing. [SOLVED]

Post by ForestH11 » Thu Jan 19, 2017 9:12 pm

I'm trying to have a shorter prompt in my terminal, and when I go to the bash.bashrc and change this line

Code: Select all

PS1='${debian_chroot:+($debian_chroot)}\u \w \$ '
nothing happens. Do I need to look somewhere else to change it?
Last edited by ForestH11 on Tue Jan 24, 2017 7:56 pm, edited 1 time in total.
-ForestH11

User avatar
MintBean
Level 9
Level 9
Posts: 2967
Joined: Fri Aug 07, 2015 6:54 am
Location: Blighty

Re: Terminal prompt is not changing.

Post by MintBean » Thu Jan 19, 2017 9:57 pm

There are a couple of similar lines, make sure you're changing the one for the colourised terminal.

User avatar
WharfRat
Level 21
Level 21
Posts: 13142
Joined: Thu Apr 07, 2011 8:15 pm

Re: Terminal prompt is not changing.

Post by WharfRat » Thu Jan 19, 2017 11:44 pm

ForestH11,


You should place that line in ~/.bashrc at the very end then source ~/.bashrc or exit the terminal an restart it for the change to take effect.
ImageImage

Mute Ant
Level 14
Level 14
Posts: 5135
Joined: Tue Sep 03, 2013 7:45 pm
Location: Norfolk UK

Re: Terminal prompt is not changing.

Post by Mute Ant » Fri Jan 20, 2017 2:15 am

The Desktop Environment appears to make local copies of some system files. I can add myself to the disk group in a GUI console but it doesn't actually work until I log out and back in. If I make the same change in a Ctrl+Alt+F1 TTY console, it takes effect straight away.
While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named "manual".

ForestH11
Level 1
Level 1
Posts: 11
Joined: Mon Oct 17, 2016 11:07 pm

Re: Terminal prompt is not changing.

Post by ForestH11 » Mon Jan 23, 2017 9:12 pm

MintBean wrote:There are a couple of similar lines, make sure you're changing the one for the colourised terminal.
I'm only seeing the one line, this is what my bash.bashrc file looks like.

Code: Select all

# System-wide .bashrc file for interactive bash(1) shells.

# To enable the settings / commands in this file for login shells as well,
# this file has to be sourced in /etc/profile.

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

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

# 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, overwrite the one in /etc/profile)
# PS1='${debian_chroot:+($debian_chroot)}\u@\h \w \$ '
PS1='${debian_chroot:+($debian_chroot)}\u \w \$ '


# Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
# If this is an xterm set the title to user@host:dir
#case "$TERM" in
#xterm*|rxvt*)
#    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
#    ;;
#*)
#    ;;
#esac

# enable bash completion in interactive shells
#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

# if the command-not-found package is installed, use it
if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then
	function command_not_found_handle {
	        # check because c-n-f could've been removed in the meantime
                if [ -x /usr/lib/command-not-found ]; then
		   /usr/lib/command-not-found -- "$1"
                   return $?
                elif [ -x /usr/share/command-not-found/command-not-found ]; then
		   /usr/share/command-not-found/command-not-found -- "$1"
                   return $?
		else
		   printf "%s: command not found\n" "$1" >&2
		   return 127
		fi
	}
fi
I'm still fairly new to linux, so there's a lot I don't understand.
-ForestH11

grumpy_geek
Level 2
Level 2
Posts: 80
Joined: Tue Jan 03, 2017 3:50 am
Contact:

Re: Terminal prompt is not changing.

Post by grumpy_geek » Tue Jan 24, 2017 5:33 am

ForestH11 wrote:my bash.bashrc
... by which you're referring to /etc/bash.bashrc, don't you? I'd rather not tinker with that one - if you goof it up you're in trouble, and its settings are overridden by those of /home/[user]/.bashrc anyway. Edit the latter if you dare - but do yourself a favour and back it up prior to that :wink:

(my "user-level" bashrc)

ForestH11
Level 1
Level 1
Posts: 11
Joined: Mon Oct 17, 2016 11:07 pm

Re: Terminal prompt is not changing. [SOLVED]

Post by ForestH11 » Tue Jan 24, 2017 7:58 pm

Thanks grumpy_geek, I got it to work!
-ForestH11

Post Reply

Return to “Newbie Questions”