Repository navigation
Description
Describe the bug
When Copilot CLI starts inside Windows Terminal (WT_SESSION is set), it shows the modal "Set up terminal for multi-line input support" right after the folder-trust dialog, with "1. Yes" preselected. The modal takes focus without any keystroke from the user, so if the user (or a program driving the CLI in a pseudo-terminal) starts typing a prompt, the letters are dropped and the first Enter accepts the offer. Copilot then rewrites the user's global Windows Terminal settings.json (adds a shift+enter → sendInput "\u001b\r" action) and the typed prompt is lost.
So a global terminal config file is edited by an Enter that was meant to submit a prompt. It is easy to hit when the CLI runs in an embedded/nested terminal (an editor panel, a terminal multiplexer, or a desktop app that hosts terminals) that inherits WT_SESSION from the parent Windows Terminal. A backup file is written, but the user never saw the question.
Affected version
1.0.93
Steps to reproduce the behavior
To avoid touching a real config, point LOCALAPPDATA at an empty folder with a stub Windows Terminal settings file:
- Create
<tmp>\la\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.jsoncontaining{ "profiles": { "list": [] }, "actions": [] }. - In a terminal (any pty), set
LOCALAPPDATA=<tmp>\la,COPILOT_HOME=<tmp>\home,WT_SESSION=<any guid>, and a BYOK provider (COPILOT_PROVIDER_BASE_URL,COPILOT_PROVIDER_API_KEY,COPILOT_MODEL) so no login is needed. - Run
copilotin a new folder and answer the folder-trust dialog with Enter ("1. Yes"). - The "Set up terminal for multi-line input support" modal appears with "1. Yes" selected.
- Type
helloand press Enter, as you would for a first prompt.
Result: "Updated Windows Terminal key bindings: added key binding for shift+enter." The stub settings.json now has the new actions entry and a settings.json.<timestamp>.backup is next to it; hello never reaches the prompt.
Expected behavior
One of:
- the offer defaults to "No" (or requires an explicit choice such as
y), so a stray Enter cannot change a global config file; - the offer is shown as a non-modal hint (e.g. "run /terminal-setup to enable Shift+Enter") instead of a modal at startup;
- the offer is skipped when stdin is not the Windows Terminal session itself (e.g. the CLI is a child of another terminal host).
COPILOT_SETUP_TERMINAL=false turns the offer off, which is what we use now, but it is not documented in copilot help environment as far as I can see, so other hosts will hit this.
Additional context
- Windows 10 22H2 (19045), x64
- Found while running Copilot CLI in a pty-hosted terminal inside a desktop app (NeuroSquad) started from Windows Terminal; reproduced above with a plain pty and a stub settings file.
- Related:
/terminal-setupinside Dev Container and Codespaces writes keybindings to wrong file #657 (/terminal-setupwriting keybindings to the wrong file in containers).
Activity
copilot-cli-bot commentedon Nov 25, 2026
This appears to be resolved as of GitHub Copilot CLI v1.0.115. Please update to that release or a newer stable version. We're closing this as completed. If it still happens, please comment with your version and reproduction steps.