[BUG] Re-shown snacks split puts the cursor a row above the prompt when it has a winbar
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 84/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- lua, neovim
研究方向
從 lua/claudecode/terminal/snacks.lua 開始,檢查 vsplit、nvim_win_set_buf 和 reapply_snacks_window_state 周圍的重新顯示序列。使用預設的 snacks provider 和一個 winbar 重現隱藏/顯示循環。當狀態在切換緩衝區之前重新套用,且反覆切換仍能保持 Claude 的提示字元和游標對齊而不遺失 winbar 時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
Re-showing the split terminal with the snacks provider still leaves the cursor a row above Claude's ❯ prompt, the symptom in #240, whenever the split has a winbar. That's the default for split terminals (snacks/terminal.lua sets N: %{get(b:, 'term_title', '')} unless wo.winbar is set), and neither claudecode nor LazyVim's claudecode extra overrides it, so it's what you get out of the box.
To reproduce, open Claude in a right split with the default snacks provider, hide it with :ClaudeCode, show it again with :ClaudeCode, and the cursor sits a row above the prompt.
The re-show in lua/claudecode/terminal/snacks.lua runs vsplit, then nvim_win_set_buf, then reapply_snacks_window_state. Until the options are reapplied the terminal sits in a window with no winbar, one row taller than Claude last drew into. Neovim pulls a line of scrollback onto the screen when a terminal grows, and when the winbar comes back it drops a blank row off the bottom instead of pushing that line back, so the content ends up a row lower than Claude thinks it is. Claude redraws relative to the cursor, so every frame after that is a row off.
Moving reapply_snacks_window_state(term, new_win) above nvim_win_set_buf fixes it for me. The winbar survives the buffer switch, and hide/show stayed aligned in every case I tried, four quick toggles in a row included, with no Ctrl+L sent. Setting snacks_win_opts.wo.winbar = "" also works, but loses the title.
- Neovim 0.12.5
- Claude Code 2.1.283
- claudecode.nvim 2390c6e (current main)
- snacks.nvim 882c996
- WSL2 Ubuntu
- 主要語言
- Lua
- 星號
- 3.1k
- 分支
- 219
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
coder/claudecode.nvim 的其他 Issue
-
bug needs-triage
難度 1/5 1 小時以內 新手友好度 88/100
coder/claudecode.nvim#314 ·
-
bug needs-triage
難度 2/5 1-3 小時 新手友好度 72/100
coder/claudecode.nvim#313 ·
-
needs-triage
難度 5/5 一週以上 新手友好度 20/100
coder/claudecode.nvim#319 · 2 個 reaction ·
-
bug needs-triage
難度 4/5 3-5 天 新手友好度 35/100
coder/claudecode.nvim#316 · 1 則留言 ·
-
needs-triage
難度 3/5 1-2 天 新手友好度 62/100
coder/claudecode.nvim#309 ·
查看 coder/claudecode.nvim 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 86/100
-
難度 2/5 1-3 小時 新手友好度 82/100
objectionary/eolang.sty#184 ·
-
bug
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
feature request
難度 1/5 1 小時以內 新手友好度 86/100
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 84/100
nvim-flutter/flutter-tools.nvim#557 ·
維護者通常 1 天內回覆