diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-03 23:14:01 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-03 23:14:01 +0200 |
| commit | e81c196b685cb2765a96eecd615f7ac53bce6acd (patch) | |
| tree | de27aa4717626d432b14c72dbf0431103bb82fd0 | |
| parent | c74f5ba6ad54760ac4a2010a381148082a86941e (diff) | |
better
| -rw-r--r-- | fish/conf.d/tmux.fish | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/fish/conf.d/tmux.fish b/fish/conf.d/tmux.fish index 23ad68f..f54542b 100644 --- a/fish/conf.d/tmux.fish +++ b/fish/conf.d/tmux.fish @@ -28,7 +28,18 @@ function tmux::new end function tmux::git_project - set -l filter (test -n "$argv[1]"; and echo $argv[1]; or echo .) + if test (count $argv) -eq 0 + set -l git_root (basename (git rev-parse --show-toplevel 2>/dev/null)) + if test -n "$git_root" + tmux::attach (basename $git_root) + return + else + set -l filter . + end + else + set -l filter $argv[1] + end + set -l git_dir ~/git set -l index_age 0 |
