Skip to content

[Bug] Garbled input rendering in Windows Terminal with PowerShell 7 due to CP437 encoding mismatch? or Non-UTF-8. #1713

@enigmanet

Description

@enigmanet

Describe the bug

When pasting text into the Copilot CLI interactive prompt, the pasted content renders as garbled multi-byte characters instead of the intended plain text. The clipboard content is valid UTF-8/ASCII (e.g., a UUID or a slash command), but the CLI input renders it as unreadable encoded characters such as:

뢰z-~)ݱ'(^˜d_jY[i,-z Or TESTING the paste: "�시리��z~)}�������'(���`�����d���0��4�_jY[ì�,��~z��

This makes it impossible to paste any content including session IDs, commands, file paths, or prompts into the CLI input field.

Attempting to disable bracketed paste mode at the terminal level (Write-Host -NoNewline "e[?2004l") before launching the CLI has no effect.
Running /terminal-setupreturns No supported terminal detected` (only supported in VS Code, Cursor, and Windsurf).

Affected version

GitHub Copilot CLI 0.0.418

Steps to reproduce the behavior

  1. You can copy anything from the terminal screen copilot generated.
  2. Highlight, right button click to copy.
  3. Paste it back into the prompt.
  4. You get the random items.
  5. Oddly, if you paste elsewhere it pastes correctly.
Image

Expected behavior

To be able to paste plain text into the prompt as previous.

Additional context

CPU
┌──────────────┬────────────────────────────────┐
│ Field │ Value │
├──────────────┼────────────────────────────────┤
│ Name │ Intel Core i7-1065G7 @ 1.30GHz │
├──────────────┼────────────────────────────────┤
│ Architecture │ x86_64 (64-bit) │
├──────────────┼────────────────────────────────┤
│ Cores │ 4 physical / 8 logical │
└──────────────┴────────────────────────────────┘

Operating System
┌──────────────┬─────────────────────────────────┐
│ Field │ Value │
├──────────────┼─────────────────────────────────┤
│ OS │ Microsoft Windows 11 Enterprise │
├──────────────┼─────────────────────────────────┤
│ Version │ 10.0.26200 (Build 26200) │
├──────────────┼─────────────────────────────────┤
│ Architecture │ 64-bit │
└──────────────┴─────────────────────────────────┘
Shell
┌────────────────┬───────────────────────────────────────┐
│ Field │ Value │
├────────────────┼───────────────────────────────────────┤
│ Shell │ PowerShell 7.5.4 (Core edition) │
├────────────────┼───────────────────────────────────────┤
│ Fallback shell │ cmd.exe (C:\WINDOWS\system32\cmd.exe) │
└────────────────┴───────────────────────────────────────┘
Terminal
┌─────────────────────┬──────────────────────────────────────┐
│ Field │ Value │
├─────────────────────┼──────────────────────────────────────┤
│ Terminal │ Windows Terminal │
├─────────────────────┼──────────────────────────────────────┤
│ WT_SESSION │ 1620a180-915c- │
├─────────────────────┼──────────────────────────────────────┤
│ TERM / TERM_PROGRAM │ (not set) │
└─────────────────────┴──────────────────────────────────────┘

Encoding

┌──────────────────┬────────────────────────────────────────────┐
│ Field │ Value │
├──────────────────┼────────────────────────────────────────────┤
│ Console encoding │ IBM437 / OEM United States (Code Page 437) │
└──────────────────┴────────────────────────────────────────────┘

GitHub Copilot CLI

┌─────────────────────┬────────────────────────────────────────────────────────┐
│ Field │ Value │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ gh CLI │ Not found in PATH — gh copilot --version could not run │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Copilot CLI version │ 0.0.418 (from session context) │
└─────────────────────┴────────────────────────────────────────────────────────┘

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions