Getting the old Terminal back after uninstalling fish

bashcommand lineterminal

Recently I got tired of the smaller kinks that the Fish Shell presented me with (undiscoverable commands etc.) so I decided I wanted to change the shell back to normal and uninstall fish.

However in the process of doing so I have done something terribly wrong.

I have set it to the normal: /bin/bash

However Im represented with a series of prompts (in regards to Vagrant) and have to exit this with the CTRL+C command (cancel)

I want to get my old terminal back (with my current folder prepended etc.) but I have no clue in how to accomplish this.

I've attached two screenshots. One is the current terminal (the one with the bash -bash-3.2$in front.
The second is the terminal i want (the default with username appended) [source of image is found on the internet, for reference]

This is the terminal I have
The Terminal I have

This is the terminal I want
The Terminal I want

I've found two things:

  1. My bash profile is deleted hence i cannot see my computer name etc. I've tried to recreate it but:
  2. I need a sample .bash_profile
  3. …and i need it to be persistent such that when i exit my terminal I do not fire the VVV script (that it apparently fires off when it first enters the terminal)

Best Answer

First, rm ~/.bashrc ~/.bash_profile ~/.profile These are not needed and don't exist by default.

Second, check to see /etc/profile is there, should be:

# System-wide .profile for sh(1)
if [ -x /usr/libexec/path_helper ]; then
    eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
    [ -r /etc/bashrc ] && . /etc/bashrc
fi

Third, check /etc/bashrc (this is where your prompt is defined). Should be:

# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
   return
fi
PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize
# Tell the terminal about the working directory at each prompt.
if [ "$TERM_PROGRAM" == "Apple_Terminal" ] && [ -z "$INSIDE_EMACS" ]; then
    update_terminal_cwd() {
        # Identify the directory using a "file:" scheme URL,
        # including the host name to disambiguate local vs.
        # remote connections. Percent-escape spaces.
    local SEARCH=' '
    local REPLACE='%20'
    local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
    printf '\e]7;%s\a' "$PWD_URL"
    }
    PROMPT_COMMAND="update_terminal_cwd; $PROMPT_COMMAND"
fi

Finally, if it's still not working make sure you have /bin/bash set as your default shell using the advanced options in the User & Groups System Preference. If you don't login with bash, it will bypass the configs in /etc/

Related Question