Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way to select text across lines as a single line in the Windows command prompt? For example, selecting this rectangular selection:

alt text

puts two separate lines in the clipboard, even though the lines are contiguous. Doing the same thing in xterm on Linux will put one line on the clipboard, which is what I want. Is there a way to get cmd.exe to behave like xterm?

share|improve this question
    
Alternatives: stackoverflow.com/questions/473839/… –  hyperslug Jul 25 '10 at 23:03

5 Answers 5

You can export to a text file and then do as you like. when you do your command, run it as:

[executable] >textfile.txt

This will output to the specified file anything the exe would output to the screen.

share|improve this answer

use a terminal such as Console2 to run your cmd.exe (or powershell.exe) from. such terminals offer (among other things) superior selecting mechanisms.

share|improve this answer

Windows' cmd application is a very very basic tool. It's not intended to be used like the power-user's do-all swiss army knife that is the Linux terminal.

So basically, no, you can't grab multiline selects as a single line. Sorry.

share|improve this answer
    
Well.. Copy them, and format them in 1-2 second with Notepad++. Hard-stuff if you are a so-called "poweruser". –  Shiki Jul 26 '10 at 11:24
1  
I wouldn't call the cmd a "very very basic tool"...I'd call it crippled...especially in comparison with Linux Shells. –  Bobby Jul 26 '10 at 11:26
    
This doesn't excuse cmd's awkward selection behavior. There are no other programs that I know which select text as a rectangular area rather than a string of characters, no matter how basic. –  Lèse majesté Apr 3 '12 at 2:03

Installing cygwin will solve all your problems:)

share|improve this answer
4  
and introduce new ones :) –  akira Jul 28 '10 at 13:04
    
copy style from cygwin is exactly the same AFAIK... –  Betlista Jan 28 '13 at 14:13

There's no way to do that using cmd.exe, but you can use a console emulator. I am specially fond of ConEmu, which gives you several enhancements such as:

  • Better text selection
  • Multiple consoles in tabs
  • Resizable windows
  • Fullscreen mode
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.