# How to set up Claude Code in iTerm2, WezTerm or kitty

Option as Meta, Shift+Enter, notifications and tmux for Claude Code in iTerm2, WezTerm and kitty, with the exact setting for each terminal.

Source: https://hivemux.dev/guides/claude-code-iterm2-wezterm-kitty/

> Shift+Enter works in iTerm2, WezTerm and kitty with no setup. For Option shortcuts on a Mac, set iTerm2's Option keys to Esc+, kitty's macos_option_as_alt, or WezTerm's right Option. Claude Code shows desktop notifications in iTerm2 (after you turn on its alerts) and kitty, not in WezTerm. hivemux terminal iterm, wezterm or kitty opens every window in tmux with the hivemux sidebar.

Claude Code runs in any terminal, but three things behave differently from one terminal to the next: whether Option reaches Claude Code as Meta, whether Shift+Enter inserts a newline, and whether you get a desktop notification when Claude finishes or waits for approval. This guide gives the setting for each in iTerm2, WezTerm and kitty, then how to run them all inside tmux.

The Claude Code facts come from Anthropic's [terminal configuration](https://code.claude.com/docs/en/terminal-config) and [commands](https://code.claude.com/docs/en/commands) docs (November 2026); the kitty and WezTerm settings come from [kitty's config reference](https://sw.kovidgoyal.net/kitty/conf/) and [WezTerm's keyboard concepts](https://wezterm.org/config/keyboard-concepts.html).

## At a glance

| | iTerm2 | WezTerm | kitty |
|---|---|---|---|
| Shift+Enter for a newline | Works without setup | Works without setup | Works without setup |
| Option as Meta on a Mac | Profiles → Keys → General → Left/Right Option key: Esc+ | Left Option is Alt by default; set the right one too | `macos_option_as_alt both`, then restart kitty |
| Claude Code desktop notification | Yes, after you turn on iTerm2's alert settings | No; use the terminal bell or a hook | Yes |
| `/terminal-setup` | Turns on clipboard access so `/copy` works | Not needed | Not needed |
| `hivemux terminal <name>` | `iterm` | `wezterm` | `kitty` |

## Option as Meta

Some Claude Code shortcuts use the Option key, such as Option+Enter for a newline and Option+P to switch models. On a Mac, most terminals do not send Option as a modifier by default, so those shortcuts do nothing until you change one setting. The same setting matters for tmux and hivemux keys such as `Option+1` … `9`.

**iTerm2.** Open Settings → Profiles → Keys → General and set Left Option key and Right Option key to Esc+.

**kitty.** Add one line to `kitty.conf`. kitty's default is `no`, which keeps macOS's Option+key characters; `left`, `right` or `both` turn those Option keys into Alt. kitty's docs say this option cannot be changed by reloading the config, so quit kitty and open it again.

```sh
macos_option_as_alt both
```

**WezTerm.** By default the left Option key already acts as Alt and the right one composes characters. To make both act as Alt, set this in `wezterm.lua`:

```lua
config.send_composed_key_when_left_alt_is_pressed = false
config.send_composed_key_when_right_alt_is_pressed = false
```

## Shift+Enter and newlines

Enter sends the prompt. Anthropic's terminal docs list iTerm2, WezTerm and kitty (with Ghostty, Warp and Windows Terminal 1.25 or later) as terminals where Shift+Enter inserts a newline without setup. Two keys work everywhere: Ctrl+J, or `\` followed by Enter.

Inside tmux, Shift+Enter sends the prompt instead, even in these terminals, until tmux passes extended keys through (see the tmux section below).

`/terminal-setup` is for the terminals that need a keybinding written (VS Code, Cursor, Zed, older Alacritty). In iTerm2 it does something else: it turns on Settings → General → Selection → Applications in terminal may access clipboard, so `/copy` can write to the clipboard. Restart iTerm2 afterwards.

## Notifications

Claude Code fires a notification event when it finishes a task or pauses for a permission prompt while you seem to be away. What you see depends on the terminal:

- **kitty:** a desktop notification, with no setup.
- **iTerm2:** a desktop notification, which iTerm2 shows only after you turn on its alert settings.
- **WezTerm:** nothing by default. Set `preferredNotifChannel` to `"terminal_bell"` so Claude Code sends a bell character, or add a `Notification` hook that runs a command of your own.

```json
{
  "preferredNotifChannel": "terminal_bell"
}
```

Over SSH, from a terminal running outside tmux, set `preferredNotifChannel` to `"iterm2"` or `"kitty"` on the machine that runs Claude Code, and the notification reaches your local machine. kitty forwards it to the notification center by itself. iTerm2 needs forwarding turned on: Settings → Profiles → Terminal, check Notification Center Alerts, then Filter Alerts → Send escape sequence-generated alerts. The [notifications guide](/guides/claude-code-notifications/) covers hooks and phone push.

## Running Claude Code inside tmux

Inside tmux, Shift+Enter sends the prompt and desktop notifications do not reach the outer terminal until tmux is told to pass them through. Anthropic's terminal docs give these lines for `~/.tmux.conf`:

```sh
set -g allow-passthrough on
set -g focus-events on
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'
```

Run `tmux source-file ~/.tmux.conf`. For Shift+Enter, detach, attach again and restart Claude Code. For notifications from a visible pane, keep `allow-passthrough` and set `preferredNotifChannel` to `"iterm2"` or `"kitty"`. With this setup, a pane in a window you are not viewing sends none. Using tmux itself with Claude Code is covered in [Claude Code and tmux](/guides/claude-code-tmux/).

## Every window in tmux with hivemux

hivemux is a tmux sidebar that shows every Claude Code session — running, waiting for you, or done — and lets you jump to the one that needs you. It recommends Ghostty, but one command makes iTerm2, WezTerm or kitty open every window inside tmux with the sidebar the same way:

```sh
hivemux terminal iterm        # or wezterm, kitty
hivemux terminal iterm --off  # stop
```

Without a name, it uses the terminal you run it in, and `hivemux setup` run from one of these terminals asks whether to do it (default no). On Linux the choices are ghostty, wezterm, kitty and alacritty; iTerm2 is a macOS app.

| Terminal | What `hivemux terminal` changes |
|---|---|
| iTerm2 | Adds a profile of its own, "hivemux" (a Dynamic Profile), and makes it the default; your profiles stay as they are. New windows use it after iTerm2 restarts. `--off` restores your previous default profile |
| WezTerm | Adds marked lines before the final `return config` in its config, or writes a new config if there is none |
| kitty | Adds a marked block to its config |

`--off` and `hivemux uninstall` remove only what this added, and `hivemux doctor` lists the terminals that are set up. The full table, with Alacritty and Terminal.app, is on the [Install](/docs/install/#other-terminals) page.

Two things to know when you leave Ghostty:

- **Jump keys need Option as Alt.** `Option+1` … `9` and `Option+0` reach tmux only when the terminal sends Option as Alt (the settings above). If they do nothing, `prefix Space` does the same as `Option+0`, or click a Claude's line in the sidebar.
- **hivemux's own notifications are terminal notifications (OSC 777).** They show in terminals that support it, such as Ghostty. If yours does not, the sidebar still turns a waiting Claude's line amber, and Claude Code's own notifications above still work.

Install:

```sh
curl -fsSL https://hivemux.dev/install.sh | bash
```

or

```sh
brew install hivemux/tap/hivemux
hivemux setup
```

## FAQ

### How do I make Option work as Meta for Claude Code in iTerm2?

Open iTerm2 Settings → Profiles → Keys → General and set both Left Option key and Right Option key to Esc+. Claude Code's Option shortcuts, such as Option+P to switch models, then reach it instead of typing special characters.

### Does Shift+Enter work in Claude Code in iTerm2, WezTerm and kitty?

Yes. Anthropic's terminal docs list Ghostty, Kitty, iTerm2 and WezTerm as working without setup. Inside tmux it also needs extended-keys in ~/.tmux.conf. Ctrl+J, or a backslash followed by Enter, inserts a newline in any terminal.

### Why do I get no Claude Code notifications in WezTerm?

Claude Code sends desktop notifications only in terminals it detects as Ghostty, Kitty or iTerm2; other terminals get nothing by default. Set preferredNotifChannel to terminal_bell in ~/.claude/settings.json, or add a Notification hook that runs your own command.

### Do I need Ghostty to use hivemux?

No. `hivemux terminal iterm`, `wezterm` or `kitty` makes that terminal open every window inside tmux with the hivemux sidebar, the way Ghostty does, and `--off` undoes it. Any terminal also works if you start tmux yourself.
