Describe the bug
Copying long wrapped lines from Copilot CLI output inserts real newline characters at visual wrap boundaries. This breaks pasted one-line shell commands and other long single-line text.
I can reproduce this in Copilot CLI even after disabling Copilot mouse capture with "mouse": false. The issue is not specific to tmux or kitty: I also reproduced it in xterm with no tmux. In the same environments, copying long lines from other sources (plain terminal output, neovim, Claude Code) works correctly.
Affected version
GitHub Copilot CLI 1.0.43
Steps to reproduce the behavior
-
Run Copilot CLI in a terminal where output wraps (I reproduced in both of these setups):
- kitty 0.46.2 + tmux 3.6a on Wayland
- xterm 409 with no tmux
-
Ask Copilot for a single very long one-line shell command, for example:
printf '%s\n' START paste-wrap-test-0001 paste-wrap-test-0002 paste-wrap-test-0003 paste-wrap-test-0004 paste-wrap-test-0005 paste-wrap-test-0006 paste-wrap-test-0007 paste-wrap-test-0008 paste-wrap-test-0009 paste-wrap-test-0010 paste-wrap-test-0011 paste-wrap-test-0012 paste-wrap-test-0013 paste-wrap-test-0014 paste-wrap-test-0015 paste-wrap-test-0016 paste-wrap-test-0017 paste-wrap-test-0018 paste-wrap-test-0019 paste-wrap-test-0020 paste-wrap-test-0021 paste-wrap-test-0022 paste-wrap-test-0023 paste-wrap-test-0024 paste-wrap-test-0025 paste-wrap-test-0026 paste-wrap-test-0027 paste-wrap-test-0028 paste-wrap-test-0029 paste-wrap-test-0030 paste-wrap-test-0031 paste-wrap-test-0032 paste-wrap-test-0033 paste-wrap-test-0034 paste-wrap-test-0035 paste-wrap-test-0036 paste-wrap-test-0037 paste-wrap-test-0038 paste-wrap-test-0039 paste-wrap-test-0040 paste-wrap-test-0041 paste-wrap-test-0042 paste-wrap-test-0043 paste-wrap-test-0044 paste-wrap-test-0045 paste-wrap-test-0046 paste-wrap-test-0047 paste-wrap-test-0048 paste-wrap-test-0049 paste-wrap-test-0050 END
-
Copy that command from Copilot's rendered output.
- I saw this with Copilot's built-in copy action.
- I also still see it when using terminal-native selection after setting
~/.copilot/settings.json to { "mouse": false }.
-
Paste into a shell prompt.
Example of what happens after paste:
❯ printf '%s\n' START paste-wrap-test-0001 paste-wrap-test-0002
paste-wrap-test-0003 paste-wrap-test-0004 paste-wrap-test-0005
paste-wrap-test-0006 paste-wrap-test-0007 paste-wrap-test-0008
...
START
paste-wrap-test-0001
paste-wrap-test-0002
zsh: command not found: paste-wrap-test-0003
zsh: command not found: paste-wrap-test-0006
zsh: command not found: paste-wrap-test-0009
This shows the copied text contains real \n characters where the UI visually wrapped the line.
Expected behavior
Copying Copilot output should preserve the underlying logical text. Visual line wrapping should not be converted into real newline characters in the clipboard payload.
The pasted command should remain a single shell command no matter how it was visually wrapped in the UI.
Additional context
- OS: EndeavourOS Linux (Wayland)
- Architecture: x86_64
- Shell: zsh
- TERM inside tmux:
xterm-color
- tmux:
3.6a
- kitty:
0.46.2
- xterm:
409
"mouse": false changes selection behavior, but does not fix this wrapped-line copy problem.
- This feels related to Copilot's renderer / copy path rather than the terminal, because the same terminals copy long unwrapped logical lines correctly outside Copilot.
- Possibly related, but not identical, to:
Describe the bug
Copying long wrapped lines from Copilot CLI output inserts real newline characters at visual wrap boundaries. This breaks pasted one-line shell commands and other long single-line text.
I can reproduce this in Copilot CLI even after disabling Copilot mouse capture with
"mouse": false. The issue is not specific to tmux or kitty: I also reproduced it inxtermwith no tmux. In the same environments, copying long lines from other sources (plain terminal output, neovim, Claude Code) works correctly.Affected version
Steps to reproduce the behavior
Run Copilot CLI in a terminal where output wraps (I reproduced in both of these setups):
Ask Copilot for a single very long one-line shell command, for example:
Copy that command from Copilot's rendered output.
~/.copilot/settings.jsonto{ "mouse": false }.Paste into a shell prompt.
Example of what happens after paste:
This shows the copied text contains real
\ncharacters where the UI visually wrapped the line.Expected behavior
Copying Copilot output should preserve the underlying logical text. Visual line wrapping should not be converted into real newline characters in the clipboard payload.
The pasted command should remain a single shell command no matter how it was visually wrapped in the UI.
Additional context
xterm-color3.6a0.46.2409"mouse": falsechanges selection behavior, but does not fix this wrapped-line copy problem.