Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions internal/zellij/zellij.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,16 @@ func OpenTab(dir, repoName, worktreeName string) error {
}
}

// Tab doesn't exist, create it
create := exec.Command("zellij", "action", "new-tab", "--name", name, "--cwd", dir)
// Tab doesn't exist, create it.
// As of zellij 0.44, `new-tab --cwd` is only honored when an INITIAL_COMMAND is
// supplied — without one the default shell starts in $HOME. Pass $SHELL
// explicitly so --cwd takes effect, and --close-on-exit so the pane behaves
// like a normal shell tab (closes on exit instead of respawning).
shell := os.Getenv("SHELL")
if shell == "" {
shell = "/bin/sh"
Comment thread
joch marked this conversation as resolved.
}
create := exec.Command("zellij", "action", "new-tab", "--name", name, "--cwd", dir, "--close-on-exit", "--", shell)
if err := create.Run(); err != nil {
return fmt.Errorf("failed to create zellij tab %q: %w", name, err)
}
Expand Down
Loading