Files
fish-config/functions/fish_right_prompt.fish
T
rootiest c17f6663db feat(deps): add Optional/Terminal Emulator tiers, fix docker prompt hang and ov install path
Reworks fish-deps' dependency classification from three tiers to five:
Required, Recommended, Optional, Terminal Emulators, and Integrations.

- Add an Optional tier for single-purpose wrapper conveniences that only
  matter if you already use that specific tool (btop, dust, duf,
  prettyping, go, lazygit, lazydocker, docker, yt-dlp, screen). Skipped by
  `fish-deps install`/`sync` by default.
- Split kitty/wezterm into their own Terminal Emulators tier, since only
  the one matching $TERM is ever relevant to a given user.
- Add --optional, --terminals, and --all flags to `install`/`sync` to
  opt back into the skipped tiers, with a summary of how many were
  skipped and which flag restores them.
- Fix `_fish_deps_status` marking missing Integrations as critical (red)
  the same as Required — only Required is red now; Recommended stays
  yellow, everything else renders as a neutral dim note.

Also fixes two bugs surfaced during dependency testing on a fresh
install:

- `fish_right_prompt` called `docker context show` on every prompt with
  no `type -q docker` guard, unlike every other optional integration in
  this config — on a system without docker this printed a visible
  "Unknown command: docker" block on every single prompt render. Added
  the missing guard, and hardened the `ld` wrapper with explicit
  docker/lazydocker presence checks.
- `ov`'s catalog entry offered `cargo install ov` as its preferred
  install method, but crates.io's `ov` is an unrelated crate, not the
  noborus/ov pager — cargo would silently install the wrong package.
  Removed the cargo path; `ov` now prefers `go install
  github.com/noborus/ov@latest` (ahead of the system PM) when go is
  available, since not all distros package `ov` in their base repos,
  and falls back to the system PM otherwise.
2026-08-14 16:42:37 -04:00

48 lines
1.4 KiB
Fish

# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# CATEGORY
# 08-terminal-management
#
# SYNOPSIS
# fish_right_prompt
#
# DESCRIPTION
# 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 docker
# and starship are both installed and C3 overrides are enabled, also shows
# the active Docker context (if non-default).
#
# EXIT STATUS
# 0 Always
#
# EXAMPLE
# # Rendered automatically by fish; not called directly.
function fish_right_prompt
set -l last_status $status
# Failed command: red ✘ + exit code; hidden when 0
if test $last_status -ne 0
set_color '#f38ba8'
echo -n "✘ $last_status "
set_color normal
end
# Docker context — only relevant alongside the starship prompt, and only
# when docker is actually installed (guarded like every other optional
# integration in this config).
if type -q docker; and 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 "+%a %b %d %H:%M:%S %Y"
set_color normal
end