Open Claude Code in its own tab on dejima auto-start #5

Merged
branderson merged 1 commits from nvim-claude-tab into master 2026-08-10 14:14:57 -07:00
Collaborator

Summary generated by LLM agent

Inside dejima, nvim already auto-opens claudecode.nvim on startup, but only as the configured narrow right-hand split. That is the right shape for referring to Claude while editing, and the wrong shape for actually working in Claude, which is what most of a sandbox session is.

This follows the auto-start with tab split, so the same terminal buffer also gets a full-screen window in its own tab. The original tab keeps the editor plus the narrow split, so both layouts are available at once: tab 2 to work in Claude, tab 1 to work side-by-side with it. Only the dejima auto-start path is touched; <leader>ac on a normal host behaves exactly as before.

:ClaudeCode returns with the terminal window focused (the snacks provider's open is synchronous and focusing), so a plain tab split operates on the right window. It is guarded on the current buffer matching the plugin's active terminal bufnr, so a failed or unexpected open cannot duplicate some other buffer into a new tab instead.

Tested by running headless nvim with DEJIMA=1 against this branch's config and dumping the resulting layout: tab 1 has the editor (55 cols) and the Claude terminal split (24 cols), tab 2 has the same terminal buffer at full width, focused, with mode t. Window-local options set by snacks (number=false, signcolumn=no, winhighlight) are inherited by the split, so the full-screen view looks identical to the split one, and snacks' buffer-local auto_insert BufEnter returns the window to terminal mode whenever you switch to that tab.

**Summary generated by LLM agent** Inside dejima, nvim already auto-opens claudecode.nvim on startup, but only as the configured narrow right-hand split. That is the right shape for referring to Claude while editing, and the wrong shape for actually working in Claude, which is what most of a sandbox session is. This follows the auto-start with `tab split`, so the same terminal buffer also gets a full-screen window in its own tab. The original tab keeps the editor plus the narrow split, so both layouts are available at once: tab 2 to work in Claude, tab 1 to work side-by-side with it. Only the dejima auto-start path is touched; `<leader>ac` on a normal host behaves exactly as before. `:ClaudeCode` returns with the terminal window focused (the snacks provider's `open` is synchronous and focusing), so a plain `tab split` operates on the right window. It is guarded on the current buffer matching the plugin's active terminal bufnr, so a failed or unexpected open cannot duplicate some other buffer into a new tab instead. Tested by running headless nvim with `DEJIMA=1` against this branch's config and dumping the resulting layout: tab 1 has the editor (55 cols) and the Claude terminal split (24 cols), tab 2 has the same terminal buffer at full width, focused, with mode `t`. Window-local options set by snacks (`number=false`, `signcolumn=no`, winhighlight) are inherited by the split, so the full-screen view looks identical to the split one, and snacks' buffer-local `auto_insert` BufEnter returns the window to terminal mode whenever you switch to that tab.
dejima-agent added 1 commit 2026-08-10 14:13:50 -07:00
The auto-start left the Claude terminal only as a narrow right split. Follow it with a tab split so the same terminal buffer also gets a full-screen tab, while the original tab keeps the side-by-side layout with the editor.
branderson approved these changes 2026-08-10 14:14:51 -07:00
branderson merged commit 86d19db1e9 into master 2026-08-10 14:14:57 -07:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: branderson/dotfiles#5