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

Can't override default keymaps on MacOS #7072

Closed doubledup closed 7 months ago

doubledup commented 7 months ago

Describe the bug Remapping the default keymaps for MacOS doesn't take, eg. cmd+t won't remap to open with cwd.

To Reproduce Steps to reproduce the behavior:

  1. Ensure kitty.conf only contains map cmd+t new_tab_with_cwd.
  2. Restart kitty.
  3. Go to a different directory than the default.
  4. Push cmd+t.
  5. A new tab opens in the default directory instead of the current directory.

Screenshots None.

Environment details

kitty 0.32.0 (eb5dd364ae) created by Kovid Goyal
Darwin Davids-MacBook-Pro.local 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:44 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6000 arm64
ProductName:        macOS ProductVersion:       14.3 BuildVersion:      23D56
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: /opt/homebrew/bin/fish
Loaded config files:
  /Users/daviddunn/.config/kitty/kitty.conf

Config options different from defaults:
Added shortcuts:
    cmd+l →  new_tab_with_cwd
    cmd+o →  new_os_window_with_cwd
Removed shortcuts:
    cmd+, →  edit_config_file
    cmd+enter →  new_window
    cmd+h →  hide_macos_app
    cmd+k →  clear_terminal to_cursor active
    cmd+m →  minimize_macos_window
    cmd+n →  new_os_window
    cmd+q →  quit
    cmd+t →  new_tab
    cmd+w →  close_tab
    ctrl+cmd+, →  load_config_file
    ctrl+cmd+f →  toggle_fullscreen
    opt+cmd+h →  hide_macos_other_apps
    opt+cmd+r →  clear_terminal reset active
    opt+cmd+s →  toggle_macos_secure_keyboard_entry
    shift+cmd+/ →  open_url https://sw.kovidgoyal.net/kitty/
    shift+cmd+[ →  previous_tab
    shift+cmd+] →  next_tab
    shift+cmd+d →  close_window
    shift+cmd+w →  close_os_window

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                               /opt/homebrew/bin/fish
    USER                                daviddunn

Additional context This holds wherever a key combination is used as the default MacOS keymaps. cmd+t and cmd+n don't remap, but cmd+l and cmd+o do. Set kitty.conf to:

map cmd+t new_tab_with_cwd
map cmd+n new_os_window_with_cwd
map cmd+l new_tab_with_cwd
map cmd+o new_os_window_with_cwd

and cmd+t/n won't preserve the current directory, but cmd+l/o will. The env details above were captured with this config, and they show that cmd+t and cmd+n aren't mapped to the *_with_cwd commands.

grddavies commented 7 months ago

I'm also having this issue on Ubuntu with kitty 0.32.1

Repro:

# mini-kitty.conf
map ctrl+shift+s>h launch --location=hsplit

Expected:

Actual:

Environment details:

kitty 0.32.1 (08d88af2fb) created by Kovid Goyal
Linux gethin-motilent 6.5.0-14-generic #14~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Nov 20 18:15:30 UTC 2 x86_64
Ubuntu 22.04.3 LTS gethin-motilent /dev/tty

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.3 LTS"
Running under: X11
Frozen: True
Paths:
  kitty: /home/gethin/.local/kitty.app/bin/kitty
  base dir: /home/gethin/.local/kitty.app/lib/kitty
  extensions dir: /home/gethin/.local/kitty.app/lib/kitty-extensions
  system shell: /home/linuxbrew/.linuxbrew/bin/zsh

Config options different from defaults:

Important environment variables seen by the kitty process:
    PATH                                /home/gethin/.asdf/shims:/home/gethin/.asdf/bin:/home/gethin/.opam/default/bin:/home/gethin/.cabal/bin:/home/gethin/.ghcup/bin:/home/gethin/.cargo/bin:/home/gethin/.local/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
    LANG                                en_GB.UTF-8
    VISUAL                              nvim
    EDITOR                              nvim
    SHELL                               /home/linuxbrew/.linuxbrew/bin/zsh
    DISPLAY                             :1
    USER                                gethin
    XDG_SESSION_TYPE                    x11
    XDG_SESSION_CLASS                   user
    XDG_RUNTIME_DIR                     /run/user/1000
    XDG_MENU_PREFIX                     gnome-
    XDG_CURRENT_DESKTOP                 ubuntu:GNOME
    XDG_SESSION_DESKTOP                 ubuntu
    XDG_DATA_DIRS                       /usr/share/ubuntu:/usr/share/gnome:/home/gethin/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
    XDG_CONFIG_DIRS                     /etc/xdg/xdg-ubuntu:/etc/xdg
    XDG_CONFIG_HOME                     /home/gethin/.config
    XDG_CACHE_HOME                      /home/gethin/.cache
    XDG_DATA_HOME                       /home/gethin/.local/share
    XDG_STATE_HOME                      /home/gethin/.local/state
kovidgoyal commented 7 months ago

dup of #7016 @grddavies different issue https://github.com/kovidgoyal/kitty/commit/8c50632a10f714e6d12054ac137991078b648c6e

doubledup commented 7 months ago

Sorry for the dup, and thanks for the fantastic work!