copy singleLine does not work with block select #19616

Open
opened 2026-01-31 06:48:48 +00:00 by claunia · 0 comments
Owner

Originally created by @yellowtailfan on GitHub (Apr 3, 2023).

Windows Terminal version

1.16.10262.0

Windows build number

10.0.22621.1413

Other Software

No response

Steps to reproduce

I would like to be able to copy a column from a command listing output and feed it into another command as a sequence of command line arguments.

Here's a simple reproduction of the problem:

  1. Run Ubuntu Bash via WSL2 in Windows Terminal
  2. Type: ls -l and press Enter
  3. Hold down Alt and drag the mouse to select a column from the listing
  4. Command palette > Copy as single line (or use a keyboard shortcut assigned to copy singleLine=true)
  5. Type: echo but don't press Enter
  6. Paste
  7. Press Enter

Expected Behavior

The column should be pasted as a single line, and then printed as a single line by echo.

Actual Behavior

Only the first row in the column is pasted as a single line. echo prints the first row, then Bash receives the remaining rows as separate lines and tries to run each one.

If I use normal selection (not block selection) then Copy as single line does the expected behaviour.

The problem is not unique to pasting into Windows Terminal or Bash. The same behaviour happens if I paste into another app, e.g. into VS Code.

Originally created by @yellowtailfan on GitHub (Apr 3, 2023). ### Windows Terminal version 1.16.10262.0 ### Windows build number 10.0.22621.1413 ### Other Software _No response_ ### Steps to reproduce I would like to be able to copy a column from a command listing output and feed it into another command as a sequence of command line arguments. Here's a simple reproduction of the problem: 1. Run Ubuntu Bash via WSL2 in Windows Terminal 2. Type: `ls -l` and press Enter 3. Hold down Alt and drag the mouse to select a column from the listing 4. Command palette > Copy as single line (or use a keyboard shortcut assigned to copy singleLine=true) 5. Type: `echo ` but don't press Enter 6. Paste 7. Press Enter ### Expected Behavior The column should be pasted as a single line, and then printed as a single line by `echo`. ### Actual Behavior Only the first row in the column is pasted as a single line. `echo` prints the first row, then Bash receives the remaining rows as separate lines and tries to run each one. If I use normal selection (not block selection) then Copy as single line does the expected behaviour. The problem is not unique to pasting into Windows Terminal or Bash. The same behaviour happens if I paste into another app, e.g. into VS Code.
claunia added the Issue-BugResolution-Duplicate labels 2026-01-31 06:48:48 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19616