Releases: Amdhj22/tmux-shorten-path
Releases · Amdhj22/tmux-shorten-path
Release list
v0.2.0 — bash & fish workers
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 → fishand uses the first available. New@shorten_path_shelloption (bash|zsh|fish) forces a specific one. If none is available, the plugin disables itself gracefully.
Changed
- Renamed
scripts/shorten_path.sh→scripts/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
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 intostatus-left,status-right,window-status-format,window-status-current-format, orpane-border-formatand 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 segmenttruncate_to_last— basename onlynone—$HOMEcollapse only
- Configurable — segment threshold, segment length, marker file list, all via standard
@shorten_path_*tmux options. - Reproducible demo —
demo/setup.sh+demo/demo.tapelets 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.