Skip to content

Commit ef0592f

Browse files
fix: do not wipe claude buffer on window close
1 parent d0f9748 commit ef0592f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lua/claudecode/terminal/native.lua

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ local function open_terminal(cmd_string, env_table, effective_config, focus)
125125

126126
winid = new_winid
127127
bufnr = vim.api.nvim_get_current_buf()
128-
vim.bo[bufnr].bufhidden = "wipe" -- Wipe buffer when hidden (e.g., window closed)
128+
vim.bo[bufnr].bufhidden = "hide"
129129
-- buftype=terminal is set by termopen
130130

131131
if focus then
@@ -185,9 +185,6 @@ end
185185
local function hide_terminal()
186186
-- Hide the terminal window but keep the buffer and job alive
187187
if bufnr and vim.api.nvim_buf_is_valid(bufnr) and winid and vim.api.nvim_win_is_valid(winid) then
188-
-- Set buffer to hide instead of being wiped when window closes
189-
vim.api.nvim_buf_set_option(bufnr, "bufhidden", "hide")
190-
191188
-- Close the window - this preserves the buffer and job
192189
vim.api.nvim_win_close(winid, false)
193190
winid = nil -- Clear window reference

0 commit comments

Comments
 (0)