jtroo / kanata

Improve keyboard comfort and usability with advanced customization
GNU Lesser General Public License v3.0
3.05k stars 127 forks source link

Bug: Kanata crashes and is unable to start on macOS if sidecar is on #1342

Open PresidentialAnt opened 1 week ago

PresidentialAnt commented 1 week ago

Requirements

Describe the bug

Turning on Sidecar (connecting wirelessly to an iPad as an external display) while Kanata is running will cause Kanata to crash with the error zsh: trace trap sudo ./myPrograms/kanata_macos_cmd_allowed_arm64 -c.

note: I start kanata by runningsudo ./myPrograms/kanata_macos_cmd_allowed_arm64 -c ~/.config/kanata/kanata.kbd

Attempting to restart Kanata while connected to Sidecar fails with the same error.

Kanata is able to restart after disconnecting from Sidecar.

Relevant kanata config

(defcfg
  danger-enable-cmd yes
)

(defsrc
  esc
  f1   f2   f3   f4   f5   f6   f7   f8   f9   f10  f11  f12
  1 2 3 4 5 6 7 8 9 0 - = bspc
  caps
  lsft
  rsft
  ralt
  f
  x
  grv
  c
  e
  w
  z

)

(defalias
  escctrl (tap-hold-press 0 150 esc (layer-toggle two))
  term (cmd open -n -a Alacritty)
  floorp (cmd open -a Floorp)
  finder (cmd open /Users/username)
  code (cmd open -a "Visual Studio Code")
  outlook (cmd open -a "Microsoft Outlook")
  whatsapp (cmd open -a WhatsApp)
  zotero (cmd open -a Zotero)

)

(deflayer base
  esc
  πŸ”…   πŸ”†    C-A-ArrowUp    C-1    C-2    C-3    β—€β—€   ▢⏸   β–Άβ–Ά   πŸ”‡   πŸ”‰   πŸ”Š
  1 2 3 4 5 6 7 8 9 0 - = bspc
  @escctrl
  lsft
  rsft
  rctl
  f
  x
  grv
  c
  e
  w
  z
)

(deflayer two
  del
  f1   f2   f3   f4   f5   f6   f7   f8   f9   f10  f11  f12
  kp1 kp2 kp3 kp4 kp5 kp6 kp7 kp8 kp9 kp0 kp- kp+ nlck
  @escctrl
  caps
  caps
  rctl
  @floorp
  @finder
  @term
  @code
  @outlook
  @whatsapp
  @zotero
)

To Reproduce

  1. Start Kanata
  2. Connect to Sidecar
  3. Try to restart Kanata
  4. Disconnect from Sidecar
  5. Restart Kanata

Expected behavior

Kanata to function regardless of sidecar connectivity.

Kanata version

kanata 1.7.0

Debug logs

No response

Operating system

macOS

Additional context

No response

jteng2127 commented 1 week ago

Same here, I'm on macOS 14.6.1 with kanata 1.7.0

The full log is here

❯ sudo kanata -c kanata.kbd
16:12:41.3765 [INFO] kanata v1.7.0 starting
16:12:41.3768 [WARN] No defcfg is defined. Consider whether the process-unmapped-keys defcfg option should be yes vs. no. Adding defcfg with process-unmapped-keys defined will remove this warning.
16:12:41.3768 [INFO] process unmapped keys: false
16:12:41.3769 [INFO] NOTE: kanata was compiled to never allow cmd
16:12:41.3775 [INFO] config file is valid
16:12:41.3775 [INFO] Sleeping for 2s. Please release all keys and don't press additional ones. Run kanata with --help to see how understand more and how to disable this sleep.
16:12:43.3826 [INFO] entering the processing loop
16:12:43.3829 [INFO] entering the event loop
16:12:43.3830 [INFO] Init: catching only releases and sending immediately
zsh: trace trap  sudo kanata -c kanata.kbd
infely commented 4 days ago

Same here. I'm on macOS 15.1/15.2 with kanata 1.7.0

This bug makes kanata completely unusable with the Vision Pro

sgript commented 4 days ago

Same issue on 1.7.0 MacOS 15.1