Fix a harmless error being printed to stderr if shell integration sends an empty cmdline

Fixes #7813
This commit is contained in:
Kovid Goyal
2024-09-02 11:38:31 +05:30
parent ccc3bee9af
commit d9b1c8c04f

View File

@@ -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 ''