diff --git a/kitty/window.py b/kitty/window.py index e2cf564af..a80741d2e 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -213,8 +213,9 @@ def compile_match_query(exp: str, is_simple: bool = True) -> MatchPatternType: def decode_cmdline(x: str) -> str: ctype, sep, val = x.partition('=') if ctype == 'cmdline': - return next(shlex_split(val, True)) - if ctype == 'cmdline_url': + with suppress(StopIteration): + return next(shlex_split(val, True)) + elif ctype == 'cmdline_url': from urllib.parse import unquote return unquote(val) return ''