Skip to content

Ctrl+Z suspension in VS Code integrated terminal leaves keyboard protocol active, making shell input unusable #1964

@torumakabe

Description

@torumakabe

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:

  • Spaceu is inserted instead of a space
  • Tabu is inserted instead of triggering tab completion
  • Backspace7u is 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

  1. Open the VS Code integrated terminal
  2. Run copilot
  3. Press Ctrl+Z to suspend Copilot CLI and return to the shell
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions