Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: [SOLVED] copying multiline code from cmd.exe with reasonable newlines

by LanX (Saint)
on Jun 02, 2017 at 23:12 UTC ( [id://1192022]=note: print w/replies, xml ) Need Help??


in reply to Re: [SOLVED] copying multiline code from cmd.exe with reasonable newlines
in thread [SOLVED] copying multiline code from cmd.exe with reasonable newlines

Well I understand your bewilderment better than I understand cmd.exe, but let me try: ;-)

First of all copying is totally different to a xterm.

In xterm you have a one dimensional copy, the complete lines between start and end-mark are copied and no newlines are included between automatically wrapped-over lines.

In cmd.exe you have only (AFAIK) a rectangular copy. So if you want to copy a command which was wrapped over you need to start your selection to the very left and span to the right edge. And if you do [ENTER] instead of [SHIFT ENTER] you'd get newlines included at every right end, even if it was an automatic wrap in the middle of a word.

like

D:\Users\lanx>perl -e "$_='x';print;print;print;print;print;print;prin +t;print;print;print;print;print;print;pri nt;print" xxxxxxxxxxxxxxx

Of course you can't really copy long commands with random newlines and expect to execute them right away.

That's why you quickly get into the habit to use [SHIFT ENTER] and no newlines are included.

D:\Users\lanx>perl -e "$_='x';print;print;print;print;print;print;prin +t;print;print;print;print;print;print;print;print"

Colleagues showed me once [SHIFT ENTER] and only [SHIFT ENTER] and I stuck with this.

cmd.exe is - from what I know - not very short cut friendly.

You need to mix mouse and and keyboard actions and are happy for any help.

I suppose power-shell is better in this respect, I'll try it out one day.

HTH explaining the confusion a bit! :)

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

PS: in hindsight it seems very off-toppic, but I wasn't sure if some HTML voodoo was interfering here.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1192022]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-03-29 14:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found