Overview
WezTerm allows you to customize keyboard shortcuts through thekeys configuration option in your .wezterm.lua file. You can override default assignments, add new bindings, or disable existing ones.
Basic Key Binding Configuration
Key bindings are defined in theconfig.keys table:
Modifier Keys
The following modifier keys are supported:modifier
On macOS:
Command key. On Windows: Windows key. On Linux: Super or Hyper key.modifier
The Control key. Left and right are equivalent.
modifier
The Shift key. Left and right are equivalent.
modifier
On macOS:
Option key. On other systems: Alt or Meta key.modifier
A special modal modifier state. See Leader Key below.
| symbol:
Key Codes
Thekey value can be:
- A single character:
'a','1','=', etc. - Special keys:
Enter,Tab,Backspace,Delete,Escape,PageUp,PageDown,Home,End - Arrow keys:
LeftArrow,RightArrow,UpArrow,DownArrow - Function keys:
F1throughF24 - Numpad keys:
Numpad0throughNumpad9,Multiply,Add,Subtract,Divide - Media keys:
VolumeUp,VolumeDown,VolumeMute,MediaPlayPause,MediaNextTrack,MediaPrevTrack
Physical vs Mapped Keys
WezTerm supports two ways to reference keys:Physical Keys
Physical keys reference the physical position on an ANSI US keyboard:Mapped Keys
Mapped keys reference the character produced after keyboard layout mapping:Key Map Preference
Control the default behavior withkey_map_preference:
Disabling Default Bindings
You can disable default key bindings:Leader Key
The leader key enables tmux-style key bindings with a prefix:The leader key must be pressed within
timeout_milliseconds before the next key.