-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Describe the bug
When Copilot CLI is suspended with Ctrl+Z in the VS Code integrated terminal, the shell becomes unusable because keys produce unexpected characters instead of their normal function:
- Space →
uis inserted instead of a space - Tab →
uis inserted instead of triggering tab completion - Backspace →
7uis inserted instead of deleting a character
Since Backspace itself is broken, the user cannot even correct the garbled input. The only recovery is to reset the terminal.
This makes Ctrl+Z suspension practically unusable in the VS Code integrated terminal.
The character pattern (trailing u) is consistent with an extended keyboard protocol (such as the Kitty keyboard protocol's CSI {codepoint} u encoding) remaining active after suspension, and the shell interpreting the encoded sequences as literal text.
Affected version
GitHub Copilot CLI 1.0.4-0
Steps to reproduce the behavior
- Open the VS Code integrated terminal
- Run
copilot - Press
Ctrl+Zto suspend Copilot CLI and return to the shell - Press Space, Backspace, or Tab
Expected behavior
After suspending Copilot CLI with Ctrl+Z, the shell should receive normal key input. Any extended keyboard protocol mode enabled by the CLI should be reset before or upon suspension.
Additional context
- OS: macOS (arm64), also reproduced on Windows (WSL)
- VS Code Version: 1.111.0
- Shell: zsh
- Reproduces in: VS Code integrated terminal (macOS and Windows)
- Does NOT reproduce in: macOS Terminal.app, Ghostty, Windows Terminal (with WSL)
The issue is specific to the VS Code integrated terminal (xterm.js). Native terminal emulators appear to handle keyboard protocol state reset on process suspension correctly.