kovidgoyal / kitty

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

Closing an overlay window with close-window by id hangs on nightly #6751

Closed mikesmithgh closed 10 months ago

mikesmithgh commented 10 months ago

Describe the bug Closing an overlay window hangs on nightly. v0.30.1 doesn't have an issue

To Reproduce Steps to reproduce the behavior:

  1. Open a new Kitty window (assuming window id 1)
  2. Split the window (assuming window id 2)
  3. In the first window, open an overlay window (assuming window id 3) with the command:
    kitty @ launch --type=overlay
  4. In the second window, close the overlay window with the command:
    kitty @ close-window --match=id:3

Screenshots Screenshot 2023-10-24 at 4 56 05 PM

Environment details

kitty 0.30.1 (b1ec1c2678) created by Kovid Goyal
Darwin mikes-MBP.fios-router.home 23.0.0 Darwin Kernel Version 23.0.0: Fri Sep 15 14:43:05 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T6020 arm64
ProductName:        macOS ProductVersion:       14.0 BuildVersion:      23A344
Frozen: False
Paths:
  kitty: /Users/mike/go/src/github.com/kovidgoyal/kitty/kitty/launcher/kitty
  base dir: /Users/mike/go/src/github.com/kovidgoyal/kitty
  extensions dir: /Users/mike/go/src/github.com/kovidgoyal/kitty/kitty
  system shell: /opt/homebrew/bin/bash
Loaded config files:
  /Users/mike/.config/kitty/kitty.conf

Config options different from defaults:
active_tab_font_style           (False, False)
allow_remote_control            socket-only
bold_font                       MonoLisa Bold
bold_italic_font                MonoLisa Bold Italic
cursor_blink_interval           0.0
cursor_stop_blinking_after      0
editor                          /Users/mike/bin/nvim
enable_audio_bell               False
enabled_layouts                 ['vertical', 'horizontal', 'fat', 'grid', 'splits', 'stack', 'tall']
env:
{'VIMRUNTIME': '/Users/mike/gitrepos/neovim/runtime'}
font_family                     MonoLisa Regular
font_features:
{'MonoLisa-Bold': ('+calt',
                   '+liga',
                   '+zero',
                   '+ss04',
                   '+ss06',
                   '+ss07',
                   '+ss08',
                   '+ss10',
                   '+ss11',
                   '+ss12'),
 'MonoLisa-BoldItalic': ('+calt',
                         '+liga',
                         '+zero',
                         '+ss04',
                         '+ss06',
                         '+ss07',
                         '+ss08',
                         '+ss10',
                         '+ss11',
                         '+ss12'),
 'MonoLisa-Regular': ('+calt',
                      '+liga',
                      '+zero',
                      '+ss04',
                      '+ss06',
                      '+ss07',
                      '+ss08',
                      '+ss10',
                      '+ss11',
                      '+ss12'),
 'MonoLisa-RegularItalic': ('+calt',
                            '+liga',
                            '+zero',
                            '+ss04',
                            '+ss06',
                            '+ss07',
                            '+ss08',
                            '+ss10',
                            '+ss11',
                            '+ss12'),
 'MonoLisaLight-Italic': ('+calt',
                          '+liga',
                          '+zero',
                          '+ss04',
                          '+ss06',
                          '+ss07',
                          '+ss08',
                          '+ss10',
                          '+ss11',
                          '+ss12'),
 'MonoLisaLight-Regular': ('+calt',
                           '+liga',
                           '+zero',
                           '+ss04',
                           '+ss06',
                           '+ss07',
                           '+ss08',
                           '+ss10',
                           '+ss11',
                           '+ss12'),
 'MonoLisaMedium-Italic': ('+calt',
                           '+liga',
                           '+zero',
                           '+ss04',
                           '+ss06',
                           '+ss07',
                           '+ss08',
                           '+ss10',
                           '+ss11',
                           '+ss12'),
 'MonoLisaMedium-Regular': ('+calt',
                            '+liga',
                            '+zero',
                            '+ss04',
                            '+ss06',
                            '+ss07',
                            '+ss08',
                            '+ss10',
                            '+ss11',
                            '+ss12'),
 'MonoLisaSemiBold-Italic': ('+calt',
                             '+liga',
                             '+zero',
                             '+ss04',
                             '+ss06',
                             '+ss07',
                             '+ss08',
                             '+ss10',
                             '+ss11',
                             '+ss12'),
 'MonoLisaSemiBold-Regular': ('+calt',
                              '+liga',
                              '+zero',
                              '+ss04',
                              '+ss06',
                              '+ss07',
                              '+ss08',
                              '+ss10',
                              '+ss11',
                              '+ss12')}
