> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/wezterm/wezterm/llms.txt
> Use this file to discover all available pages before exploring further.

# wezterm show-keys

> Display key bindings and assignments configured in WezTerm

The `show-keys` command displays the key assignments configured in your WezTerm instance, making it easy to discover and document your keyboard shortcuts.

## Synopsis

```bash theme={null}
wezterm show-keys [OPTIONS]
```

## Description

Displays all key bindings configured in your WezTerm configuration. This is useful for:

* Discovering what key bindings are available
* Debugging key binding conflicts
* Generating documentation for your configuration
* Exporting key bindings in Lua format

## Options

<ParamField path="--lua" type="flag">
  Show the keys as Lua config statements.

  Instead of a human-readable table, outputs valid Lua code that can be used in your `wezterm.lua` configuration file.

  **Example:**

  ```bash theme={null}
  wezterm show-keys --lua
  ```
</ParamField>

<ParamField path="--key-table" type="string">
  In Lua mode, show only the named key table.

  WezTerm supports multiple key tables for different modes (like tmux's prefix key). Use this option to show bindings for a specific table.

  **Requires:** `--lua` flag

  **Example:**

  ```bash theme={null}
  wezterm show-keys --lua --key-table copy_mode
  ```
</ParamField>

## Examples

### Show all key bindings

```bash theme={null}
wezterm show-keys
```

Output will show a table like:

```
Key Assignments:

CTRL+SHIFT+T  -> SpawnTab(CurrentPaneDomain)
CTRL+SHIFT+N  -> SpawnWindow
CTRL+SHIFT+W  -> CloseCurrentTab{confirm=true}
...
```

### Export key bindings as Lua

```bash theme={null}
wezterm show-keys --lua
```

Output will be valid Lua code:

```lua theme={null}
return {
  keys = {
    {
      key = 't',
      mods = 'CTRL|SHIFT',
      action = wezterm.action.SpawnTab 'CurrentPaneDomain',
    },
    {
      key = 'n',
      mods = 'CTRL|SHIFT',
      action = wezterm.action.SpawnWindow,
    },
    -- ...
  },
}
```

### Show specific key table

```bash theme={null}
wezterm show-keys --lua --key-table copy_mode
```

This shows only the key bindings for copy mode.

### Save key bindings to a file

```bash theme={null}
wezterm show-keys --lua > my-keys.lua
```

### Check for specific binding

```bash theme={null}
wezterm show-keys | grep "CTRL+SHIFT+C"
```

### Compare key bindings between configs

```bash theme={null}
# Save current bindings
wezterm show-keys > keys-current.txt

# Modify config, then compare
wezterm show-keys > keys-new.txt
diff keys-current.txt keys-new.txt
```

## Understanding Key Tables

WezTerm supports multiple key tables for modal key bindings. Common key tables include:

* **Default table:** Active by default
* **copy\_mode:** Active when in copy/search mode
* **search\_mode:** Active when searching
* **Custom tables:** You can define your own

### Example with key tables in wezterm.lua:

```lua theme={null}
local wezterm = require 'wezterm'
local act = wezterm.action

return {
  leader = { key = 'a', mods = 'CTRL', timeout_milliseconds = 1000 },
  
  keys = {
    -- Default key table
    {
      key = 'c',
      mods = 'LEADER',
      action = act.ActivateKeyTable {
        name = 'copy_mode',
        one_shot = false,
      },
    },
  },
  
  key_tables = {
    copy_mode = {
      { key = 'Escape', action = act.CopyMode 'Close' },
      { key = 'q', action = act.CopyMode 'Close' },
      { key = 'h', action = act.CopyMode 'MoveLeft' },
      { key = 'j', action = act.CopyMode 'MoveDown' },
      { key = 'k', action = act.CopyMode 'MoveUp' },
      { key = 'l', action = act.CopyMode 'MoveRight' },
    },
  },
}
```

Then inspect just the copy\_mode table:

```bash theme={null}
wezterm show-keys --lua --key-table copy_mode
```

## Common Key Binding Modifiers

* `CTRL` - Control key
* `SHIFT` - Shift key
* `ALT` - Alt/Option key
* `SUPER` - Windows/Command key
* `LEADER` - Leader key (if configured)

Modifiers can be combined with `|`:

* `CTRL|SHIFT`
* `CTRL|ALT`
* `SUPER|SHIFT`

## Use Cases

### Documentation

Generate documentation for your team:

```bash theme={null}
wezterm show-keys > team-shortcuts.txt
```

### Debugging Conflicts

If a key binding isn't working:

```bash theme={null}
wezterm show-keys | grep -i "ctrl.*t"
```

This helps identify if the key is bound to something else.

### Configuration Backup

Before making changes:

```bash theme={null}
wezterm show-keys --lua > backup-keys.lua
```

### Learning Default Bindings

If you haven't customized your config yet:

```bash theme={null}
wezterm show-keys
```

This shows all default WezTerm key bindings.

### Sharing Configuration

Export your key bindings to share with others:

```bash theme={null}
wezterm show-keys --lua | grep -A 10 "my custom bindings"
```

## Default Key Bindings

WezTerm comes with sensible defaults. Some common ones include:

* `CTRL+SHIFT+T` - New tab
* `CTRL+SHIFT+N` - New window
* `CTRL+SHIFT+W` - Close tab
* `CTRL+SHIFT+C` - Copy (when text is selected)
* `CTRL+SHIFT+V` - Paste
* `CTRL+SHIFT+F` - Search
* `CTRL+SHIFT+L` - Show launcher
* `CTRL+Tab` - Next tab
* `CTRL+SHIFT+Tab` - Previous tab

Run `wezterm show-keys` to see the complete list for your configuration.

## Customizing Key Bindings

To customize key bindings, edit your `wezterm.lua`:

```lua theme={null}
local wezterm = require 'wezterm'
local act = wezterm.action

return {
  keys = {
    -- Disable default binding
    { key = 't', mods = 'CTRL|SHIFT', action = act.DisableDefaultAssignment },
    
    -- Add custom binding
    { key = 't', mods = 'ALT', action = act.SpawnTab 'CurrentPaneDomain' },
    
    -- Custom action
    {
      key = 'r',
      mods = 'CTRL|SHIFT',
      action = act.ReloadConfiguration,
    },
  },
}
```

Then verify with:

```bash theme={null}
wezterm show-keys | grep -E "CTRL.*SHIFT.*[TR]"
```

## Related

* [wezterm ls-fonts](/cli/ls-fonts) - Display font information
* WezTerm Key Binding Configuration Documentation
