@@ -24,6 +24,7 @@ local config = {
2424 show_native_term_exit_tip = true ,
2525 terminal_cmd = nil ,
2626 auto_close = true ,
27+ snacks_win_opts = {},
2728}
2829
2930-- Lazy load providers
@@ -91,6 +92,9 @@ local function build_config(opts_override)
9192 split_width_percentage = function (val )
9293 return type (val ) == " number" and val > 0 and val < 1
9394 end ,
95+ snacks_win_opts = function (val )
96+ return type (val ) == " table"
97+ end ,
9498 }
9599 for key , val in pairs (opts_override ) do
96100 if effective_config [key ] ~= nil and validators [key ] and validators [key ](val ) then
@@ -102,6 +106,7 @@ local function build_config(opts_override)
102106 split_side = effective_config .split_side ,
103107 split_width_percentage = effective_config .split_width_percentage ,
104108 auto_close = effective_config .auto_close ,
109+ snacks_win_opts = effective_config .snacks_win_opts ,
105110 }
106111end
107112
179184-- @field user_term_config.split_width_percentage number Percentage of screen width (0.0 to 1.0, default: 0.30).
180185-- @field user_term_config.provider string 'snacks' or 'native' (default: 'snacks').
181186-- @field user_term_config.show_native_term_exit_tip boolean Show tip for exiting native terminal (default: true).
187+ -- @field user_term_config.snacks_win_opts table Opts to pass to `Snacks.terminal.open()` (default: {}).
182188-- @param p_terminal_cmd string|nil The command to run in the terminal (from main config).
183189function M .setup (user_term_config , p_terminal_cmd )
184190 if user_term_config == nil then -- Allow nil, default to empty table silently
@@ -210,6 +216,8 @@ function M.setup(user_term_config, p_terminal_cmd)
210216 config [k ] = v
211217 elseif k == " auto_close" and type (v ) == " boolean" then
212218 config [k ] = v
219+ elseif k == " snacks_win_opts" and type (v ) == " table" then
220+ config [k ] = v
213221 else
214222 vim .notify (" claudecode.terminal.setup: Invalid value for " .. k .. " : " .. tostring (v ), vim .log .levels .WARN )
215223 end
0 commit comments