Skip to content

Platform-specific key-hint formatting for TUI #4914

@kgruiz

Description

@kgruiz

What feature would you like to see?

Add platform-specific key-hint formatting in the TUI for clearer, more consistent shortcut display.

Proposal

  • Keep all keybindings and Windows/Linux behavior unchanged.

  • On macOS:

    • Include Fn+Arrow alternatives for compact keyboards (MacBook, Magic Keyboard):

      • Page Up (Fn+↑)
      • Page Down (Fn+↓)
      • Home (Fn+←)
      • End (Fn+→)
    • Update modifier labels and symbols to follow macOS conventions (e.g., ⌃, ⌥, ⇧).

      • If the standard symbols are displayed, the full key names (like “Control” or “Option”) can optionally be omitted for a cleaner, Apple-style appearance.

Implementation route I took

  • Add cfg(target_os = "macos") handling in the key-hint utility.
  • Map macOS modifiers to Apple symbols (⌃, ⌥, ⇧).
  • Append Fn+Arrow notes for Page Up, Page Down, Home, and End on macOS.
  • Keep Windows and Linux rendering unchanged.
  • Verify output and update snapshots to confirm platform consistency.

Goal
Match native platform conventions and improve clarity for macOS users, especially those on compact keyboards.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions