shift+select then copy converts line breaks to wraparound padding #183

Closed
opened 2026-01-30 21:44:52 +00:00 by claunia · 8 comments
Owner

Originally created by @mqudsi on GitHub (Mar 12, 2018).

Running 17115:

Copy-and-pasting text from conemu/wsl results in what should be hard line breaks copied as a single line with whitespace spanning the distance from the line break location and the end of the window. This only occurs if the text was selected with shift held down. Selecting the text normally copies the hard line breaks without trailing whitespace as expected.

e.g. for this screenshot:

image

Selecting the text by placing the cursor at the end of the text, depressing the left mouse button, and dragging to the top, then copying results in the following on the clipboard:

mqudsi@ZBook:~/random/fish-shell$ gdb ./build/fish
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./build/fish...(no debugging symbols found)...done.
(gdb) run
Starting program: /home/mqudsi/random/fish-shell/build/fish
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGFPE, Arithmetic exception.
0x000000000056eae8 in std::__detail::_Mod_range_hashing::operator()(unsigned long, unsigned long) const ()
(gdb)

But doing the same with the shift key held down copies the following to the keyboard:

mqudsi@ZBook:~/random/fish-shell$ gdb ./build/fish                                                                                          GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1                                                                                                Copyright (C) 2016 Free Software Foundation, Inc.                                                                                           License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>                                                               This is free software: you are free to change and redistribute it.                                                                          There is NO WARRANTY, to the extent permitted by law.  Type "show copying"                                                                  and "show warranty" for details.                                                                                                            This GDB was configured as "x86_64-linux-gnu".                                                                                              Type "show configuration" for configuration details.                                                                                        For bug reporting instructions, please see:                                                                                                 <http://www.gnu.org/software/gdb/bugs/>.                                                                                                    Find the GDB manual and other documentation resources online at:                                                                            <http://www.gnu.org/software/gdb/documentation/>.                                                                                           For help, type "help".                                                                                                                      Type "apropos word" to search for commands related to "word"...                                                                             Reading symbols from ./build/fish...(no debugging symbols found)...done.                                                                    (gdb) run                                                                                                                                   Starting program: /home/mqudsi/random/fish-shell/build/fish                                                                                 [Thread debugging using libthread_db enabled]                                                                                               Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".                                                                                                                                                                                                              Program received signal SIGFPE, Arithmetic exception.                                                                                       0x000000000056eae8 in std::__detail::_Mod_range_hashing::operator()(unsigned long, unsigned long) const ()                                  (gdb)                                                                                                                                                                                                                                                                                                                                   

Generally speaking, holding down the shift key is used as an indication that the mouse operation should not be passed through to the program running in the terminal, but should otherwise result in the same contents. To be able to select and copy text with a mouse-aware console application running (e.g. vim or tmux).

Originally created by @mqudsi on GitHub (Mar 12, 2018). Running 17115: Copy-and-pasting text from conemu/wsl results in what should be hard line breaks copied as a single line with whitespace spanning the distance from the line break location and the end of the window. This only occurs if the text was selected with `shift` held down. Selecting the text normally copies the hard line breaks without trailing whitespace as expected. e.g. for this screenshot: ![image](https://user-images.githubusercontent.com/606923/37301350-50db72ba-25f6-11e8-8e82-caf381768b8d.png) Selecting the text by placing the cursor at the end of the text, depressing the left mouse button, and dragging to the top, then copying results in the following on the clipboard: ``` mqudsi@ZBook:~/random/fish-shell$ gdb ./build/fish GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./build/fish...(no debugging symbols found)...done. (gdb) run Starting program: /home/mqudsi/random/fish-shell/build/fish [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Program received signal SIGFPE, Arithmetic exception. 0x000000000056eae8 in std::__detail::_Mod_range_hashing::operator()(unsigned long, unsigned long) const () (gdb) ``` But doing the same with the `shift` key held down copies the following to the keyboard: ``` mqudsi@ZBook:~/random/fish-shell$ gdb ./build/fish GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./build/fish...(no debugging symbols found)...done. (gdb) run Starting program: /home/mqudsi/random/fish-shell/build/fish [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Program received signal SIGFPE, Arithmetic exception. 0x000000000056eae8 in std::__detail::_Mod_range_hashing::operator()(unsigned long, unsigned long) const () (gdb) ``` Generally speaking, holding down the shift key is used as an indication that the mouse operation should not be passed through to the program running in the terminal, but should otherwise result in the same contents. To be able to select and copy text with a mouse-aware console application running (e.g. vim or tmux).
Author
Owner

@mqudsi commented on GitHub (Aug 17, 2018):

@zadjii-msft @bitcrazed any chance of taking a look at this? It's still the case in the latest skip forward builds and I'm pretty sure it's a regression from the initial Windows 10 release.

@mqudsi commented on GitHub (Aug 17, 2018): @zadjii-msft @bitcrazed any chance of taking a look at this? It's still the case in the latest skip forward builds and I'm pretty sure it's a regression from the initial Windows 10 release.
Author
Owner

@kissge commented on GitHub (Feb 23, 2019):

Any updates?

Unfortunately, this behavior design is inherited to the new (1809) Ctrl+Shift+C copy experience.
It basically means that there's no shortcut for copying texts, that can also work with multiple lines, which are what most people actually wants.
#65 seems to have discussed a relevant topic.

@kissge commented on GitHub (Feb 23, 2019): Any updates? Unfortunately, this behavior design is inherited to the new (1809) Ctrl+Shift+C copy experience. It basically means that there's no shortcut for copying texts, that can also work with multiple lines, which are what most people actually wants. #65 seems to have discussed a relevant topic.
Author
Owner

@zadjii-msft commented on GitHub (Feb 23, 2019):

Ctrl+c always works to copy text, once you have a selection. The real bug is the fact that the checkbox includes ctrl+shift+c as copy, when really that behavior is unchanged.

When you do have a selection, just press ctrl+c to copy the way you expect. The checkbox merely enables ctrl+shift+v to paste.


From: kissge notifications@github.com
Sent: Saturday, February 23, 2019 7:11:46 AM
To: Microsoft/console
Cc: Mike Griese; Mention
Subject: Re: [Microsoft/console] shift+select then copy converts line breaks to wraparound padding (#130)

Any updates?

Unfortunately, this behavior design is inherited to the new (1809) Ctrl+Shift+C copy experience.
It basically means that there's no shortcut for copying texts, that can also work with multiple lines, which are what most people actually wants.
#65https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2Fconsole%2Fissues%2F65&data=02%7C01%7CMike.Griese%40microsoft.com%7C214f3f67c782430ecc0408d699a13b27%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636865315091048757&sdata=uv1TJHVDmFpOIplh6T90KPtVJ7Lmec5OY9DaZ7Lm0dI%3D&reserved=0 seems to have discussed a relevant topic.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2Fconsole%2Fissues%2F130%23issuecomment-466660794&data=02%7C01%7CMike.Griese%40microsoft.com%7C214f3f67c782430ecc0408d699a13b27%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636865315091058765&sdata=EQqtfxL%2FgEmW5KcM0hyD6CmDenglfxyBGItqhyM1K6E%3D&reserved=0, or mute the threadhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FARgZ1vwehIbMVVQRYeHxcihQcSYPyaTeks5vQVoygaJpZM4SnIdK&data=02%7C01%7CMike.Griese%40microsoft.com%7C214f3f67c782430ecc0408d699a13b27%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636865315091058765&sdata=rpx349ApyTy1PYpSgArWMOsK3byijQh7ykqGolJdRFY%3D&reserved=0.

@zadjii-msft commented on GitHub (Feb 23, 2019): Ctrl+c always works to copy text, once you have a selection. The real bug is the fact that the checkbox includes ctrl+shift+c as copy, when really that behavior is unchanged. When you do have a selection, just press ctrl+c to copy the way you expect. The checkbox merely enables ctrl+shift+v to paste. ________________________________ From: kissge <notifications@github.com> Sent: Saturday, February 23, 2019 7:11:46 AM To: Microsoft/console Cc: Mike Griese; Mention Subject: Re: [Microsoft/console] shift+select then copy converts line breaks to wraparound padding (#130) Any updates? Unfortunately, this behavior design is inherited to the new (1809) Ctrl+Shift+C copy experience. It basically means that there's no shortcut for copying texts, that can also work with multiple lines, which are what most people actually wants. #65<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2Fconsole%2Fissues%2F65&data=02%7C01%7CMike.Griese%40microsoft.com%7C214f3f67c782430ecc0408d699a13b27%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636865315091048757&sdata=uv1TJHVDmFpOIplh6T90KPtVJ7Lmec5OY9DaZ7Lm0dI%3D&reserved=0> seems to have discussed a relevant topic. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2Fconsole%2Fissues%2F130%23issuecomment-466660794&data=02%7C01%7CMike.Griese%40microsoft.com%7C214f3f67c782430ecc0408d699a13b27%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636865315091058765&sdata=EQqtfxL%2FgEmW5KcM0hyD6CmDenglfxyBGItqhyM1K6E%3D&reserved=0>, or mute the thread<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FARgZ1vwehIbMVVQRYeHxcihQcSYPyaTeks5vQVoygaJpZM4SnIdK&data=02%7C01%7CMike.Griese%40microsoft.com%7C214f3f67c782430ecc0408d699a13b27%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636865315091058765&sdata=rpx349ApyTy1PYpSgArWMOsK3byijQh7ykqGolJdRFY%3D&reserved=0>.
Author
Owner

@kissge commented on GitHub (Feb 24, 2019):

Lucky to know that! Thanks for pointing out.

@kissge commented on GitHub (Feb 24, 2019): Lucky to know that! Thanks for pointing out.
Author
Owner

@miniksa commented on GitHub (May 29, 2019):

This goes hand in hand with #174. We don't need two issues to track this weirdness, so closing this one.

@miniksa commented on GitHub (May 29, 2019): This goes hand in hand with #174. We don't need two issues to track this weirdness, so closing this one.
Author
Owner

@mqudsi commented on GitHub (May 29, 2019):

In all fairness, that one wasn't around when I filed this one ;)

Thanks for working on it, @miniksa

@mqudsi commented on GitHub (May 29, 2019): In all fairness, that one wasn't around when I filed this one ;) Thanks for working on it, @miniksa
Author
Owner

@miniksa commented on GitHub (May 29, 2019):

Yeah, true, I know. I just had to pick one and I picked the other one. Hopefully no hard feelings.

@miniksa commented on GitHub (May 29, 2019): Yeah, true, I know. I just had to pick one and I picked the other one. Hopefully no hard feelings.
Author
Owner

@mqudsi commented on GitHub (May 30, 2019):

None whatsoever!

@mqudsi commented on GitHub (May 30, 2019): None whatsoever!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#183