Unable to launch kitty (from keybinding) after resuming from suspend
fedepau opened this issue · 4 comments
Describe the bug
I am using sway on Arch Linux. No issues with kitty on a freshly booted system. If I get it to suspend and then resume, and I press the keybind for kitty, the terminal appears for an instant before disappearing.
To Reproduce
Steps to reproduce the behavior:
- Boot pc.
- Suspend.
- Resume from suspend.
- Press keybinding for kitty.
Screenshots
N.A.
Environment details
kitty 0.37.0 created by Kovid Goyal
Linux ouroboros 6.11.10-hardened1-1-hardened #1 SMP PREEMPT_DYNAMIC Tue, 26 Nov 2024 17:15:06 +0000 x86_64
S{PRETTY_NAME} 6.11.10-hardened1-1-hardened (/dev/tty)
Running under: Wayland (sway version 1.10) missing: blur
OpenGL: '3.3 (Core Profile) Mesa 24.2.7-arch1.1' Detected version: 3.3
Frozen: False
Fonts:
medium: JetBrainsMonoNLNFM-Regular: /usr/share/fonts/TTF/JetBrainsMonoNLNerdFontMono-Regular.ttf:0
Features: ()
bold: JetBrainsMonoNLNFM-SemiBold: /usr/share/fonts/TTF/JetBrainsMonoNLNerdFontMono-SemiBold.ttf:0
Features: ()
italic: JetBrainsMonoNLNFM-Italic: /usr/share/fonts/TTF/JetBrainsMonoNLNerdFontMono-Italic.ttf:0
Features: ()
bi: JetBrainsMonoNLNFM-SemiBoldItalic: /usr/share/fonts/TTF/JetBrainsMonoNLNerdFontMono-SemiBoldItalic.ttf:0
Features: ()
Paths:
kitty: /usr/bin/kitty
base dir: /usr/lib/kitty
extensions dir: /usr/lib/kitty/kitty
system shell: /usr/bin/zsh
Loaded config files:
/home/sh4k0/.config/kitty/kitty.conf
Config options different from defaults:
background_opacity 0.9
cursor_stop_blinking_after 0
font_family JetBrainsMonoNL Nerd Font Mono
font_size 8.0
tab_bar_style custom
Colors:
background #282828
color0 #282828
color1 #cc241d
color10 #b8bb26
color11 #fabd2f
color12 #83a598
color13 #d3869b
color14 #8ec07c
color15 #928374
color2 #98971a
color3 #d79921
color4 #689d6a
color5 #b16286
color6 #689d6a
color7 #a89984
color8 #665c54
color9 #fb4934
cursor #fbf1c7
cursor_text_color #32302f
foreground #ebdbb2
selection_background #3c3836
selection_foreground #928374
url_color #fe8019
Important environment variables seen by the kitty process:
PATH /usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
LANG it_IT.UTF-8
SHELL /usr/bin/zsh
DISPLAY :0
WAYLAND_DISPLAY wayland-1
USER sh4k0
XCURSOR_SIZE 24
XDG_CONFIG_DIRS /etc/xdg
XDG_DATA_HOME /home/sh4k0/.local/share
XDG_CONFIG_HOME /home/sh4k0/.config
XDG_SEAT seat0
XDG_SESSION_TYPE wayland
XDG_CACHE_HOME /home/sh4k0/.cache
XDG_SESSION_CLASS user
LC_MESSAGES en_US.UTF-8
XDG_VTNR 2
XDG_SESSION_ID c1
XDG_STATE_HOME /home/sh4k0/.local/state
XDG_RUNTIME_DIR /run/user/1000
XDG_DATA_DIRS /usr/local/share:/usr/share
Additional context
- If I suspend with a terminal window opened, it functions properly after resuming, allowing me to launch kitty from the terminal. If I do so, I get this in stdout (although I'm not sure it is relevant).
Traceback (most recent call last):
File "/usr/bin/../lib/kitty/kitty/tab_bar.py", line 456, in load_custom_draw_tab
m = runpy.run_path(os.path.join(config_dir, 'tab_bar.py'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen runpy>", line 286, in run_path
File "<frozen runpy>", line 254, in _get_code_from_file
FileNotFoundError: [Errno 2] No such file or directory: '/home/sh4k0/.config/kitty/tab_bar.py'
[0,200] Failed to load custom draw_tab function with error: [Errno 2] No such file or directory: '/home/sh4k0/.config/kitty/tab_bar.py'
- I am using relatively old hardware. Could this be the cause of the issue?
$ eglinfo -B
:
Wayland platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES
OpenGL core profile vendor: Intel
OpenGL core profile renderer: Mesa Intel(R) HD Graphics 3000 (SNB GT2)
OpenGL core profile version: 3.3 (Core Profile) Mesa 24.2.7-arch1.1
OpenGL core profile shading language version: 3.30
OpenGL compatibility profile vendor: Intel
OpenGL compatibility profile renderer: Mesa Intel(R) HD Graphics 3000 (SNB GT2)
OpenGL compatibility profile version: 3.3 (Compatibility Profile) Mesa 24.2.7-arch1.1
OpenGL compatibility profile shading language version: 3.30
OpenGL ES profile vendor: Intel
OpenGL ES profile renderer: Mesa Intel(R) HD Graphics 3000 (SNB GT2)
OpenGL ES profile version: OpenGL ES 3.0 Mesa 24.2.7-arch1.1
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.00
X11 platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES
OpenGL core profile vendor: Intel
OpenGL core profile renderer: Mesa Intel(R) HD Graphics 3000 (SNB GT2)
OpenGL core profile version: 3.3 (Core Profile) Mesa 24.2.7-arch1.1
OpenGL core profile shading language version: 3.30
OpenGL compatibility profile vendor: Intel
OpenGL compatibility profile renderer: Mesa Intel(R) HD Graphics 3000 (SNB GT2)
OpenGL compatibility profile version: 3.3 (Compatibility Profile) Mesa 24.2.7-arch1.1
OpenGL compatibility profile shading language version: 3.30
OpenGL ES profile vendor: Intel
OpenGL ES profile renderer: Mesa Intel(R) HD Graphics 3000 (SNB GT2)
OpenGL ES profile version: OpenGL ES 3.0 Mesa 24.2.7-arch1.1
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.00
This will almost certainly be a GPU driver issue. Suspend on Linux is
pretty badly broken. Open another non-GPU terminal and run kitty from
there and you will get an error message that will hopefully tell you
more.
I am using an integrated Intel graphics card with the mesa driver, which is knowingly pretty reliable. I also tried invoking kitty from a non-gpu terminal (st) and saw no difference in the output posted above. Repasting it here:
Traceback (most recent call last):
File "/usr/bin/../lib/kitty/kitty/tab_bar.py", line 456, in load_custom_draw_tab
m = runpy.run_path(os.path.join(config_dir, 'tab_bar.py'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen runpy>", line 286, in run_path
File "<frozen runpy>", line 254, in _get_code_from_file
FileNotFoundError: [Errno 2] No such file or directory: '/home/sh4k0/.config/kitty/tab_bar.py'
[0.305] Failed to load custom draw_tab function with error: [Errno 2] No such file or directory: '/home/sh4k0/.config/kitty/tab_bar.py'
[0.333] [glfw error 65544]: Notify: Failed to get server capabilities error: [org.freedesktop.DBus.Error.ServiceUnknown] The name is not activatable
I also tried diffing the pre/post environments (thinking this might be a Wayland-linked issue), but saw no difference. Do you have any further suggestions in investigating the issue?
Then look in the log of whatever program is interpreting your keybinding for errors from the kitty process that is failing. Or write a wrapper script to run kitty that saves its stdout/stderr to a log file and use that in your keybinding.
While following your suggestion, I somehow managed to fix the issue by redirecting the stdout/stderr of kitty to /dev/null. In my particular case (invoking kitty from keybinding in sway), this line in my sway config fixes the issue entirely:
set $term "kitty > /dev/null 2>&1"
I honestly have no idea why simply redirecting stdout/stderr fixes this particular issue, but I will stick to this solution for the time being. Thank you for your help!