Skip to content

Add support for cmd+ keybinds on macOS #653

@xerebz

Description

@xerebz

Summary

Currently, opencode only supports ctrl+, alt+, and shift+ key combinations in keybinds. On macOS, users expect to use the Command key (cmd+) for shortcuts, but this is not currently supported.

Current Behavior

  • Keybinds like "cmd+p" in config are ignored/don't work
  • Only ctrl+, alt+, and shift+ combinations work
  • This forces Mac users to use ctrl+ which is a different physical key than the expected Command key

Expected Behavior

  • cmd+ keybinds should work on macOS (e.g., "cmd+p", "cmd+n")
  • This would match standard macOS conventions where Command key is used for shortcuts

Technical Details

The issue appears to be in the TUI's key handling (Bubble Tea v2), where the Keybinding.Matches function compares key strings with msg.String(). The current codebase only shows examples of ctrl+, alt+, and shift+ combinations.

Use Case

Mac users naturally expect cmd+p to work for navigation shortcuts, similar to how cmd+c works for copy in other Mac applications.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions