From 06b2ccb88c0820f9b4e06f3a44e30ccf4ec93ac7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 04:25:37 +0000 Subject: [PATCH] Fix test_fish_sudo_parser: fix fish sudo function bugs Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/d743ec32-6ae8-41c8-b7bb-6efc63f7d346 Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com> --- .../vendor_conf.d/kitty-shell-integration.fish | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish b/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish index 477ea9182..e2637d5fa 100644 --- a/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish +++ b/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish @@ -154,27 +154,26 @@ function __ksi_schedule --on-event fish_prompt -d "Setup kitty integration after if string match -r -q -- '^--$' "$arg" break # end of options end - if string match -r -q -- '^-[^-]*e' "$arg" or string match -q -- "--edit" "$arg" + if string match -r -q -- '^-[^-]*e' "$arg"; or string match -q -- "--edit" "$arg" set cannot_set_env_var "y" # sudo -e break end - if string match -r -q -- '^-[^-]*v' "$arg" or string match -q -- "--validate" "$arg" + if string match -r -q -- '^-[^-]*v' "$arg"; or string match -q -- "--validate" "$arg" set cannot_set_env_var "y" # sudo-rs -e break end - if string match -r -q -- '--user|--group|--host|--chdir|--chroot|--role|--type|--command-timeout|--auth-type|--login-class|--prompt|--close-from|--other-user' "$arg" - - set ignore_arg="y" + if string match -r -q -- '^(--user|--group|--host|--chdir|--chroot|--role|--type|--command-timeout|--auth-type|--login-class|--prompt|--close-from|--other-user)$' "$arg" + set ignore_arg "y" continue end if string match -r -q -- '--.+' "$arg" continue end - if string match -r -q -- '-.*a|-.*C|-.*c|-.*D|-.*g|-.*h|-.*p|-.*R|-.*r|-.*t|-.*T|-.*u)' "$arg" - set ignore_arg="y" + if string match -r -q -- '^-.*a|^-.*C|^-.*c|^-.*D|^-.*g|^-.*h|^-.*p|^-.*R|^-.*r|^-.*t|^-.*T|^-.*u' "$arg" + set ignore_arg "y" continue end - if string match -r -q -- '-.+' "$arg" or string match -r -q -- '.+=.+' "$arg" + if string match -r -q -- '-.+' "$arg"; or string match -r -q -- '.+=.+' "$arg" continue end break # command found