Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

[BUG] Re-shown snacks split puts the cursor a row above the prompt when it has a winbar

未關閉 適合新手
#321 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 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 內容生成。

描述

needs-triage

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

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 沒有貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

coder/claudecode.nvim 的其他 Issue

查看 coder/claudecode.nvim 的全部 Issue

相似的 Issue

更多 Lua Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。