> ## 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.

# Quick Select Mode

> Instantly highlight and copy common patterns like URLs, file paths, and git hashes

Quick Select mode allows you to rapidly identify and copy text that matches common patterns without using your mouse. It's perfect for quickly grabbing URLs, file paths, git commit hashes, IP addresses, and other frequently-copied patterns.

## Activating Quick Select

| Action                | Keybinding         |
| --------------------- | ------------------ |
| Activate quick select | `Ctrl+Shift+Space` |

When activated, WezTerm searches the visible terminal content for matching patterns and highlights them with one or two character labels.

## How It Works

<Steps>
  <Step title="Activate quick select mode">
    Press `Ctrl+Shift+Space` to scan the terminal for patterns.
  </Step>

  <Step title="View highlighted matches">
    Matching text is highlighted with letter/number prefixes (like `a`, `b`, `aa`, etc.).
  </Step>

  <Step title="Type the prefix to copy">
    Type the prefix in lowercase to copy the match to clipboard and exit.
  </Step>

  <Step title="Or type uppercase to paste">
    Type the prefix in UPPERCASE to copy AND paste the match immediately.
  </Step>
</Steps>

## Default Patterns

Quick select automatically matches:

* **URLs**: http, https, and other web addresses
* **File paths**: Absolute and relative filesystem paths
* **Git hashes**: SHA commit hashes (6+ hex characters)
* **IP addresses**: IPv4 addresses
* **Numbers**: Numeric values
* **UUIDs**: Standard UUID format

## Custom Patterns

Add your own patterns to match domain-specific text:

### Quick Select Configuration

```lua Custom Patterns theme={null}
local wezterm = require 'wezterm'
local config = {}

-- Add custom patterns to match
config.quick_select_patterns = {
  -- Match JIRA tickets
  '[A-Z]+-\\d+',
  -- Match hex colors
  '#[0-9a-fA-F]{6}',
  -- Match semantic versions
  '\\d+\\.\\d+\\.\\d+',
}

return config
```

### More Pattern Examples

<CodeGroup>
  ```lua Development Patterns theme={null}
  config.quick_select_patterns = {
    -- GitHub issue references
    '#\\d+',
    -- Docker container IDs (short)
    '\\b[0-9a-f]{12}\\b',
    -- AWS resource IDs
    '\\b[a-z]+-[0-9a-f]{17}\\b',
    -- Base64 encoded strings
    '\\b[A-Za-z0-9+/]{20,}={0,2}\\b',
  }
  ```

  ```lua Kubernetes Patterns   theme={null}
  config.quick_select_patterns = {
    -- Pod names
    '\\b[a-z0-9]([a-z0-9-]*[a-z0-9])?-[a-z0-9]{5,10}-[a-z0-9]{5}\\b',
    -- Namespace names
    'namespace/[a-z0-9-]+',
    -- Resource types
    '(pod|service|deployment|configmap|secret)/[a-z0-9-]+',
  }
  ```

  ```lua Cloud Provider IDs theme={null}
  config.quick_select_patterns = {
    -- AWS Account IDs
    '\\b\\d{12}\\b',
    -- GCP Project IDs
    '[a-z][a-z0-9-]{4,28}[a-z0-9]',
    -- Azure Resource IDs
    '/subscriptions/[a-f0-9-]{36}',
  }
  ```
</CodeGroup>

## Customizing the Alphabet

Change which characters are used for labels:

```lua Custom Alphabet theme={null}
local wezterm = require 'wezterm'
local config = {}

-- Use only letters (no numbers)
config.quick_select_alphabet = 'abcdefghijklmnopqrstuvwxyz'

-- Or use Dvorak home row
config.quick_select_alphabet = 'aoeuhtns'

-- Or numbers first
config.quick_select_alphabet = '1234567890'

return config
```

<Note>
  The default alphabet is optimized for touch typing: `asdfqwerzxcvjklmiuopghtybn1234567890`
</Note>

## Visual Customization

Customize how matches are highlighted:

```lua Highlight Colors theme={null}
local wezterm = require 'wezterm'
local config = {}

config.colors = {
  quick_select_label_bg = { Color = '#ffff00' },
  quick_select_label_fg = { Color = '#000000' },
  quick_select_match_bg = { Color = '#ff00ff' },
  quick_select_match_fg = { Color = '#ffffff' },
}

return config
```

### Remove Styling

For cleaner visual focus, remove color and styling from the pane:

```lua Clean Display theme={null}
config.quick_select_remove_styling = true
```

This strips all colors and formatting before highlighting matches, making them easier to spot in busy terminal output.

## Advanced Usage

### Opening URLs

