fix: restore docker context behind starship+C3 guard, use long date format in right prompt
This commit is contained in:
@@ -5,10 +5,11 @@
|
||||
# fish_right_prompt
|
||||
#
|
||||
# DESCRIPTION
|
||||
# Renders the right-side prompt. Shows a red ✘ with the exit code when the
|
||||
# last command failed (hidden on success), followed by the current time in
|
||||
# Catppuccin Overlay0 (dim). Rendered regardless of C3 state so it pairs
|
||||
# correctly with both the starship and the Catppuccin fallback left prompt.
|
||||
# Renders the right-side prompt. Always shows a dim timestamp. When the last
|
||||
# command failed, prefixes it with a red ✘ and the exit code. When starship
|
||||
# is installed and C3 overrides are enabled, also shows the active Docker
|
||||
# context (if non-default) — that block is paired with the starship prompt
|
||||
# which already guards on both conditions.
|
||||
#
|
||||
# RETURNS
|
||||
# 0 Always
|
||||
@@ -25,8 +26,18 @@ function fish_right_prompt
|
||||
set_color normal
|
||||
end
|
||||
|
||||
# Docker context — only relevant alongside the starship prompt
|
||||
if type -q starship; and __fish_config_op_enabled __fish_config_op_overrides
|
||||
set -l docker_ctx (docker context show 2>/dev/null)
|
||||
if test -n "$docker_ctx"; and test "$docker_ctx" != default
|
||||
set_color blue
|
||||
echo -n " $docker_ctx "
|
||||
set_color normal
|
||||
end
|
||||
end
|
||||
|
||||
# Timestamp — Catppuccin Overlay0 (dim)
|
||||
set_color '#6c7086'
|
||||
date +%X
|
||||
date "+%a %b %d %H:%M:%S %Y"
|
||||
set_color normal
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user