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

# 终端兼容性

> 支持的终端以及获得最佳 Devin CLI 体验的建议

Devin CLI 可在多种终端模拟器中运行，但不同终端的使用体验有所差异。本页介绍兼容性级别、推荐选择和配置建议。

***

<div id="compatibility-overview">
  ## 兼容性概览
</div>

终端根据功能支持情况分为三个层级：

<div id="fully-supported-all-features-work">
  ### 完全支持 (所有功能均可正常使用)
</div>

这些终端支持 [Kitty 键盘协议](https://sw.kovidgoyal.net/kitty/keyboard-protocol/)，能够可靠地识别 `Shift+Enter` 等按键组合，从而支持多行输入。

| Terminal                                    | Platform               | Notes                            |
| ------------------------------------------- | ---------------------- | -------------------------------- |
| [Kitty](https://sw.kovidgoyal.net/kitty/)   | macOS†, Linux          | 推荐高级用户使用。Devin CLI 的开发者也在使用。     |
| [Ghostty](https://ghostty.org/)             | macOS†, Linux          | 推荐高级用户使用。Devin CLI 的开发者也在使用。     |
| [WezTerm](https://wezfurlong.org/wezterm/)  | macOS†, Linux, Windows | 推荐高级用户使用。                        |
| [iTerm2](https://iterm2.com/)               | macOS†                 | 推荐大多数用户使用。为获得最佳支持，需要 3.5+ 版本。    |
| [Windows Terminal](https://aka.ms/terminal) | Windows                | 推荐大多数用户使用。为获得最佳支持，需要 1.25 或更高版本。 |

<div id="supported-some-features-limited">
  ### 支持 (部分功能受限)
</div>

这些终端可与 Devin CLI 配合使用，但并非理想选择，因为它们不支持 Kitty 键盘协议。例如，`Shift+Enter` 无法插入换行——请改用 `Alt+Enter` 或 `Ctrl+J`。

| Terminal                                                             | Platform               | Notes                                                                                |
| -------------------------------------------------------------------- | ---------------------- | ------------------------------------------------------------------------------------ |
| [Terminal.app](https://support.apple.com/guide/terminal/welcome/mac) | macOS†                 | macOS 内置终端。使用 `Alt` 快捷键需要先[将 Option 配置为 Meta](#configuring-option-as-meta-on-macos)。 |
| Git Bash                                                             | Windows                | [Git for Windows](https://git-scm.com/download/win) 已包含。                             |
| DEC VT100                                                            | Various                | 在 `/config` 中将终端模式设为 `legacy`。                                                       |
| Generic ANSI terminals                                               | Various                | 任何支持基本 ANSI 转义码的终端。                                                                  |
| [Alacritty](https://alacritty.org/)                                  | macOS†, Linux, Windows | 强烈不建议使用，不利于获得最佳性能。                                                                   |

† 在 macOS 上，我们建议[将 Option 配置为 Meta](#configuring-option-as-meta-on-macos)，以获得基于 `Alt` 快捷键的最佳体验。

<Note>
  在 macOS 终端中，如果未配置将 Option 配置为 Meta，则 `Alt+Enter` 这类用于多行输入的 `Alt` (Option) 快捷键将无法使用。请参阅下方的 [Configuring Option-as-Meta on macOS](#configuring-option-as-meta-on-macos)。
</Note>

<div id="unsupported">
  ### 不支持
</div>

这些终端目前不受支持，使用时可能会出现严重问题。强烈建议切换到受支持的终端。

| 终端                | 平台      | 说明                                                                |
| ----------------- | ------- | ----------------------------------------------------------------- |
| cmd.exe (conhost) | Windows | 旧版 Windows 命令提示符。请改用 [Windows Terminal](https://aka.ms/terminal)。 |

***

<div id="recommendations">
  ## 推荐
</div>

| 平台                       | 推荐                                                                                                                     |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
| **Windows**              | [Windows Terminal](https://aka.ms/terminal) 1.25 或更高版本                                                                 |
| **macOS** (一般情况)         | [iTerm2](https://iterm2.com/)                                                                                          |
| **macOS / Linux** (高级用户) | [Kitty](https://sw.kovidgoyal.net/kitty/)、[Ghostty](https://ghostty.org/) 或 [WezTerm](https://wezfurlong.org/wezterm/) |

***

<div id="configuring-option-as-meta-on-macos">
  ## 在 macOS 上将 Option 配置为 Meta
</div>

在 macOS 上，大多数终端默认会将 Option 键用作组合键，因此基于 `Alt` 的快捷键 (例如用于多行输入的 `Alt+Enter`，或用于循环切换思考级别的 `Alt+T`) 在你将终端配置为把 Option 识别为 Meta/Alt 之前无法使用。

<AccordionGroup>
  <Accordion title="iTerm2">
    1. 打开 **iTerm2 > Settings** (或按 `Cmd+,`)
    2. 前往 **Profiles > Keys > General**
    3. 将 **Left Option Key** 设置为 **Esc+**
    4. 也可以将 **Right Option Key** 设置为 **Esc+**

    [iTerm2 文档](https://iterm2.com/documentation-preferences-profiles-keys.html)
  </Accordion>

  <Accordion title="Terminal.app">
    1. 打开 **Terminal > Settings** (或按 `Cmd+,`)
    2. 前往 **Profiles**，然后选择当前激活的 Profile
    3. 点击 **Keyboard** 选项卡
    4. 勾选 **Use Option as Meta Key**

    [Apple 文档](https://support.apple.com/guide/terminal/change-profiles-keyboard-settings-trmlkbrd/mac)
  </Accordion>

  <Accordion title="Alacritty">
    将以下内容添加到你的 `alacritty.toml` 配置文件中：

    ```toml theme={null}
    [keyboard]
    option_as_alt = "Both"
    ```

    [Alacritty 配置参考](https://alacritty.org/config-alacritty.html)
  </Accordion>

  <Accordion title="Kitty">
    将以下内容添加到你的 `kitty.conf` 配置文件中：

    ```text theme={null}
    macos_option_as_alt yes
    ```

    修改后，重启 Kitty。

    [Kitty 文档](https://sw.kovidgoyal.net/kitty/conf/#opt-kitty.macos_option_as_alt)
  </Accordion>

  <Accordion title="Ghostty">
    将以下内容添加到你的 Ghostty 配置文件中：

    ```text theme={null}
    macos-option-as-alt = true
    ```

    修改后，重启 Ghostty。

    [Ghostty 文档](https://ghostty.org/docs/config/reference#macos-option-as-alt)
  </Accordion>

  <Accordion title="WezTerm">
    将以下内容添加到你的 `~/.wezterm.lua` 配置文件中：

    ```lua theme={null}
    config.send_composed_key_when_left_alt_is_pressed = false
    config.send_composed_key_when_right_alt_is_pressed = false
    ```

    [WezTerm 文档](https://wezfurlong.org/wezterm/config/lua/config/send_composed_key_when_left_alt_is_pressed.html)
  </Accordion>
</AccordionGroup>
