Skip to content

Instantly share code, notes, and snippets.

@kennyng
Created August 15, 2019 19:12
Show Gist options
  • Save kennyng/54c87e575e4b71832ed9cc248c47fb6f to your computer and use it in GitHub Desktop.
Save kennyng/54c87e575e4b71832ed9cc248c47fb6f to your computer and use it in GitHub Desktop.
Add tmux info to shell prompt
# .tmux.conf: Disable status bar
set -g status off
# .bashrc: Update prompt info and styling
PS1='\[\033[33m\]$(prompt tmux)\[\033[00m\]'"$format"' \[\033[35m\]$(prompt git)\[\033[00m\]\[\033[31m\]$(prompt job)\[\033[00m\]\n\$ '
tmux)
# Check for tmux.
if ! hash tmux 2>/dev/null ; then
return 1
fi
if [[ "$TERM" == screen* ]] && [ -n "$TMUX" ]; then
printf '[tmux]'
fi
;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment