From 445050aaa82f2ac164eca6c91ec8be670084cf2f Mon Sep 17 00:00:00 2001 From: Dennis Schoepf Date: Sat, 10 Jan 2026 21:54:09 +0100 Subject: [PATCH] fix fix fix --- modules/fish/default.nix | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/modules/fish/default.nix b/modules/fish/default.nix index 9e279be..6887dbf 100644 --- a/modules/fish/default.nix +++ b/modules/fish/default.nix @@ -69,11 +69,14 @@ end end ''; - sessionizer = /* fish */ '' - set -l selected (dev_projects | fzf \ + fzf_sessionizer = /* fish */ '' + fzf \ --prompt "Create/switch to session: " \ - --header ' Ctrl-d: Kill Session ' \ - --bind 'ctrl-d:execute(tmux kill-session -t {2..})++reload(dev_projects)') + --header " Ctrl-d: Kill Session " \ + --bind "ctrl-d:execute(tmux kill-session -t {2..})++reload(dev_projects)" + ''; + sessionizer = /* fish */ '' + set -l selected (dev_projects | fzf_sessionizer) if test -z "$selected" return 1 @@ -82,7 +85,7 @@ set -l session_name (basename $selected) set -l tmux_runnning (pgrep tmux) - if test -z $TMUX && -z $tmux_running + if test -z $TMUX && test -z $tmux_running tmux new-session -s $session_name -c $selected return 0 end @@ -93,6 +96,9 @@ tmux switch-client -t $session_name ''; + tmux_sessionizer = /* fish */ '' + tmux display-popup -h 50% -w 80% -E sessionizer + ''; nn = /* fish */ '' # Require a title argument if test (count $argv) -lt 1 @@ -232,6 +238,11 @@ # Third party integration not covered by # home manager's enableFishIntegration fnm env --use-on-cd --shell fish | source + + # Auto start tmux + if status --is-interactive; and not set -q TMUX + tmux attach-session -d -t main || tmux new-session -s main + end ''; shellAbbrs = {