1jehuang / 1jehuang/jcode

Default `Cmd+;` launch hotkey conflicts with macOS app conventions; no easy in-app way to disable

Open
#670 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

autonomous: likely bug priority: medium triage: reproducible
Dominant language
Rust
Stars
19.9k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
30

Description

Summary

jcode installs Cmd+; as a default global launch hotkey (mapped to $HOME) on macOS, but this chord is conventionally used for settings/preferences in many macOS apps. There is no in-app way to release Cmd+; without manually editing config or unloading the LaunchAgent.

Where this is wired

  • Default entry: crates/jcode-setup-hints/src/launch_hotkeys.rs:138cmd+;$HOME.
  • Config schema: crates/jcode-config-types/src/lib.rs:1630LaunchHotkeysConfig { enabled: Option<bool>, entries: Vec<LaunchHotkeyEntry>, imported: bool }.
  • macOS launch agent: ~/Library/LaunchAgents/com.jcode.hotkey.plist (crates/jcode-setup-hints/src/lib.rs:386).

Problems

  1. Default chord collision. Cmd+; is widely used as a settings shortcut. Registering it system-wide via RegisterEventHotKey makes it unavailable to other apps the user may launch, and conflicts with muscle memory.

  2. No in-app opt-out. Disabling the hotkey today requires either:

    • editing ~/.jcode/config.toml to drop the entry from [launch_hotkeys].entries, or
    • manually running launchctl unload ~/Library/LaunchAgents/com.jcode.hotkey.plist and deleting the plist.

    Neither is discoverable, and neither survives a future jcode run that re-runs the install path.

  3. [launch_hotkeys].enabled = false is honored only on Linux and Windows. The macOS install path in crates/jcode-setup-hints/src/lib.rs (around install_macos_hotkey_listener) does not gate on the enabled flag. Linux checks it at lib.rs:2570, and Windows bails when false at windows_setup.rs:259. So setting enabled = false on macOS leaves the hotkey active until the user manually unloads launchd.

Suggested fixes (pick any, not all)

  • Honor enabled on macOS too. Gate the macOS install path on load_launch_hotkeys_config().enabled, mirroring the Linux path. When false, unload ~/Library/LaunchAgents/com.jcode.hotkey.plist and skip rewriting it.
  • Surface in TUI. Add a /hotkeys (or similar) command that lists the active chords, lets the user disable one, and persists the change. Today the only mention of cmd+; in the UI is a startup notice (see crates/jcode-tui/src/tui/app/tests/remote_events_reload_01/part_01.rs:1872).
  • Pick less collision-prone defaults. Cmd+; is the conventional settings chord on macOS; consider a different default (e.g. Cmd+Alt+J, Cmd+J, or leave it unmapped and let auto-import set it once the user has session history). This also affects Linux/Windows since the default flows through resolve_launch_hotkeys.

Reproduction

  1. Install jcode on macOS.
  2. Observe ~/Library/LaunchAgents/com.jcode.hotkey.plist is written on first launch.
  3. Press Cmd+; — a new jcode window opens in $HOME, stealing the chord from any other app expecting it for settings.
  4. Set [launch_hotkeys] enabled = false in ~/.jcode/config.toml, restart jcode — Cmd+; still fires. Manual launchctl unload is required.

Environment

  • jcode v0.64.0 (24d3460f9)
  • macOS aarch64

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with crates/jcode-setup-hints/src/launch_hotkeys.rs:138, the LaunchHotkeysConfig schema in crates/jcode-config-types/src/lib.rs:1630, and the macOS install path around install_macos_hotkey_listener in crates/jcode-setup-hints/src/lib.rs. Review the startup notice test at crates/jcode-tui/src/tui/app/tests/remote_events_reload_01/part_01.rs:1872 and verify the selected fix covers macOS enabled-state handling, opt-out behavior, or default-key changes without leaving the LaunchAgent active.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, rust
Domain
cli, desktop-dev, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.