From 8b2f9b68151c95f5be4e4fc61e38580494e6cb57 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 10 Dec 2025 09:32:14 +0100 Subject: [PATCH] zsh: Add transient prompt As an experimental change (and following my adding a transient prompt for nushell which I like), this change adds a transient prompt plugin for zsh. It then defines the 'tansient prompt' prompt to use starship so functionally nothing should change about the prompt (or the rprompt), except for being transient, showing only a character for previous prompts. From: https://github.com/starship/starship/issues/888#issuecomment-3597694479 --- terminal/.config/zsh/zshrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/terminal/.config/zsh/zshrc b/terminal/.config/zsh/zshrc index 9c4e4d2..cbd33b5 100644 --- a/terminal/.config/zsh/zshrc +++ b/terminal/.config/zsh/zshrc @@ -29,6 +29,7 @@ if command -v zr >/dev/null 2>&1; then zdharma-continuum/fast-syntax-highlighting \ zsh-users/zsh-autosuggestions \ zsh-users/zsh-completions \ + olets/zsh-transient-prompt \ ) else # or manually @@ -43,6 +44,7 @@ else # or manually [ -e $PLUG_FOLDER/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ] && source $PLUG_FOLDER/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh [ -e $PLUG_FOLDER/alias-tips/alias-tips.plugin.zsh ] && source $PLUG_FOLDER/alias-tips/alias-tips.plugin.zsh [ -e $PLUG_FOLDER/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh ] && source $PLUG_FOLDER/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh + [ -e $PLUG_FOLDER/zsh-transient-prompt/transient-prompt.plugin.zsh ] && source $PLUG_FOLDER/zsh-transient-prompt/transient-prompt.plugin.zsh fi unset PLUG_FOLDER @@ -133,6 +135,9 @@ ENABLE_CORRECTION="true" setopt autocd eval "$(starship init zsh)" +TRANSIENT_PROMPT_PROMPT='$(starship prompt --terminal-width="$COLUMNS" --keymap="${KEYMAP:-}" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="${STARSHIP_DURATION:-}" --jobs="$STARSHIP_JOBS_COUNT")' +TRANSIENT_PROMPT_RPROMPT='$(starship prompt --right --terminal-width="$COLUMNS" --keymap="${KEYMAP:-}" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="${STARSHIP_DURATION:-}" --jobs="$STARSHIP_JOBS_COUNT")' +TRANSIENT_PROMPT_TRANSIENT_PROMPT='$(starship module character)' eval "$(zoxide init zsh)" eval "$(atuin init zsh)" export CARAPACE_BRIDGES='zsh,fish,bash,inshellisense' # optional