Setup your Mac terminal for screencasting
If you will be showing your command line, we suggest using a minimal prompt to reduce distractions. This example prompt works well for screencasting:
You can use this one by updating your ~/.bashrc
or ~/.zshrc
with the following:
export PS1="\n\[\e[32m\]\W\n\[\e[m\]\[\e[34m\]\\$\[\e[m\]"
Note: If you’re on Mac and using Bash, you also need to add a ~/.bash_profile
with this:
source $HOME/.bashrc
This tells Mac to load your ~/.bashrc
when loading a terminal emulator.
Customize the Command Prompt in VS Code
Use custom ENV
variables if you prefer to only customize the PS1 Bash/Zsh command prompt in the VS Code terminal without affecting your other custom terminal themes in other applications, such as iTerm2.
In VS Code, add a new property, terminal.integrated.env.osx
, and a new variable that will run a value.
{
"terminal.integrated.env.osx": {
"VSC": "yes lol!"
}
}
Open zsh resource file, ~/.zshrc
and add a simple check at the end of the file to handle the case when the terminal is open in VS Code. Save and reload everything.
if [ "$VSC" = "yes lol!"], then
PS1='\$ '
fi
This works in Bash with ~/.bashrc
as well.
Now, the command prompt is now a $
sign in VS Code's terminal while keeping other custom terminal themes intact.