From d9b1c8c04f3020a28da5de3128fa3e3c54f24a44 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 2 Sep 2024 11:38:31 +0530 Subject: [PATCH] Fix a harmless error being printed to stderr if shell integration sends an empty cmdline Fixes #7813 --- kitty/window.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 ''