Skip to content

Commit 297b2f1

Browse files
committed
feat: enable terminal providers to implement ensure_visible
Allow terminal providers to implement a custom ensure_visible method. This provides more flexibility for custom terminal providers to handle visibility logic.
1 parent d0f9748 commit 297b2f1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lua/claudecode/terminal.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
--- @field focus_toggle function
1212
--- @field get_active_bufnr function
1313
--- @field is_available function
14+
--- @field ensure_visible function
1415
--- @field _get_terminal_for_test function
1516

1617
local M = {}
@@ -248,6 +249,13 @@ end
248249
--- @return boolean True if terminal was opened or already visible
249250
local function ensure_terminal_visible_no_focus(opts_override, cmd_args)
250251
local provider = get_provider()
252+
253+
-- Check if provider has an ensure_visible method
254+
if provider.ensure_visible then
255+
provider.ensure_visible()
256+
return true
257+
end
258+
251259
local active_bufnr = provider.get_active_bufnr()
252260

253261
if is_terminal_visible(active_bufnr) then

0 commit comments

Comments
 (0)