Skip to content

Releases: Amdhj22/tmux-shorten-path

v0.2.0 — bash & fish workers

Choose a tag to compare

@Amdhj22 Amdhj22 released this 29 May 10:43
f331e0a

Multi-shell support: the worker no longer hard-depends on zsh.

Added

  • bash worker (scripts/shorten_path.bash, bash 3.2+) and fish worker (scripts/shorten_path.fish, fish 3.1+), alongside the existing zsh worker. All three produce byte-for-byte identical output.
  • Shell auto-detection at config-load time: tries bash → zsh → fish and uses the first available. New @shorten_path_shell option (bash|zsh|fish) forces a specific one. If none is available, the plugin disables itself gracefully.

Changed

  • Renamed scripts/shorten_path.shscripts/shorten_path.zsh (content unchanged).
  • Requirements are now one of: bash 3.2+, zsh, or fish 3.1+ — independent of your login shell.

Hardened

  • Shell-injection-safe quoting of option values baked into the #(...) command (notably @shorten_path_markers).
  • Worker path quoting (spaces in install path), worker-file existence/exec check in detection, empty/unset HOME guard.

Upgrade note: reload your tmux config after updating so the new worker path is picked up.

v0.1.0 — first release

Choose a tag to compare

@Amdhj22 Amdhj22 released this 13 May 09:26

First public release of tmux-shorten-path — a TPM plugin that exposes a #{shorten_path} placeholder for folder-aware path shortening in tmux status bars.

Highlights

  • #{shorten_path} placeholder — drop it into status-left, status-right, window-status-format, window-status-current-format, or pane-border-format and the plugin rewrites it to the current pane's shortened path on each status refresh.
  • Four shortening strategies (@shorten_path_strategy):
    • truncate_to_unique (default) — folder-marker anchor + shortest unique prefix among siblings (p10k-style)
    • truncate_from_right — first N chars per non-last segment
    • truncate_to_last — basename only
    • none$HOME collapse only
  • Configurable — segment threshold, segment length, marker file list, all via standard @shorten_path_* tmux options.
  • Reproducible demodemo/setup.sh + demo/demo.tape lets anyone regenerate the README gif with vhs.

Install

set -g @plugin 'Amdhj22/tmux-shorten-path'

Then prefix + I to install.

Compatibility

  • tmux 3.0+
  • macOS, Linux
  • zsh (for the script — does not require zsh as your shell)

See the README for full options table, algorithm notes, and examples.