From 92f428b6d1a9be0a8f51cc4a19f3dcc7eb2eb87e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 21 Jul 2021 18:59:18 +0530 Subject: [PATCH] common prefix should not apply to basename --- kitty/complete.py | 1 + 1 file changed, 1 insertion(+) diff --git a/kitty/complete.py b/kitty/complete.py index 59c5b2cba..07efe32c1 100644 --- a/kitty/complete.py +++ b/kitty/complete.py @@ -254,6 +254,7 @@ def zsh_output_serializer(ans: Completions) -> str: if len(allm) > 1: common_prefix = os.path.commonprefix(allm) if common_prefix and '/' in common_prefix: + common_prefix = os.path.dirname(common_prefix) + '/' cmd.extend(('-p', shlex.quote(common_prefix))) matches = MatchGroup({k[len(common_prefix):]: v for k, v in matches.items()}) has_descriptions = any(matches.values())