HOWTO: We improve the appearance of the Terminal in Mac OSX | Flavio's blog
 

HOWTO: We improve the appearance of the Terminal in Mac OSX

in OSX | | 1 Comment » | Last modified:

I geek terminal, or who is accustomed to using Linux, have familiarity with the topic, but personally, up to a year ago, I didn't know where the bashrc file was in Mac OSX, and what kind of improvements could make.

In default, opening the terminal shows the last login time, and the command prompt, everything is made from a single color.

The idea is to facilitate reading and immediately locate the folder in which you are located, using a form of the type: user@host:directory with different colors, so as not to be confused.

We also want to add a calendar to login (that at least personally, I was very comfortable).

Taking advantage of a little guidance provision IBM and doing some experiments, and bearing in mind that the file to edit is located at / private / etc / bashrc, we're going to replace everything that is written on the inside with:

    # System-wide .bashrc file for interactive bash(1) shells.
    if [ -The "$PS1" ]; then
    return
    fi
    # Make bash check its window size after a process completes
    shopt -s checkwinsize
    case $TERM in
    xterm* | aterm | rxvt | screen )
    PROMPT_COMMAND='echo -ne "\033]0;${PWD/$HOME/~}\007"'
    ;;
    * )
    ;;
    esac
    PS1='\[\and[33m\]\u\[\and[36m\]@\[\and[36m\]\h\[\and[32m\]:\W\[\and[0m\]> '
    # calendario al login
    cal | but "s/.*/ & /;s/ $(date  %e) / [] /"
This will allow you to change both the way and the colors that shows the prompt, is to show the calendar, an [] that identifies the current day.
We can edit the file with the classic editor nano, but using sudo, to have admin permissions as bashrc is in a system folder.
Those of you who already made and want to share some new changes to the file bashrc?
 

1 Comment »

Please accept third-party cookies to be able to comment on the post! The CHANGE COOKIE CHOICES button is located in the footer of the site. / In order to comment this post, please accept the third party cookies! The button CAMBIA LE SCELTE DEI COOKIE is in the footer of the website.