From 28f49f3622c1526878365d79e468b1e766205748 Mon Sep 17 00:00:00 2001 From: etrobert-bot Date: Sun, 5 Jul 2026 01:20:31 +0200 Subject: [PATCH 1/2] feat(tmux-sessionizer): preview project tree in the directory picker In the project picker, show an `eza --tree` preview of the highlighted directory (falling back to `ls`), resolving the name to its path with the same case logic the script already uses. The preview-window is responsive (stacks on top when the popup is narrow) so nothing overflows. Adds eza to runtimeInputs. Co-Authored-By: Claude Opus 4.8 --- pkgs/tmux-sessionizer/default.nix | 2 ++ pkgs/tmux-sessionizer/tmux-sessionizer.sh | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/tmux-sessionizer/default.nix b/pkgs/tmux-sessionizer/default.nix index d7c13486..8393f62f 100644 --- a/pkgs/tmux-sessionizer/default.nix +++ b/pkgs/tmux-sessionizer/default.nix @@ -4,6 +4,7 @@ symlinkJoin, coreutils, gnused, + eza, fzf, findutils, }: @@ -14,6 +15,7 @@ let coreutils gnused self'.packages.tmux-wrapped + eza fzf findutils ]; diff --git a/pkgs/tmux-sessionizer/tmux-sessionizer.sh b/pkgs/tmux-sessionizer/tmux-sessionizer.sh index d6351677..b6721b2d 100755 --- a/pkgs/tmux-sessionizer/tmux-sessionizer.sh +++ b/pkgs/tmux-sessionizer/tmux-sessionizer.sh @@ -30,11 +30,19 @@ if [ $# -eq 1 ]; then ;; esac else + # shellcheck disable=SC2016 project=$({ find "$HOME/work" -mindepth 1 -maxdepth 1 -type d -exec basename {} \; echo "setup" echo "doc" - } | fzf) + } | fzf \ + --preview 'case {} in + setup) dir=$HOME/setup ;; + doc) dir=$HOME/sync/doc ;; + *) dir=$HOME/work/{} ;; + esac + eza --tree --level=2 --color=always "$dir" 2>/dev/null || ls "$dir"' \ + --preview-window 'right,60%,<45(up,55%)') fi if [ -z "$project" ]; then From 913b83cd4d1490dedd48bac45c41bb26b9f1f794 Mon Sep 17 00:00:00 2001 From: etrobert-bot Date: Sun, 5 Jul 2026 01:49:15 +0200 Subject: [PATCH 2/2] refactor(tmux-sessionizer): drop responsive preview-window Panes are never narrower than 80 columns, where the 80%-popup is wide enough for a side-by-side preview. Use a plain 'right:60%' and drop the responsive stacked-layout alternative. Co-Authored-By: Claude Opus 4.8 --- pkgs/tmux-sessionizer/tmux-sessionizer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tmux-sessionizer/tmux-sessionizer.sh b/pkgs/tmux-sessionizer/tmux-sessionizer.sh index b6721b2d..689dd8f6 100755 --- a/pkgs/tmux-sessionizer/tmux-sessionizer.sh +++ b/pkgs/tmux-sessionizer/tmux-sessionizer.sh @@ -42,7 +42,7 @@ else *) dir=$HOME/work/{} ;; esac eza --tree --level=2 --color=always "$dir" 2>/dev/null || ls "$dir"' \ - --preview-window 'right,60%,<45(up,55%)') + --preview-window 'right:60%') fi if [ -z "$project" ]; then