kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
22.14k stars 907 forks source link

Kitten not matching on tab titles with spaces? #7400

Closed shankargopal closed 2 weeks ago

shankargopal commented 2 weeks ago

Describe the bug I have been using kitty for a few weeks, and I absolutely love it! Thank you so much for this wonderful, lightweight and powerful piece of software.

I acknowledge that the issue I'm running into has probably already been dealt with, but I couldn't find a reference to it. When I try to run kitten @ focus-tab --match "title:<tab title>", if the tab title has spaces, I get an error. For instance suppose the tab title is polybar -r ~ and I run kitten @ focus-tab --match "title:polybar -r ~" I get this:

Error: No location specified before -r

I am trying to script tab switching using fzf, but keep running into this problem. The problem continues even if I wrap the title string in single quotes (while double quoting the entire title: string).

To Reproduce Steps to reproduce the behavior:

  1. Run kitten @ focus-tab --match "title:<tab title>" with a tab title that has spaces in it.
  2. See error Error: No location specified before <second word>

Environment details

kitty 0.32.2 created by Kovid Goyal Linux debian 6.6.15-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.6.15-2 (2024-02-04) x86_64 Debian GNU/Linux trixie/sid debian /dev/tty

Running under: X11 Frozen: False Paths: kitty: /usr/bin/kitty base dir: /usr/lib/kitty extensions dir: /usr/lib/kitty/kitty system shell: /usr/bin/fish Loaded config files: /home/user/.config/kitty/kitty.conf

Config options different from defaults: allow_remote_control yes bold_font Inconsolata bold_italic_font Inconsolata enable_audio_bell False font_family Inconsolata font_size 10.0 italic_font Inconsolata tab_activity_symbol # Added shortcuts: ctrl+[ → new_tab ctrl+h → previous_tab ctrl+l → next_tab Colors: background #001e26
color0 #002731
color1 #d01b24
color10 #465a61
color11 #52676f
color12 #708183
color13 #5856b9
color14 #81908f
color15 #fcf4dc
color2 #728905
color3 #a57705
color4 #2075c7
color5 #c61b6e
color6 #259185
color7 #e9e2cb
color8 #001e26
color9 #bd3612
cursor #708183
foreground #708183
selection_background #002731
selection_foreground #001e26

Important environment variables seen by the kitty process: PATH /home/user/.local/bin:/home/user/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games LANG en_US.UTF-8 SHELL /usr/bin/fish DISPLAY :0 USER user XCURSOR_SIZE 24 XDG_CONFIG_DIRS /home/user/.config/kdedefaults:/etc/xdg:/usr/share/desktop-base/kf5-settings XDG_SESSION_PATH /org/freedesktop/DisplayManager/Session10 XDG_SEAT seat0 XDG_SESSION_DESKTOP plasma XDG_SESSION_TYPE x11 XDG_GREETER_DATA_DIR /var/lib/lightdm/data/user XDG_CURRENT_DESKTOP KDE XDG_SEAT_PATH /org/freedesktop/DisplayManager/Seat0 XDG_SESSION_CLASS user XDG_VTNR 7 XDG_SESSION_ID 47 XDG_RUNTIME_DIR /run/user/1000

Additional context Try to reproduce the problem with kitty --config NONE if you cannot then post a minimal kitty.conf that reproduces the problem. If the problem involves interaction with some other terminal program post a minimal config for that program to reproduce the problem as well.

If I run kitty -o allow_remote_control=yes --config NONE the problem still occurs.

Thank you again for all your hard work!

kovidgoyal commented 2 weeks ago

Just replace the spaces with periods. Or you can use \s if you want to match only spaces.