Skip to content

fix: open zellij tabs in worktree dir on zellij 0.44+#2

Merged
joch merged 1 commit into
mainfrom
fix-cwd
May 4, 2026
Merged

fix: open zellij tabs in worktree dir on zellij 0.44+#2
joch merged 1 commit into
mainfrom
fix-cwd

Conversation

@joch
Copy link
Copy Markdown
Owner

@joch joch commented May 4, 2026

Summary

  • Zellij 0.44 silently ignores new-tab --cwd <path> unless an INITIAL_COMMAND is supplied — the default shell starts in \$HOME regardless of --cwd.
  • Workaround: pass \$SHELL (with /bin/sh fallback) as the initial command so --cwd takes effect, plus --close-on-exit so the pane closes on exit instead of respawning (matching default-shell behavior).
  • Tab chrome (status bar, tab bar) is preserved — an earlier --layout-string approach was discarded because it stripped the chrome.

Test plan

  • `go build ./...` and `go test ./internal/zellij/...` pass
  • Manually verified end-to-end inside a zellij 0.44.1 session: a tab created via the new command opens in the worktree directory, has full chrome, and closes cleanly on `exit`
  • CI: tests + vet + staticcheck + golangci-lint + cross-platform builds (ubuntu/macos/windows)

Zellij 0.44 stopped honoring `new-tab --cwd <path>` when no
INITIAL_COMMAND is supplied — the default shell starts in $HOME
regardless. Pass $SHELL (with /bin/sh fallback) as the initial command
so --cwd takes effect, plus --close-on-exit so the pane behaves like a
normal default-shell tab (closes on exit instead of respawning).
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c8f1118e14

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/zellij/zellij.go
@joch joch merged commit c066de3 into main May 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant