Skip to content

Incorrect tab is highlighted after @close-tab #3516

@salmankhilji

Description

@salmankhilji

Describe the bug
When controlling kitty externally from a script, the @close-tab command causes the wrong tab to get highlighted in the tab bar.

To Reproduce
Steps to reproduce the behavior:

  1. Run the following script:
#!/bin/sh
mkdir -p tab1 tab2 tab3
kitty -o allow_remote_control=yes --listen-on unix:@mykitty --detach
sleep 0.2
kitty @ --to=unix:@mykitty set-tab-title setup
kitty @ --to=unix:@mykitty launch --no-response --tab-title=tab1 --type=tab --cwd=$PWD/tab1 --keep-focus --location=last bash
kitty @ --to=unix:@mykitty launch --no-response --tab-title=tab2 --type=tab --cwd=$PWD/tab2 --keep-focus --location=last bash
kitty @ --to=unix:@mykitty launch --no-response --tab-title=tab3 --type=tab --cwd=$PWD/tab3 --keep-focus --location=last bash
kitty @ --to=unix:@mykitty focus-tab --match title:tab2
kitty @ --to=unix:@mykitty close-tab --match title:setup

Expected behavior

  • Remaining tabs: tab1, tab2, and tab3
  • Current tab: tab2
  • Highlighted tab: tab2

Observed behavior

  • Remaining tabs: tab1, tab2, and tab3
  • Current tab: tab2
  • Highlighted tab: tab3

Screenshot
Screenshot from 2021-04-22 05-37-12

Environment details
OS: Name and version of operating system(s)

Ubuntu 20.04 LTS.

$ kitty --debug-config
kitty 0.20.1 (572d576d5b) created by Kovid Goyal
Linux byteevo-scm 5.8.0-50-generic #56~20.04.1-Ubuntu SMP Mon Apr 12 21:46:35 UTC 2021 x86_64
Ubuntu 20.04.2 LTS \n \l
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.2 LTS"
Running under: X11

Config options different from defaults:

Additional context

  • I do not have a kitty.conf file, so everything is at defaults.
  • kitty is built from source. master branch @ 572d576d.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions