0
Last login: Fri Nov 24 10:45:52 on ttys001
-bash: /Users/raquellorenzana/git-completion.bash: No such file or directory
-bash: /Users/raquellorenzana/git-prompt.sh: No such file or directory
-bash: __git_ps1: command not found
raquellorenzana ~ $ 
-bash: __git_ps1: command not found
raquellorenzana ~ $ 
-bash: __git_ps1: command not found
raquellorenzana ~ $ 

I have 3 failed commands appearing before/above my initial prompt on opening a new terminal screen. After typing new commands, just one of the old failed commands appears above my prompt every time. I manage to clear my terminal to just show my prompt by hitting edit > clear screen, however it's not a permanent fix. Any suggestions?

pa4080
  • 29,831

1 Answers1

1

Probably you've messed up your ~/.bashrc file. The way to solve this problem is to edit this file and find which commands inside generates these messages.

The directory /etc/skel contains copies of the files that will be copied into the user's home directory when you create a new user. So you could compare your .bashrc file with the default one in this way:

diff /etc/skel/.bashrc ~/.bashrc

You could copy /etc/skel/.bashrc in your home directory, but, just in case, first create a backup of the existing file:

cp ~/.bashrc{,_old}
cp /etc/skel/.bashrc ~/

Then you could compare the two files and command by command make the necessary changes in the new file.

diff ~/.bashrc ~/.bashrc_old

I would suggest you to un-comment the following in the new ~/.bashrc: force_color_prompt=yes


To apply the new file within the current session (without start a new terminal) you should source it by one of the following commands: . ~/.bashrc or source ~/.bashrc.


Additionally you could get coloured output of diff by the wrapper colordiff. First install it:

sudo apt install colordiff

Then use it in this way (source):

diff <old file> <new file> | colordiff

Or just use:

colordiff <old file> <new file>
pa4080
  • 29,831