Skip to content

On wayland, "notify_on_cmd_finish invisible" still sends notification even if the terminal window is visible #8320

Description

@xuhdev

Describe the bug
On wayland, when a long-time command finishes, "notify_on_cmd_finish invisible" still sends notification even if the Kitty terminal window is visible, as long as the terminal window doesn't have focus.

To Reproduce
Steps to reproduce the behavior:

  1. Start kitty with kitty -c kitty.conf, with kitty.conf only containing:
    notify_on_cmd_finish invisible 3
    
  2. In this started terminal, execute sleep 5.
  3. Quickly change focus to another OS window.
  4. Wait for 5 seconds, the notification kicks in.

Screenshots

output.mp4

Environment details

This is from the kitty window that was started with kitty -c kitty.conf:

kitty 0.39.1 created by Kovid Goyal
Linux home 6.12.11-200.fc41.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jan 24 04:59:58 UTC 2025 x86_64
S
Kernel 6.12.11-200.fc41.x86_64 on an x86_64 (/dev/tty)

Running under: Wayland (GNOME Shell 47.4) missing: layer_shell
OpenGL: '4.6 (Core Profile) Mesa 24.3.4' Detected version: 4.6
Frozen: False
Fonts:
  medium: InconsolataGoNFM: /home/hong/.fonts/InconsolataGoNerdFontMono-Regular.ttf:0
          Features: ()
    bold: InconsolataGoNFM-Bold: /home/hong/.fonts/InconsolataGoNerdFontMono-Bold.ttf:0
          Features: ()
  italic: InconsolataGoNFM-Bold: /home/hong/.fonts/InconsolataGoNerdFontMono-Bold.ttf:0
          Features: ()
      bi: InconsolataGoNFM-Bold: /home/hong/.fonts/InconsolataGoNerdFontMono-Bold.ttf:0
          Features: ()
Paths:
  kitty: /usr/bin/kitty
  base dir: /usr/lib64/kitty
  extensions dir: /usr/lib64/kitty/kitty
  system shell: /bin/zsh
System color scheme: dark. Applied color theme type: none
Loaded config files:
  kitty.conf

Config options different from defaults:
notify_on_cmd_finish NotifyOnCmdFinish(when='invisible', duration=3.0, action='notify', cmdline=(), clear_on=('focus', 'next'))

Important environment variables seen by the kitty process:
	PATH                                /home/hong/.nvm/versions/node/v22.13.1/bin:/home/hong/.local/share/pnpm:/home/hong/.local/bin:/home/hong/.cargo/bin:/home/hong/.cache/antidote/xuhdev/my-zsh-plugins/paulirish/git-open:/home/hong/.cache/antidote/xuhdev/my-zsh-plugins/wofr06/lesspipe:/home/hong/.local/opt/emacs/bin:/usr/lib64/ccache:/home/hong/.cargo/bin:/home/hong/go/bin:/home/hong/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin
	LANG                                en_US.UTF-8
	VISUAL                              /home/hong/.local/bin/e
	EDITOR                              /home/hong/.local/bin/e
	SHELL                               /bin/zsh
	DISPLAY                             :0
	WAYLAND_DISPLAY                     wayland-0
	USER                                hong
	XDG_DATA_DIRS                       /home/hong/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/
	XDG_RUNTIME_DIR                     /run/user/1000
	XDG_CURRENT_DESKTOP                 GNOME
	XDG_MENU_PREFIX                     gnome-
	XDG_SESSION_CLASS                   user
	XDG_SESSION_DESKTOP                 gnome
	XDG_SESSION_TYPE                    wayland

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions