By Kevin Hou
2 minute read
Personalizing your Terminal environment can improve aesthetics and boost developer productivity. From setting a concise custom prompt manually in bash files, to using full frameworks such as Zsh, making your command line unique is one of the best ways to feel at home inside the development environment.
One common configuration change is adjusting the Terminal prompt text. Typically, a default prompt might look like:
1Computer-Name: User-Name ~ 2
If you find this layout long or distracting, you can remove specific variables. Here are the configuration steps for a traditional Bash environment:
.bash_profile. This is a hidden file, which you can find by executing $ ls -a. If it does not exist yet, step 3 will both initialize and create it.$ nano .bash_profileexport PS1="\h: \w "Control + O, Return, Control + X.Your output should resemble:
1Computer-Name: ~ 2
To obtain the cleanest aesthetic showing only the current directory:
export PS1="\W "
Which will display simply as:
1~ 2
For comprehensive lists of prompt settings, refer to this reference guide. You can review supplementary configurations for modifying terminal colors.
oh-my-zshFor advanced configurations, frameworks like oh-my-zsh offer higher-level productivity features. It features direct status indicator badges for Git directories, autocomplete modules, file format highlights, and expanded plugin capabilities.
It works great when installed alongside alternative clients, such as iTerm 2 for macOS users.
Install scripts can be launched via either protocol option below:
1sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
2
1sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
2
Theme profiles and color templates are available for inspection on the iTerm2 Color Schemes repository. Relevant settings files reside within the ./schemes/ subdirectory. You can evaluate previews of the preset collection here.