mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 19:21:38 +02:00
Handle -- as flag terminator in sudo wrapper
This commit is contained in:
@@ -26,6 +26,7 @@ if [[ -n "$KITTY_BASH_INJECT" ]]; then
|
|||||||
is_sudoedit="y"
|
is_sudoedit="y"
|
||||||
builtin break;
|
builtin break;
|
||||||
fi
|
fi
|
||||||
|
[[ "$arg" == "--" ]] && builtin break # end of options
|
||||||
[[ "$arg" != -* && "$arg" != *=* ]] && builtin break # command found
|
[[ "$arg" != -* && "$arg" != *=* ]] && builtin break # command found
|
||||||
done
|
done
|
||||||
if [[ "$is_sudoedit" == "y" ]]; then
|
if [[ "$is_sudoedit" == "y" ]]; then
|
||||||
|
|||||||
@@ -150,6 +150,9 @@ function __ksi_schedule --on-event fish_prompt -d "Setup kitty integration after
|
|||||||
set is_sudoedit "y"
|
set is_sudoedit "y"
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
if string match -q -- "--" "$arg"
|
||||||
|
break # end of options
|
||||||
|
end
|
||||||
if not string match -r -q -- "^-" "$arg" and not string match -r -q -- "=" "$arg"
|
if not string match -r -q -- "^-" "$arg" and not string match -r -q -- "=" "$arg"
|
||||||
break # reached the command
|
break # reached the command
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -412,6 +412,7 @@ _ksi_deferred_init() {
|
|||||||
is_sudoedit="y"
|
is_sudoedit="y"
|
||||||
builtin break;
|
builtin break;
|
||||||
fi
|
fi
|
||||||
|
[[ "$arg" == "--" ]] && builtin break # end of options
|
||||||
[[ "$arg" != -* && "$arg" != *=* ]] && builtin break # command found
|
[[ "$arg" != -* && "$arg" != *=* ]] && builtin break # command found
|
||||||
done
|
done
|
||||||
if [[ "$is_sudoedit" == "y" ]]; then
|
if [[ "$is_sudoedit" == "y" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user