pub fn key_to_pane_command(
key: &KeyEvent,
resize_units: u16,
) -> Option<PaneCommand>Expand description
Translate a raw terminal key event into a canonical PaneCommand.
Returns None for key release events and for any key not in the default
pane keymap (so the host passes those through to the application). The
keymap is intentionally modifier-qualified to avoid stealing plain keys:
| Key | Command |
|---|---|
Tab / Shift+Tab | FocusNext / FocusPrevious |
Ctrl+Arrow | FocusDirectional |
Ctrl+Shift+Arrow | FocusEdge |
Alt+Arrow | MovePane |
Alt++ / Alt+- | ResizeStep grow / shrink |
Alt+s / Alt+v | Split horizontal / vertical |
Alt+w | Close |
Alt+[ / Alt+] | SwapPane previous / next |
Alt+z / Alt+r | Maximize / Restore |
resize_units is the snap-step count for ResizeStep (computed by the
caller via PaneCommandAcceleration); it is ignored for other commands.