Did you check docs and existing issues?
Neovim version (nvim -v)
v0.12.0
Operating system/version
MacOS 26.4
Describe the bug
When the sidekick CLI panel is closed and reopened (e.g. via <c-.>), the panel content shifts to the left — the first several columns become invisible, as if leftcol is non-zero.
Steps To Reproduce
- Open sidekick panel with a CLI tool (Claude Code in my case)
- Close the panel with <c-.>
- Reopen the panel with <c-.>
- The left edge of the terminal content is cut off (e.g. status line shows ERT -- instead of INSERT --)
Expected Behavior
Cause
open_win() in terminal.lua creates a new window for the existing buffer via nvim_open_win(), but never resets the horizontal scroll position. The scroll() function in scrollback.lua (line 246) restores topline, lnum, and col but omits leftcol:
vim.fn.winrestview({
topline = topline,
lnum = lnum,
col = col,
})
When the buffer had any horizontal scroll before the window was closed, the new window inherits the stale leftcol, cutting off the left columns.
Suggested fix
Add leftcol = 0 to the winrestview() call, or reset it in open_win() after creating the window:
vim.fn.winrestview({
topline = topline,
lnum = lnum,
col = col,
leftcol = 0,
})
Workaround
Wrapping open_win via the config callback:
opts = {
cli = {
win = {
config = function(terminal)
local orig_open_win = terminal.open_win
function terminal:open_win()
orig_open_win(self)
if self.win and vim.api.nvim_win_is_valid(self.win) then
vim.api.nvim_win_call(self.win, function()
vim.fn.winrestview({ leftcol = 0 })
end)
end
end
end,
},
},
}
Repro
Did you check docs and existing issues?
Neovim version (nvim -v)
v0.12.0
Operating system/version
MacOS 26.4
Describe the bug
When the sidekick CLI panel is closed and reopened (e.g. via <c-.>), the panel content shifts to the left — the first several columns become invisible, as if leftcol is non-zero.
Steps To Reproduce
Expected Behavior
Cause
open_win() in terminal.lua creates a new window for the existing buffer via nvim_open_win(), but never resets the horizontal scroll position. The scroll() function in scrollback.lua (line 246) restores topline, lnum, and col but omits leftcol:
When the buffer had any horizontal scroll before the window was closed, the new window inherits the stale leftcol, cutting off the left columns.
Suggested fix
Add leftcol = 0 to the winrestview() call, or reset it in open_win() after creating the window:
Workaround
Wrapping open_win via the config callback:
Repro