Describe the bug
Pressing any function key above F12 (F13–F24) crashes spotatui with a panic.
I use F13–F24 as global hotkeys in my setup, and when spotatui happens to be the focused window, hitting one of them by accident takes down the whole app instead of being ignored.
The panic comes from Key::from_f in src/tui/event/key.rs, which only maps F0–F12 and panics on anything higher:
// src/tui/event/key.rs
_ => panic!("unknown function key: F{}", n),
crossterm emits KeyCode::F(n) for n up to 24, and the From<KeyEvent> impl forwards every function key into from_f, so F13–F24 hit the panic arm.
To Reproduce
Steps to reproduce the behavior:
- Launch spotatui and keep it focused.
- Press F13 (or any function key F13–F24) — e.g. via a hotkey bound to one of those keys.
- See the app panic:
thread '<unnamed>' panicked at src/tui/event/key.rs:93:12:
unknown function key: F24
Expected behavior
Function keys that aren't bound to anything should be ignored, the same as any other unhandled key — not crash the application.
Screenshots
N/A
Desktop (please complete the following information):
- OS: Linux
- Terminal: kitty + zsh
- Version: 0.40.0
Additional context
Fixed locally by mapping the unmapped range to the existing Key::Unknown catch-all instead of panicking (spotatui binds nothing to F13–F24). Happy to open a PR.
Describe the bug
Pressing any function key above F12 (F13–F24) crashes spotatui with a panic.
I use F13–F24 as global hotkeys in my setup, and when spotatui happens to be the focused window, hitting one of them by accident takes down the whole app instead of being ignored.
The panic comes from
Key::from_finsrc/tui/event/key.rs, which only maps F0–F12 and panics on anything higher:crossterm emits
KeyCode::F(n)fornup to 24, and theFrom<KeyEvent>impl forwards every function key intofrom_f, so F13–F24 hit the panic arm.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Function keys that aren't bound to anything should be ignored, the same as any other unhandled key — not crash the application.
Screenshots
N/A
Desktop (please complete the following information):
Additional context
Fixed locally by mapping the unmapped range to the existing
Key::Unknowncatch-all instead of panicking (spotatui binds nothing to F13–F24). Happy to open a PR.