Describe the bug
Summary:
Copying wrapped output from GitHub Copilot CLI sometimes removes spaces from the clipboard text.
The issue is especially noticeable in long code output. For example, when a TypeScript fragment such as var c = ""; appears inside a long generated code block, and the visual line wrap occurs at the space between var and c, the copied clipboard text may become varc = "";.
Expected behavior:
Copied text should preserve the exact output, including spaces.
Example expected text:
var c = "";
Actual copied text:
varc = "";
Impact:
This changes the TypeScript code. var c = ""; is a variable declaration, while varc = ""; is an assignment to an identifier named varc. The copied code may fail to compile or behave differently from the generated code.
Additional observation:
I asked Copilot CLI to produce the same code in two ways:
- Write the code directly to a file.
- Print the same code to the terminal output.
The file output preserves spaces correctly.
The text copied from the terminal output sometimes loses spaces, especially around visual line-wrap positions.
This suggests that the generated code itself is correct, and the issue is likely in the terminal rendering/copy/clipboard path.
Reproduction steps:
- Start GitHub Copilot CLI.
- Ask it to output relatively long TypeScript code with long lines and spaces between tokens.
- Ensure that a fragment like
var c = ""; is visually wrapped at the space between var and c.
- Also ask it to write the same code directly to a file.
- Copy the code from the Copilot CLI terminal output.
- Copy the code from the generated file.
- Paste both into plain text files.
- Compare the pasted text.
Example diff:
Environment:
GitHub Copilot CLI version:
OS:
Terminal:
Shell:
Terminal width:
tmux/screen:
Node.js version:
npm version:
Notes:
The issue appears more frequently with longer code output and visual word wrapping. In the observed case, the missing space was exactly the space between the TypeScript keyword var and the identifier c.
Affected version
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
Additional context
No response
Describe the bug
Summary:
Copying wrapped output from GitHub Copilot CLI sometimes removes spaces from the clipboard text.
The issue is especially noticeable in long code output. For example, when a TypeScript fragment such as
var c = "";appears inside a long generated code block, and the visual line wrap occurs at the space betweenvarandc, the copied clipboard text may becomevarc = "";.Expected behavior:
Copied text should preserve the exact output, including spaces.
Example expected text:
var c = "";
Actual copied text:
varc = "";
Impact:
This changes the TypeScript code.
var c = "";is a variable declaration, whilevarc = "";is an assignment to an identifier namedvarc. The copied code may fail to compile or behave differently from the generated code.Additional observation:
I asked Copilot CLI to produce the same code in two ways:
The file output preserves spaces correctly.
The text copied from the terminal output sometimes loses spaces, especially around visual line-wrap positions.
This suggests that the generated code itself is correct, and the issue is likely in the terminal rendering/copy/clipboard path.
Reproduction steps:
var c = "";is visually wrapped at the space betweenvarandc.Example diff:
Environment:
GitHub Copilot CLI version:
OS:
Terminal:
Shell:
Terminal width:
tmux/screen:
Node.js version:
npm version:
Notes:
The issue appears more frequently with longer code output and visual word wrapping. In the observed case, the missing space was exactly the space between the TypeScript keyword
varand the identifierc.Affected version
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
Additional context
No response