github / github/copilot-cli

`/terminal-setup` inside Dev Container and Codespaces writes keybindings to wrong file

未關閉
#657 0 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
area:configuration area:input-keyboard
主要語言
Shell
星號
11.2k
分支
1.9k
平均合併
14 小時 16 分鐘
30 天內合併 PR
6

描述

### Describe the bug

When using Copilot CLI within a Linux Dev Container or GitHub Codespaces instance, `/terminal-setup` creates a `~/.config/Code/User/keybindings.json` or `~/.config/Code - Insiders/User/keybindings.json` file, which doesn't do anything because keybinding configs work at the host layer.

This causes `Shift+Enter` and `Ctrl+Enter` keypresses to not insert newlines as intended, and also makes `copilot` think they're correctly set up when they're not:

```
● Key bindings for VS Code are already set up. Your terminal already has multiline support with Shift+Enter and Ctrl+Enter.
```

### Workaround

1. Activate Command Palette (`Ctrl+Shift+P` or `Cmd+Shift+P`)
2. Select **Preferences: Open Keyboard Shortcuts (JSON)**
3. Insert the following into the JSON array:

```json
{
"key": "ctrl+enter",
"command": "workbench.action.terminal.sendSequence",
"when": "terminalFocus",
"args": {
"text": "\\\r\n"
}
},
{
"key": "shift+enter",
"command": "workbench.action.terminal.sendSequence",
"when": "terminalFocus",
"args": {
"text": "\\\r\n"
}
}
```

### Affected version

0.0.363

### Steps to reproduce the behavior

1. Remove `Ctrl+Enter` and `Shift+Enter` keybindings from `keybindings.json`
2. Install and run Copilot CLI from inside a Linux Dev Container or GitHub Codespaces instance
3. Run `/terminal-setup` or choose yes when prompted during the first-time setup flow

### Expected behavior

Keybindings should be added to the host-level `keybindings.json` config.

### Additional context

_No response_

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。