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