Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở Phù hợp với người mới
#321 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
84/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
lua, neovim

Hướng nghiên cứu

Bắt đầu trong lua/claudecode/terminal/snacks.lua và kiểm tra chuỗi hiển thị lại xung quanh vsplit, nvim_win_set_buf và reapply_snacks_window_state. Tái hiện chu kỳ ẩn/hiện với provider snacks mặc định và một winbar. Hoàn thành khi trạng thái được áp dụng lại trước khi chuyển buffer và việc chuyển đổi lặp lại vẫn giữ prompt cùng con trỏ của Claude thẳng hàng mà không làm mất winbar.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Lua
Star
3.1k
Fork
217
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của coder/claudecode.nvim

Tất cả issue của coder/claudecode.nvim

Issue tương tự

Thêm issue về Lua

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.