```lua Quick URL Opening theme={null}
-- 1. Run a command that outputs URLs
-- 2. Press Ctrl+Shift+Space
-- 3. Type the label for the URL
-- 4. The URL is copied to clipboard
-- 5. Paste it or use a browser extension to open from clipboard
```

### Copying Multiple Matches

```lua Sequential Copying theme={null}
-- 1. Activate quick select
-- 2. Type lowercase label to copy first match
-- 3. Immediately press Ctrl+Shift+Space again
-- 4. Copy next match
-- 5. Repeat as needed
```

### Selecting and Pasting

Use uppercase labels for instant paste:

```lua Copy and Paste theme={null}
-- Example: Copying a git hash to use in a command
-- 1. Run: git log --oneline
-- 2. Press Ctrl+Shift+Space
-- 3. Type UPPERCASE label (e.g., 'A' instead of 'a')
-- 4. The hash is copied AND pasted at cursor
```

## Exiting Quick Select

| Action                  | Keybinding             |
| ----------------------- | ---------------------- |
| Cancel without copying  | `Escape`               |
| Select and copy         | Type label (lowercase) |
| Select, copy, and paste | Type label (UPPERCASE) |

## Use Cases

### Development Workflow

<CodeGroup>
  ```bash Copying Git Hashes theme={null}
  # View commits
  git log --oneline

  # Press Ctrl+Shift+Space
  # Type label for desired commit hash
  # Hash is now in clipboard

  # Use it immediately
  git checkout <paste>
  ```

  ```bash Grabbing File Paths theme={null}
  # Find files
  find . -name "*.js"

  # Press Ctrl+Shift+Space  
  # Type label for desired path
  # Path is in clipboard

  # Open in editor
  vim <paste>
  ```

  ```bash Copying Error IDs theme={null}
  # Application shows error
  Error: RequestID=abc123def456 - Failed to process

  # Press Ctrl+Shift+Space
  # Type label for request ID
  # Search logs
  grep abc123def456 app.log
  ```
</CodeGroup>

### System Administration

```bash Container Management theme={null}
# List containers
docker ps

# Quick select container ID
# Ctrl+Shift+Space -> type label

# Inspect container
docker inspect <paste>
```

### Network Operations

```bash IP Addresses theme={null}
# Show network connections
netstat -an

# Quick select an IP address
# Ctrl+Shift+Space -> type label

# Ping it
ping <paste>
```

## Pattern Syntax

Quick select patterns use regular expression syntax:

| Pattern | Description     | Example                           |
| ------- | --------------- | --------------------------------- |
| `\\d`   | Digit           | `\\d+` matches 123                |
| `\\w`   | Word character  | `\\w+` matches hello              |
| `[A-Z]` | Character class | `[A-Z]+` matches ABC              |
| `{n,m}` | Repetition      | `\\d{2,4}` matches 42 or 2024     |
| `\\b`   | Word boundary   | `\\b\\d{4}\\b` matches year 2024  |
| `+`     | One or more     | `a+` matches a or aaa             |
| `*`     | Zero or more    | `ab*` matches a or abb            |
| `?`     | Optional        | `colou?r` matches color or colour |

<Warning>
  Remember to escape backslashes in Lua strings: use `\\\\` for a literal backslash in the regex.
</Warning>

## Performance Considerations

* Quick select only scans **visible** terminal content
* Complex patterns may take longer to match
* Large terminal windows have more content to scan
* Consider using simpler patterns for better performance

## Comparison: Quick Select vs Copy Mode

| Feature          | Quick Select    | Copy Mode            |
| ---------------- | --------------- | -------------------- |
| Speed            | Very fast       | Slower, more precise |
| Use case         | Common patterns | Arbitrary text       |
| Mouse needed     | No              | No                   |
| Pattern matching | Automatic       | Manual navigation    |
| Multi-line       | No              | Yes                  |
| Rectangular      | No              | Yes                  |

**Use Quick Select when:**

* Copying URLs, hashes, IDs, or other patterns
* Speed is important
* Pattern is visible on screen

**Use [Copy Mode](/features/copy-mode) when:**

* Selecting arbitrary text
* Needing multi-line selection
* Pattern is not pre-defined
* Wanting Vim-style navigation

## Tips and Tricks

1. **Combine with scrollback**: Scroll to make the desired text visible, then activate quick select

2. **Use uppercase for workflows**: Uppercase paste is perfect for shell command construction

3. **Refine patterns over time**: Add patterns you frequently need to your config

4. **Test patterns**: Use regex testing tools to validate patterns before adding them

5. **Keep alphabet short**: Fewer characters mean shorter labels and faster selection
