23

I find it quite infuriating how hard is to actually copy text in text only environments: Powershell and cmd. How can I simply select rows of text, not blocks of text? How did they came up up and think that block of text is more of a default option for selecting text?

Ending the rant, is a there a way to have a simple "select text, copy text" in Powershell or cmd?

For example, if I want to select MY TEXT here:

asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd MY
TEXT asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd a

and I block-select the two rows, I get 'asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd MY\nTEXT asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd a' (also, note the annoying \r\n) instead of the simple 'MY TEXT'

6
  • you say not selecting a block but how about selecting a block by clicking at the far left, pushing the mouse to the far right and dragging down, then you are selecting rows.
    – barlop
    May 5, 2012 at 10:17
  • nope, i'm selecting far more than I want if, for example. see edit
    – pistacchio
    May 5, 2012 at 10:21
  • Pretty sure this is a duplicate, but the reasoning behind block select, I assume, is because many traditional DOS/CLI apps have ASCII-based TUIs (e.g. Norton Commander) that would be impossible to select text from using non-block selection. However, this is a pretty rare use-case these days, so they should still have at least added the option for normal text selection. May 5, 2012 at 12:45
  • mintty does but afaik mintty is only for cygwin
    – barlop
    May 7, 2012 at 4:19
  • in Windows 10 line selection is the default
    – phuclv
    Mar 29, 2017 at 13:04

3 Answers 3

19

You need to use modifier key while selecting to activate the feature.

Hold ALT and Left Mouse Button while dragging your mouse over the text to be selected.

5
  • 11
    You can make line-select as the default. 1. Go to Power Shell Properties (right-click on the window title and select "Properties") 2. In the first tab, check the box "Enable line wrapping selection". 3. Hold ALT while dragging your mouse over the text to be selected. Source: Anonymous Mar 29, 2017 at 11:19
  • The above does not work in Windows 7, where the PowerShell behaves exactly as cmd.exe.
    – RCross
    Feb 23, 2018 at 10:32
  • @RCross So is the 'normal' selection mode enabled by the default? Does windows 7 require a separate solution? Feb 23, 2018 at 14:35
  • Yes; although I'm not aware of any native solution.
    – RCross
    Feb 28, 2018 at 9:24
  • 1
    Ok - there is a workable solution, which is to use the PowerShell ISE instead of the PowerShell terminal. It's been a while since I've used Windows 7 ;-)
    – RCross
    Feb 28, 2018 at 10:58
2

Theres no direct way in window's console window to do this, but you can get exactly the behavior you want from console2, it also has a lot of other features that the default console window SHOULD have but doesn't. Note that this is not a replacement for cmd.exe, but rather, a replacement for the console window in which cmd.exe runs. You can use any console app as the shell (like powershell, etc). Here's the link to it

1
1

In Windows 7, rather than using Powershell.exe, use Powershell ISE which has line-selection enabled by default.

If you particularly want block-select, hold ALT and use the Left Mouse Button to revert to the cmd.exe-style behaviour.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .