fix: attempt_completion ignore open command (#2151)

This commit is contained in:
yetone
2025-06-05 00:06:49 +08:00
committed by GitHub
parent 3a77a591b3
commit 9efb9e1029

View File

@@ -72,7 +72,8 @@ function M.func(opts, on_log, on_complete, session_ctx)
local sidebar = require("avante").get()
if not sidebar then return false, "Avante sidebar not found" end
session_ctx.attempt_completion_is_called = true
if opts.command and opts.command ~= "" and opts.command ~= vim.NIL then
if opts.command and opts.command ~= vim.NIL and opts.command ~= "" and not vim.startswith(opts.command, "open ") then
session_ctx.always_yes = false
require("avante.llm_tools.bash").func({ command = opts.command }, on_log, on_complete, session_ctx)
else
on_complete(true, nil)