v1.3: Open websites, folders and programs without a confirm box
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8c09e56982
commit
aecdc732b9
+24
-7
@@ -31,14 +31,31 @@ namespace QuickClaude
|
||||
// Nothing to show: say nothing, so Claude Code's normal permission rules decide
|
||||
if (string.IsNullOrEmpty(command)) return 0;
|
||||
|
||||
new Application { ShutdownMode = ShutdownMode.OnExplicitShutdown };
|
||||
var win = new ConfirmWindow(toolName, command, cwd);
|
||||
win.ShowDialog();
|
||||
string decision, reason;
|
||||
var verdict = OpenRules.Check(command, cwd, out var hint);
|
||||
if (verdict == OpenRules.Verdict.Allow)
|
||||
{
|
||||
// "open x.com", "open C:\wallpapers", "open mspaint": no confirm box (see OpenRules)
|
||||
decision = "allow";
|
||||
reason = "Opening a website, folder or installed program is allowed without asking.";
|
||||
}
|
||||
else if (verdict == OpenRules.Verdict.Hint)
|
||||
{
|
||||
// The bare name wouldn't resolve, but there's a Start Menu shortcut for it
|
||||
decision = "deny";
|
||||
reason = hint;
|
||||
}
|
||||
else
|
||||
{
|
||||
new Application { ShutdownMode = ShutdownMode.OnExplicitShutdown };
|
||||
var win = new ConfirmWindow(toolName, command, cwd);
|
||||
win.ShowDialog();
|
||||
|
||||
string decision = win.Allowed ? "allow" : "deny";
|
||||
string reason = win.Allowed ? "The user allowed this command."
|
||||
: win.TimedOut ? "The user didn't answer within 2 minutes, so the command was not run. Carry on without it."
|
||||
: "The user declined to run this command. Carry on without it.";
|
||||
decision = win.Allowed ? "allow" : "deny";
|
||||
reason = win.Allowed ? "The user allowed this command."
|
||||
: win.TimedOut ? "The user didn't answer within 2 minutes, so the command was not run. Carry on without it."
|
||||
: "The user declined to run this command. Carry on without it.";
|
||||
}
|
||||
|
||||
var json = JsonSerializer.Serialize(new
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user