font_size                       18.0
hide_window_decorations         2
initial_window_height           (1200, 'px')
initial_window_width            (1280, 'px')
italic_font                     MonoLisa Regular Italic
listen_on                       unix:/tmp/kitty
macos_option_as_alt             3
macos_titlebar_color            117901058
narrow_symbols:
{(60115, 60115): 1, (62762, 62762): 1}
remember_window_size            False
scrollback_fill_enlarged_window True
scrollback_pager                ['kitty-less-pager']
scrollback_pager_history_size   2097152
shell_integration               frozenset({'no-cursor', 'enabled'})
symbol_map:
    U+23fb - U+23fe → FuraMono Nerd Font
    U+2665 - U+2665 → FuraMono Nerd Font
    U+26a1 - U+26a1 → FuraMono Nerd Font
    U+2b58 - U+2b58 → FuraMono Nerd Font
    U+e000 - U+e00a → FuraMono Nerd Font
    U+e0a0 - U+e0a3 → FuraMono Nerd Font
    U+e0b0 - U+e0c8 → FuraMono Nerd Font
    U+e0ca - U+e0ca → FuraMono Nerd Font
    U+e0cc - U+e0d2 → FuraMono Nerd Font
    U+e0d4 - U+e0d4 → FuraMono Nerd Font
    U+e200 - U+e2a9 → FuraMono Nerd Font
    U+e300 - U+e3e3 → FuraMono Nerd Font
    U+e5fa - U+e634 → FuraMono Nerd Font
    U+e700 - U+e7c5 → FuraMono Nerd Font
    U+ea60 - U+ebeb → FuraMono Nerd Font
    U+f000 - U+f2e0 → FuraMono Nerd Font
    U+f300 - U+f32f → FuraMono Nerd Font
    U+f400 - U+f4a9 → FuraMono Nerd Font
    U+f500 - U+f8ff → FuraMono Nerd Font
    U+f10fe - U+f10fe → FuraMono Nerd Font
tab_bar_align                   center
wayland_titlebar_color          117901058
window_margin_width             FloatEdges(left=2.0, top=2.0, right=2.0, bottom=2.0)
window_padding_width            FloatEdges(left=4.0, top=8.0, right=4.0, bottom=8.0)
Changed mouse actions:
    ctrl+shift+right press ungrabbed →  combine : mouse_select_command_output : kitty_scrollback_nvim --config-file get_text_last_visited_cmd_output.lua
Added shortcuts:
    ctrl+w > h →  kitten pass_keys.py neighboring_window left   'ctrl+w>h'
    ctrl+w > j →  kitten pass_keys.py neighboring_window bottom 'ctrl+w>j'
    ctrl+w > k →  kitten pass_keys.py neighboring_window top    'ctrl+w>k'
    ctrl+w > l →  kitten pass_keys.py neighboring_window right  'ctrl+w>l'
    f2 →  kitty_scrollback_nvim --config ksb_example_callbacks
Changed shortcuts:
    kitty_mod+g →  kitty_scrollback_nvim --config-file get_text_last_cmd_output.lua
    kitty_mod+h →  kitty_scrollback_nvim
