Skip to content

fix(diff): open a new-tab diff on Neovim 0.8, which has no 'statuscolumn' - #394

Merged
ThomasK33 merged 3 commits into
mainfrom
fix/diff-nvim08-new-tab
Nov 1, 2026
Merged

ThomasK33 merged 3 commits into
mainfrom
fix/diff-nvim08-new-tab

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Part of #393 (item 1).

Why

The goal is to close the open follow-up issues in this repo, which list bugs found while verifying earlier fixes. This PR covers item 1 of issue 393. It breaks a Neovim version the README supports (0.8 and later).

With diff_opts.open_in_new_tab = true and a Claude terminal window open, every openDiff failed on Neovim 0.8. Claude got -32000 Diff setup failed ... unknown option 'statuscolumn', and the user got the error and a Press ENTER prompt. The new-tab path copies the terminal window's options into the new tab (capture_window_options, added in #111). It read 'statuscolumn', which Neovim 0.8 does not have (the option is new in 0.9).

What changed

  • capture_window_options in lua/claudecode/diff.lua reads 'statuscolumn' only when has("nvim-0.9"). apply_window_options already sets each option through pcall, so the default options' statuscolumn = "" needs no change.
  • New real-Neovim spec tests/integration/diff_new_tab_spec.lua. It opens a diff in a new tab while a real terminal buffer has a window. It checks that the terminal shows in the new tab with its window options. It also checks that the user's :w answers FILE_SAVED, and that Claude's close_tab closes the tab and keeps the terminal window.
  • covered.lock is re-recorded, because the diff.lua file hash changed. No covered block or fact changed.

Scope

Only the option copy on Neovim 0.8. I checked the rest of the new-tab lifecycle on 0.8.3 (open, :w, close_tab) live and in the spec, and it works once the copy works.

Blast Radius

Neovim 0.9 and later read the same options as before. On 0.8 the new tab's terminal window keeps its own 'statuscolumn', which 0.8 does not have anyway. Nothing else calls capture_window_options.

Verification

Red first: the new spec fails 2 of 2 on Neovim 0.8.3 without the fix, with diff.lua:280: unknown option 'statuscolumn'. With the fix it passes 2 of 2 on 0.8.3, 0.9.5 and 0.12.3. CI's integration job runs it on v0.8.0 and stable.

Live runs through the verify-claudecode-nvim harness, with a real Claude terminal (native provider running sh) and open_in_new_tab = true. For 0.8.3 I used a scratch copy of the harness that takes the Neovim binary from an env var, and that allows a server that is its own TUI process (Neovim 0.8 has no separate TUI process).

Run openDiff User :w close_tab
main, Neovim 0.8.3 -32000 ... unknown option 'statuscolumn', Press ENTER prompt none none
this PR, Neovim 0.8.3 new tab (2 tabs, 3 windows) FILE_SAVED TAB_CLOSED, 1 tab, 2 windows
this PR, Neovim 0.12.3 new tab (2 tabs, 3 windows) FILE_SAVED TAB_CLOSED, 1 tab, 2 windows

Neovim 0.8.3 on main:

openDiff fails on Neovim 0.8.3

Neovim 0.8.3 with this PR:

openDiff opens the new tab on Neovim 0.8.3

Gates on the head: mise run check (0 warnings), mise run test (952 passed, shuffled), ./scripts/run_integration_tests_individually.sh (32 passed), stylua clean. .agents/skills/verify-diff-lifecycle/check.sh passes.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: xhigh

With `diff_opts.open_in_new_tab` and a Claude terminal window, openDiff copies
the terminal window's options into the new tab. Neovim 0.8 has no
'statuscolumn', so the copy fails with "unknown option 'statuscolumn'" and
openDiff answers -32000. This real-Neovim spec fails on Neovim 0.8.3 and
passes on 0.12.3.

_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_
The user's :w answers FILE_SAVED, and Claude's close_tab closes the new tab and
keeps the user's terminal window. Without the fix this fails on Neovim 0.8.3
too, at openDiff.

_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_
…umn'

With `diff_opts.open_in_new_tab` and a Claude terminal window, openDiff copies
the terminal window's options into the new tab. Reading 'statuscolumn' raised
"unknown option" on Neovim 0.8, where that option does not exist (it is new in
0.9), so openDiff failed with -32000. Read it only on Neovim 0.9 and later.
Setting it already goes through pcall.

Part of #393.

_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T10:40:34.590656Z 16d1512 Manual request
🔒 Security Review ✅ Completed 2026-11-01T10:41:06.903965Z 16d1512 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 16d1512770

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 16d1512770

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33
ThomasK33 added this pull request to the merge queue Nov 1, 2026
Merged via the queue into main with commit 15774e7 Nov 1, 2026
5 checks passed
@ThomasK33
ThomasK33 deleted the fix/diff-nvim08-new-tab branch November 1, 2026 10:52
@github-actions github-actions Bot mentioned this pull request Nov 1, 2026
ThomasK33 added a commit that referenced this pull request Nov 1, 2026
main's record (#394) now covers diff.lua. Only server/client.lua and
server/frame.lua differ from it, as in the earlier records on this
branch, and check.sh passes.

Part of #393

_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_
ThomasK33 added a commit that referenced this pull request Nov 1, 2026
…, #397, #399

check.sh --mutants caught every guard on the tree merged with #394. This merge
changes no fact (all 21 read TRUE) and not the model, so the mutant result
holds. check.sh passes.

_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_
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