I installed iTerm 2 but my shell windows show:
"computer name":"current directory" "user" $
This is far too long. I'd like to just see:
"current directory" $
Is there an option for this? I couldn't find it in the preferences.
itermiterm2terminalterminal.app
I installed iTerm 2 but my shell windows show:
"computer name":"current directory" "user" $
This is far too long. I'd like to just see:
"current directory" $
Is there an option for this? I couldn't find it in the preferences.
Best Answer
It's behavior of your shell, not your terminal. If you're using bash, edit
~/.bash_profile
and add the following line:This will display the current working directory, or
~
in case of$HOME
, and either$
or#
, depending on whether you'reroot
. Examples:Search
man bash
forPS1
to find out about the possible placeholders. You can execute shell scripts as part of your prompt, e.g.:This will behave similar to the one above, but always print the full path.