fix: don't break zellij when selecting the current dir

This commit is contained in:
Noah Masur 2025-04-01 09:51:20 -04:00
parent b78bc5b3bb
commit b8337f1295
No known key found for this signature in database

View File

@ -24,7 +24,14 @@ in
# description = "Open a session in Zellij";
body = # fish
''
zoxide query --interactive | xargs -I {} sh -c 'zellij pipe --plugin file:$(which zellij-switch.wasm) -- "--cwd {} --layout default --session $(basename {})"' \\;
set TARGET_DIR $(zoxide query --interactive)
if test -z $TARGET_DIR
return 0
end
if test "$TARGET_DIR" = $(pwd)
return 1
end
zellij pipe --plugin file:$(which zellij-switch.wasm) -- "--cwd $TARGET_DIR --layout default --session $(basename $TARGET_DIR)"
'';
};
};