kovidgoyal / kitty

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

Kitty not focusing windows of opened apps in macOS 14 #6910

Closed nickwynja closed 9 months ago

nickwynja commented 9 months ago

Describe the bug

When clicking a link in kitty or running a command like open https://sw.kovidgoyal.net/kitty/, kitty opens the browser app but in the background, not bringing the window to the front.

I've tried kitty versions back to 0.27.1 and this issue exists in that version on my machine. I feel like something strange is going on here that might be isolated to my machine since I don't see this error reported anywhere else. I've tried running kitty --config NONE and still have this issue.

To Reproduce Steps to reproduce the behavior:

  1. Run open https://sw.kovidgoyal.net/kitty/ in kitty on macOS 14
  2. See command exists ok
  3. Switch to window that opened in background

Video of behavior I'm seeing on kitty:

https://github.com/kovidgoyal/kitty/assets/1012017/b22edd5c-53ad-496f-9702-2ad3fad2cb69

Video of expected behavior I'm seeing in terminal.app:

https://github.com/kovidgoyal/kitty/assets/1012017/e3c1a382-e7b0-4a00-ae40-a38c885133c4

Environment details

kitty 0.31.0 (b247fda672) created by Kovid Goyal
Darwin Mac-2Q0NYJ 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:59:33 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T8112 arm64
ProductName:        macOS ProductVersion:       14.2 BuildVersion:      23C64
Frozen: True
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/nick/.config/kitty/kitty.conf

Config options different from defaults:
active_tab_font_style              (True, False)
allow_remote_control               yes
bell_on_tab                        ●
click_interval                     0.25
confirm_os_window_close            0
cursor_blink_interval              0.0
enable_audio_bell                  False
enabled_layouts                    ['tall', 'splits', 'stack']
font_family                        MonoLisa
font_features:
{'MonoLisa-Bold': ('-dlig', '-liga', '+ss03', '+zero'),
 'MonoLisa-Regular': ('-dlig', '-liga', '+ss03', '+zero'),
 'MonoLisa-RegularItalic': ('-dlig', '-liga')}
hide_window_decorations            1
macos_menubar_title_max_length     32
macos_option_as_alt                3
macos_quit_when_last_window_closed True
macos_show_window_title_in         none
mouse_hide_wait                    -1.0
scrollback_pager                   ['/Users/nick/.dotfiles/bin/scrollb']
shell                              zsh
shell_integration                  frozenset({'disabled'})
single_window_margin_width         FloatEdges(left=2.0, top=0.0, right=2.0, bottom=0.0)
strip_trailing_spaces              smart
tab_bar_style                      separator
tab_separator                      
tab_title_template                   {title}  
touch_scroll_multiplier            0.0
url_style                          1
wheel_scroll_multiplier            0.0
window_alert_on_bell               False
Added shortcuts:
    cmd+\ →  goto_tab -1
    cmd+b →  launch --copy-colors --type tab ~/.dotfiles/kitty/switch.sh
    ctrl+\ →  nth_window -1
    ctrl+h →  kitten pass_keys.py neighboring_window left   ctrl+h
    ctrl+j →  kitten pass_keys.py neighboring_window bottom ctrl+j
    ctrl+k →  kitten pass_keys.py neighboring_window top    ctrl+k
    ctrl+l →  kitten pass_keys.py neighboring_window right  ctrl+l
    ctrl+z →  toggle_layout stack
    opt+enter →  combine : nth_window -1 : send_text all \r : nth_window -1
    opt+j →  combine : nth_window -1 : send_text all j : nth_window -1
    opt+k →  combine : nth_window -1 : send_text all k : nth_window -1
    shift+cmd+b →  launch --title views --copy-colors --type tab ~/.dotfiles/kitty/view.sh
    shift+cmd+e →  launch --type overlay zsh -c "echo 'enter event: (event description, natural datetime, optional duration)'; read INPUT; ~/.dotfiles/bin/event $INPUT;"
    shift+cmd+f →  combine : launch --type background --copy-env hl "@selection" : clear_selection
    shift+cmd+g →  launch --type overlay ~/.dotfiles/kitty/views/gmail.sh
    shift+cmd+h →  show_scrollback
    shift+cmd+j →  scroll_line_down
    shift+cmd+k →  scroll_line_up
    shift+cmd+left →  resize_window narrower
    shift+cmd+m →  launch --type overlay ~/.dotfiles/kitty/views/mutt.sh
    shift+cmd+right →  resize_window wider
    shift+cmd+s →  launch --type overlay zsh ~/.dotfiles/bin/yinyang
    shift+cmd+t →  launch --type tab --title twin zsh ~/.dotfiles/taskwarrior/in.sh
    shift+cmd+u →  scroll_page_up
Changed shortcuts:
    cmd+enter →  launch --cwd current
    kitty_mod+down →  resize_window shorter 3
    kitty_mod+j →  layout_action rotate 270
    kitty_mod+up →  resize_window taller
Colors:
    active_border_color                #414141   
    active_tab_background              #202020   
    active_tab_foreground              #f0f0f0   
    background                         #202020   
    color0                             #202020   
    color1                             #c30670   
    color10                            #5ed6ae   
    color11                            #f3e42f   
    color12                            #20bafb   
    color13                            #6854de   
    color14                            #4fb8cc   
    color15                            #f0f0f0   
    color155                           #d9d9d9   
    color2                             #10a778   
    color255                           #414141   
    color3                             #a79c14   
    color4                             #008ec4   
    color5                             #523b78   
    color6                             #20a4b9   
    color7                             #c6c6c6   
    color8                             #414141   
    color9                             #fb0079   
    cursor                             #20bafb   
    foreground                         #f0f0f0   
    inactive_border_color              #414141   
    inactive_tab_background            #414141   
    inactive_tab_foreground            #f0f0f0   
    selection_background               #b6d6fc   
    selection_foreground               #202020   
    tab_bar_background                 #414141   

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                                nick

Additional context Try to reproduce the problem with kitty --config NONE if you cannot then post a minimal kitty.conf that reproduces the problem. If the problem involves interaction with some other terminal program post a minimal config for that program to reproduce the problem as well.

kovidgoyal commented 9 months ago

you have got secure text entry enabled, disabled it.

nickwynja commented 9 months ago

Thank you!

nickwynja commented 9 months ago

If anybody coming across this uses starship for their prompt, I created a custom prompt command to show when this is turned on:

[custom.kittySecure]
command = 'printf "secure input enabled"'
style = "red"
when = "ioreg -k IOConsoleUsers -w 0 | grep SecureInput"
shell = ["bash", "--noprofile", "--norc"]