Colors:
    active_border_color             #53654e   
    active_tab_background           #32302f   
    active_tab_foreground           #a0a0a0   
    background                      #070707   
    bell_border_color               #d3869b   
    color0                          #070707   
    color1                          #ff6961   
    color10                         #53654e   
    color11                         #d6991d   
    color12                         #458588   
    color13                         #b16286   
    color14                         #92bbdf   
    color15                         #b7a7b7   
    color2                          #8faa80   
    color3                          #dbbc5f   
    color4                          #83a598   
    color5                          #d3869b   
    color6                          #9dbad4   
    color7                          #c7c7c7   
    color8                          #968c81   
    color9                          #af3a03   
    cursor                          #c7c7c7   
    cursor_text_color               #504a45   
    foreground                      #c7c7c7   
    inactive_border_color           #1a1a1a   
    inactive_tab_background         #1a1a1a   
    inactive_tab_foreground         #504945   
    mark1_background                #1a1a1a   
    mark1_foreground                #83a598   
    mark2_background                #1a1a1a   
    mark2_foreground                #dbbc5f   
    mark3_background                #1a1a1a   
    mark3_foreground                #ff6961   
    selection_background            #878787   
    selection_foreground            #3c3836   
    tab_bar_background              #070707   
    tab_bar_margin_color            #070707   
    url_color                       #9dbad4   
    visual_bell_color               #32302f   

Important environment variables seen by the kitty process:
    PATH                                /Users/mike/go/src/github.com/kovidgoyal/kitty/kitty/launcher:/opt/homebrew/opt/sdkman-cli/libexec/candidates/kotlin/current/bin:/opt/homebrew/opt/sdkman-cli/libexec/candidates/java/current/bin:/opt/homebrew/opt/sdkman-cli/libexec/candidates/gradle/current/bin:/Users/mike/.config/pyenv/shims:/Users/mike/bin:/Users/mike/go/bin:/Users/mike/.config/pyenv/bin:/Users/mike/gitrepos/neovim/build/bin:/Users/mike/.cargo/bin:/opt/homebrew/opt/libpq/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin::/opt/homebrew/opt/fzf/bin
    LANG                                en_US.UTF-8
    VISUAL                              nvim
    EDITOR                              nvim
    SHELL                               /opt/homebrew/bin/bash
    USER                                mike
    XDG_DATA_HOME                       /Users/mike/.local/share
    XDG_CONFIG_HOME                     /Users/mike/.config
    XDG_STATE_HOME                      /Users/mike/.local/state
    LC_CTYPE                            en_US.UTF-8
    XDG_RUNTIME_DIR                     /var/folders/52/fp0f1rv10t3_k_q60xk7_lgc0000gn/T/mike.FTbRTNSBOK
    LC_ALL                              en_US.UTF-8

Additional context Reproducible with the config

# mini-kitty.conf
allow_remote_control socket-only
listen_on unix:/tmp/kitty
kitty --config mini-kitty.conf
kovidgoyal commented 10 months ago

Doesn't reproduce for me with those steps on current master on macOS, running kitty with

kitty --config NONE -o allow_remote_control=y -o enabled_layouts=tall

then following your steps.

Closing as cannot reproduce, but if you are still having the issue with the next nightly, then feel free to update.

mikesmithgh commented 10 months ago
kitty --config NONE -o allow_remote_control=y -o enabled_layouts=tall

works fine for me as well.

It appears to be specific to when Kitty is listening on a socket. I've added --listen-on unix:/tmp/kitty and the problem is reproducible on MacOS.

kitty/launcher/kitty --config NONE -o allow_remote_control=y --listen-on unix:/tmp/kitty -o enabled_layout=tall
kovidgoyal commented 10 months ago

Doesnt repro for me on linux, looks like another macOS specific one. Sigh.

mikesmithgh commented 10 months ago

🎉 that fixed it. I'm done torturing you with MacOS issues for now 🙂. Thanks!

kovidgoyal commented 10 months ago

You're welcome and thanks for catching these before the next release. I work on Linux so macOS doesn't get as much testing. Incidentally I traced the problem to on in the glfw macOS backend, https://github.com/kovidgoyal/kitty/commit/ae4a13b2499faad4f2d3a8be66784b8f8a3ba06b