Skip to content

Instantly share code, notes, and snippets.

@nicnilov
Last active March 27, 2023 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicnilov/206d4820ab80e344139ffa4f66fafc2b to your computer and use it in GitHub Desktop.
Save nicnilov/206d4820ab80e344139ffa4f66fafc2b to your computer and use it in GitHub Desktop.
Zsh docker machine instance in the prompt

In zsh theme file:

# Dm: docker machine
prompt_dm() {
  local dm="$DOCKER_MACHINE_NAME"
  if [[ -n $dm ]]; then
    prompt_segment 020 159 $dm
  fi
}

## Main prompt
build_prompt() {
  # ...
  prompt_dir
  prompt_dm
  prompt_git
  # ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment