Windows 10 and line wrapping selection?

May 20, 2008
Syracuse, NY, USA
I have this in my console.

Line wrapping selection is enabled. If I select/copy the first two lines it looks like it line-wrapped right up to the last 'x'. But when I past it into TextPad I get two lines (i.e., it's not wrapped).
v:\> echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
OTOH, if I select/copy the 3rd and 4th lines, it (again) looks like it line-wrapped, and when I paste into TextPad it is wrapped.
Does anyone know what's going on there? I wouldn't expect Windows to know the difference between selecting/copying a command line versus selecting/copying output.
May 20, 2008
Syracuse, NY, USA
And when I perform the same experiment with CMD, both are line-wrapped when pasted into the editor.
May 20, 2008
Syracuse, NY, USA
Here it is again ... selecting all four lines in TCC and pasting into TextPad.

And doing the same in CMD.
May 20, 2008
Syracuse, NY, USA
One more time, this time all in one console, with no color, and smaller. I'm a bit amazed. What's in the console screen buffer is what's in the console screen buffer (yes/no?). Yet it seems to matter (1) who put it there and (2) whether it's command line or output. When it's a TCC command line it doesn't get wrapped. Below, all the text selected/copied at once with with left-drag/right-click and pasted into TextPad with Ctrl-V.

May 20, 2008
Syracuse, NY, USA
does it do the same if you use @repeat[x,screen buffer width]

I don't know, but I now seem to recall that TCC doesn't write the command line to stdout (while CMD does). That's good for us because it gives us much greater control over what happens on the command line. I also suppose that the Windows line wrapping selection mechanism only deals with what was written to stdout (and stderr?). That mechanism MUST involve more than just reading the console screen buffer because newlines don't don't make it into that buffer.

This doesn't bother me often ... only when, after spending a lot of time constructing a long command line, I want to copy that command line and paste it into my savedcommands.txt for future reference. That usually happens when I'm dealing with regular expressions, WMI queries, or Windows admin utilities with complicated syntax (that I don't use often enough to remember).
Aug 23, 2010
The copy behavior depends on the type of terminal used. Old native console don't have the notion of "wrapped text", the new (win8+) console have something like this, but the behavior is erratic.
I would suggest not wasting your time trying to comprehend it.
Similar threads
Thread starter Title Forum Replies Date
D Open Windows 10 Photos app from command line Support 11
M Starting Windows GUI programs from the command line... Support 10
J Crash on Windows 10 Support 0
thorntonpg windows 11 Support 12
vefatica Windows 10 themes Support 0
J Take command does not start on Windows 10 Support 3
D How to? Windows Key-Left and Windows Key-Right Support 9
Joe Caverly PYTHON from Microsoft Windows Store Support 2
vefatica Windows Terminal ... Pop-up location Support 1
Joe Caverly Windows Terminal and @SELECT Support 13
vefatica Console popup windows don't work correctly Support 0
D Layout debugger windows Support 2
L LIST's pop-up search loses focus in a Windows Terminal window Support 15
nickles ANSI Colors Windows 7 no longer working Support 6
S Windows Server version not being detected correctly in TCMD 26RC2 Support 9
D Which is the latest version for Windows XP? Support 2
rconn News Windows 7 Support Support 0
Joe Caverly Windows Size is 80x0 Support 2
rconn Dropping Windows 7 support in Take Command / TCC v26 Support 8
G Taskbar Windows 10 Support 7
T Windows Terminal Support 2
Joe Caverly Windows Sensor Support 5 New Problem with later Windows 10 Support 10
CWBillow Upgrade Windows 10's effect on TCMD and TCC Support 3
T Take Command v21 on Windows Server Support 1
Bill de Haan "Sensitive Privilege Use" in Windows security auditing Support 7
Joe Caverly Create Windows Jobs and optionally attach processes to a job Support 17
Joe Caverly What version and Windows OS are you using? Support 3
A Windows 10 This app can't run on your PC Support 2
G 4NT on Windows 10 Support 3
vefatica Undesired scrolling in Windows 10 enhanced console. Support 2
vefatica Windows 10 version number? Support 6
vefatica How do I see Windows 10's ANSI in action? Support 3
A List windows with titles matching given pattern? Support 2
M New "pinned" attribute (since Windows 10 1709) Support 6
Emilio III TCMD Tab titles on Insider Windows Support 2
kb6ojs Want to start TCMD v20 with every Windows 10 bootup Support 3
E Cannot paste dollar sign into TCC on Windows 10 1803 Support 7
M TCC incorrect dir output since Windows 1803 Support 6
G Version 20.11 installed on Windows 10 problems Support 9 TCC v22 & the Windows 10 Console Support 5
Per TCC/LE 14 64-bit won't start on Windows 10 Insider Preview 17063 (171213) Support 12
I tcmd versus tcc in Windows 10 Support 2
Dick Johnson DrawBox now broken in Windows 10? Support 6
CWBillow Editing in the root directory of windows 10 Support 6
CWBillow Clearing out the Windows Temp folder Support 2
H New command not working well in Windows 7 Support 4
H _winver shows 6.1 on windows 7 Support 7
Joe Caverly Windows x64 Support 4
mscheuner TCMD 20 on Windows 10 - always loosing its settings Support 1

Similar threads