kovidgoyal / kitty

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

`macos_hide_from_tasks` breaks after hiding Kitty in macOS 15.0.1 #8000

Closed jannis-baum closed 1 week ago

jannis-baum commented 1 week ago

Describe the bug

macos_hide_from_tasks yes initially works but breaks/is ignored when Kitty is hidden (cmd+h) and then brought back to the foreground. I didn't have this problem before upgrading to macOS 15.0.1 from macOS 14.6.x.

To Reproduce Steps to reproduce the behavior:

  1. Clear out config, set only option macos_hide_from_tasks yes
  2. Start Kitty, which is initially "hidden from tasks" as expected
  3. Press cmd+h to hide Kitty
  4. Use Spotlight or open /Applications/kitty.app to unhide Kitty and bring it back to the foreground
  5. Kitty now shows up in the dock and the app switcher (cmd+tab)

Environment details

kitty 0.36.4 (c127517c96) created by Kovid Goyal
Darwin Jannis-MacBook-Pro.local 24.0.0 Darwin Kernel Version 24.0.0: Tue Sep 24 23:37:36 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T6020 arm64
ProductName:        macOS ProductVersion:       15.0.1 BuildVersion:        24A348
OpenGL: '4.1 Metal - 89.3' Detected version: 4.1
Frozen: True
Fonts:
  medium: Menlo-Regular: /System/Library/Fonts/Menlo.ttc
          Features: ()
    bold: Menlo-Bold: /System/Library/Fonts/Menlo.ttc
          Features: ()
  italic: Menlo-Italic: /System/Library/Fonts/Menlo.ttc
          Features: ()
      bi: Menlo-BoldItalic: /System/Library/Fonts/Menlo.ttc
          Features: ()
Paths:
  kitty: /Applications/kitty.app/Contents/MacOS/kitty
  base dir: /Applications/kitty.app/Contents/Resources/kitty
  extensions dir: /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions
  system shell: /bin/zsh
Loaded config files:
  /Users/jannisbaum/.config/kitty/kitty.conf

Config options different from defaults:
macos_hide_from_tasks True
Changed shortcuts:
    cmd+k →  clear_terminal_and_scrollback
    ctrl+cmd+, →  reload_config
    opt+cmd+r →  reset_terminal
    shift+cmd+/ →  open_kitty_website

Important environment variables seen by the kitty process:
    PATH                                /Applications/kitty.app/Contents/MacOS:/usr/bin:/bin:/usr/sbin:/sbin
    LANG                                en_US.UTF-8
    SHELL                               /bin/zsh
    USER                                jannisbaum
kovidgoyal commented 1 week ago

All that option does is set the application activation policy in cocoa. Grep the code of cocoa_set_activation_policy() it is a one-liner.

If macOS 15 is not respecting that after an unhide, then you should report the issue to Apple, I don't see what kitty can do here.