Skip to content

feat(tui): allow function keys through f24 in keymaps#25329

Merged
fcoury-oai merged 1 commit into
mainfrom
codex/f13-keymap
May 31, 2026
Merged

feat(tui): allow function keys through f24 in keymaps#25329
fcoury-oai merged 1 commit into
mainfrom
codex/f13-keymap

Conversation

@fcoury-oai
Copy link
Copy Markdown
Contributor

Why

Closes #25006.

tui.keymap currently rejects F13 even though Codex's terminal event layer can report higher function keys. This prevents users from using common remappings such as Caps Lock to F13.

What Changed

  • Define a shared portable upper bound of F24 for stored TUI keybindings.
  • Accept f13 through f24 in config normalization and runtime parsing.
  • Allow /keymap capture to persist F13 through F24.
  • Update the unsupported-function-key error and add boundary tests for F13, F24, and F25.

How to Test

  1. Add a binding such as:

    [tui.keymap.global]
    open_transcript = "f13"
  2. Start Codex and press the remapped F13 key.

  3. Confirm Codex loads the config without the previous F1 through F12 error and the action runs.

  4. Open /keymap, capture F13 for an action, and confirm the saved binding is f13.

  5. As a regression check, try to capture F25 and confirm Codex reports that only F1 through F24 can be stored.

Targeted tests:

  • just test -p codex-config
  • just test -p codex-tui function_keys

Full just test -p codex-tui completed with 2,752 passing tests, 4 skipped tests, and two unrelated guardian feature-flag failures:

  • app::tests::update_feature_flags_disabling_guardian_clears_review_policy_and_restores_default
  • app::tests::update_feature_flags_disabling_guardian_clears_manual_review_policy_without_history

@fcoury-oai fcoury-oai marked this pull request as ready for review May 30, 2026 21:05
Copy link
Copy Markdown
Collaborator

@etraut-openai etraut-openai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good.

I tested locally and confirmed that it worked with terminals that support these extended function keys and that there aren't any issues with terminals that don't support them.

@fcoury-oai fcoury-oai merged commit 2f0726a into main May 31, 2026
31 checks passed
@fcoury-oai fcoury-oai deleted the codex/f13-keymap branch May 31, 2026 18:42
@github-actions github-actions Bot locked and limited conversation to collaborators May 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keymaps with F13

2 participants