Windows line breaks are ignored when copying text in tmux copy mode #11741

Open
opened 2026-01-31 02:56:09 +00:00 by claunia · 0 comments
Owner

Originally created by @antoineco on GitHub (Dec 9, 2020).

Environment

Windows build number: 10.0.19041.0
Windows Terminal version: 1.5.3242.0 (current Preview version from Microsoft Store)

Ubuntu WSL distribution from the Microsoft Store: 2004.2020.812.0
tmux: 3.0a (from Ubuntu's APT package repo)

Steps to reproduce

1. Open a WSL terminal

2. Run a new tmux session:

$ tmux

3. Generate some output with Windows new lines. (sorry, GitHub automatically replaces these when I copy a sample)

image

4. Press Enter multiple times, until the output disappears from the current window.

5. Enter tmux's copy mode with Ctrl-B [

Note: first Ctrl-B, then [. Not simultaneously

6. Scroll up with arrow keys or PgUp

7. Copy the previously generated output.

8. (optional) Press q to exit tmux's copy mode.

image

Expected behavior

The copied text contains line breaks at the end of each line.

In this case, I'm expecting:

Requests      [total, rate, throughput]         2160005, 11999.77, 11993.84
Duration      [total, attack, wait]             3m0s, 3m0s, 74.73ms
Latencies     [min, mean, 50, 90, 95, 99, max]  221.503µs, 56.511ms, 13.158ms, 159.593ms, 229.792ms, 570.611ms, 2.91s
Bytes In      [total, mean]                     0, 0.00
Bytes Out     [total, mean]                     4423340032, 2047.84
Success       [ratio]                           99.99%
Status Codes  [code:count]                      0:171  200:2159834
Error Set:

Actual behavior

The is the raw pasted text. Notice how new lines are missing:

Requests      [total, rate, throughput]         2160005, 11999.77, 11993.84                                                                                                                                                                                                             Duration      [total, attack, wait]             3m0s, 3m0s, 74.73ms                                                                                                                                                                                                                     Latencies     [min, mean, 50, 90, 95, 99, max]  221.503µs, 56.511ms, 13.158ms, 159.593ms, 229.792ms, 570.611ms, 2.91s                                                                                                                                                                   Bytes In      [total, mean]                     0, 0.00                                                                                                                                                                                                                                 Bytes Out     [total, mean]                     4423340032, 2047.84                                                                                                                                                                                                                     Success       [ratio]                           99.99%                                                                                                                                                                                                                                  Status Codes  [code:count]                      0:171  200:2159834                                                                                                                                                                                                                      Error Set:

ℹ️ Important note: this happens only in tmux's copy mode. After pressing q, copying the same output will work as expected.

Originally created by @antoineco on GitHub (Dec 9, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment Windows build number: `10.0.19041.0` Windows Terminal version: `1.5.3242.0` (current Preview version from Microsoft Store) Ubuntu WSL distribution from the Microsoft Store: `2004.2020.812.0` tmux: `3.0a` (from Ubuntu's APT package repo) # Steps to reproduce 1\. Open a WSL terminal 2\. Run a new tmux session: ```console $ tmux ``` 3\. Generate some output with Windows new lines. _(sorry, GitHub automatically replaces these when I copy a sample)_ ![image](https://user-images.githubusercontent.com/3299086/101629462-b03c3680-3a21-11eb-8b59-df9c3fec3d2f.png) 4\. Press `Enter` multiple times, until the output disappears from the current window. 5\. Enter tmux's copy mode with `Ctrl-B [` > Note: _first `Ctrl-B`, then `[`. Not simultaneously_ 6\. Scroll up with arrow keys or `PgUp` 7\. Copy the previously generated output. 8\. _(optional)_ Press `q` to exit tmux's copy mode. ![image](https://user-images.githubusercontent.com/3299086/101629114-212f1e80-3a21-11eb-9ac9-8ce89f57c9a9.png) # Expected behavior The copied text contains line breaks at the end of each line. In this case, I'm expecting: ``` Requests [total, rate, throughput] 2160005, 11999.77, 11993.84 Duration [total, attack, wait] 3m0s, 3m0s, 74.73ms Latencies [min, mean, 50, 90, 95, 99, max] 221.503µs, 56.511ms, 13.158ms, 159.593ms, 229.792ms, 570.611ms, 2.91s Bytes In [total, mean] 0, 0.00 Bytes Out [total, mean] 4423340032, 2047.84 Success [ratio] 99.99% Status Codes [code:count] 0:171 200:2159834 Error Set: ``` # Actual behavior The is the raw pasted text. Notice how new lines are missing: ``` Requests [total, rate, throughput] 2160005, 11999.77, 11993.84 Duration [total, attack, wait] 3m0s, 3m0s, 74.73ms Latencies [min, mean, 50, 90, 95, 99, max] 221.503µs, 56.511ms, 13.158ms, 159.593ms, 229.792ms, 570.611ms, 2.91s Bytes In [total, mean] 0, 0.00 Bytes Out [total, mean] 4423340032, 2047.84 Success [ratio] 99.99% Status Codes [code:count] 0:171 200:2159834 Error Set: ``` ℹ️ **Important note**: this happens only in tmux's copy mode. After pressing `q`, copying the same output will work as expected.
claunia added the Needs-TriageNeeds-Tag-FixResolution-Won't-Fix labels 2026-01-31 02:56:09 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#11741