How to copy text from Console2?

208

28

I just started using Console2 as an alternative to cmd.exe

I can't figure out how to copy text from the console to the clipboard -- dragging over it with the mouse won't mark anything, and there is no option in the right-click menu to "mark" as in cmd.exe

It must be terribly obvious but I guess I'm overlooking it... :(

GJ.

Posted 2010-04-19T22:26:40.823

Reputation: 8 151

2Console2 is not an alternative to cmd. It's just a different front-end for whatever console application you happen to run. – Joey – 2010-04-20T08:05:25.623

I don't think Console2 works for any console other than cmd.exe.

IIRC, the strange mouse behavior is because cmd.exe actually handles all of the window drawing itself, rather than using the standard windows APIs. As a result, it's behavior is a bit anachronistic. – Fake Name – 2010-04-20T09:46:01.960

3@Fake Name: (delayed comment) cmd.exe is a shell; it doesn't do any window drawing, only parses commands. The window it uses is a "Win32 Console" window. Console2 is a "console" or "terminal", a replacement for the ugly Win32 Console windows; the delay is because it has to poll a hidden "real" console window for changes. – user1686 – 2011-03-11T20:49:49.757

2@FakeName, I use Console2 as a front end for 3 different terminals: cmd.exe, cygwin and Git Bash. The mouse seems to behaviour seems to be related – Drew Noakes – 2012-10-04T09:34:53.480

Answers

212

Open Console2 menu Edit -> Settings, and in the Hotkeys / Mouse settings configure the selection and copy actions. The defaults are a bit wonky.

I use:

  • Left mouse button = select
  • Ctrl+C = copy
  • Ctrl+V = paste
  • ESC = clear selection

Make sure you press 'Assign' after each change you make otherwise it won't take effect.

Last note: Beware if you use ESC or Ctrl+V in vim, or in any other app.

invert

Posted 2010-04-19T22:26:40.823

Reputation: 4 918

2Well this did not really work. I am still not able o select the text. The entry about holding shift helped though. – homaxto – 2010-08-25T12:29:39.790

2This configuration works great on my copy of Console2. Make sure that no other binding takes the Left-click action. – invert – 2010-08-31T13:05:59.060

6Works for me too. I actually have Left mouse button both for selecting text and copy/clear. – Peter Jaric – 2011-05-13T12:07:27.037

Works great for me too. Unfortunately I couldn't get Enter to work for Copy/Clear selection (like in Windows Console windows), because then you can't press Enter to execute a command ;) – OregonGhost – 2012-07-25T15:41:38.760

1Ha ha that is true. Good catch! I still prefer the sane defaults updated above :-) – invert – 2012-07-27T07:33:06.330

2I'm not sure if you need to assign "ESC" to clear selection. The selection seems to get cleared when you left-click again. I also have "Clear selection on copy" option checked. I usually like to use ESC key to clear commands in cmd.exe so I have not assigned any action to that key. – blissfool – 2013-02-18T19:25:20.650

@Homaxto It seems like you didn't actually update your settings, the shift-click thing is the default setting -- make sure you click the item you want to update, change the hotkey value to the new value and then click the "Assign" button. – BrainSlugs83 – 2013-11-24T00:56:28.117

Why those are not the default keys\buttons already?? Much more intuitive. Thank you. – Pedro77 – 2014-01-13T12:41:37.000

65

Holding SHIFT and marking the text should do the trick (at least for me). After this just click Edit -> Copy

stex

Posted 2010-04-19T22:26:40.823

Reputation: 943

@GJ., that's due to the Select on copy option being checked. – Drew Noakes – 2015-02-24T09:31:23.810

4Thanks! For me though it auto-copies it as soon as I finish marking the selection. – GJ. – 2010-04-21T07:28:17.263

This works for me, but it must be a bug that only affects some people (2.00.148). On a previous machine, this wasn't required, and the UI doesn't indicate that SHIFT should be necessary. – John Hatton – 2014-04-04T16:19:20.250

13

Console2's key and mouse assignment is a bit funky. Here's how to actually make left_click == select text:

  1. Open the Edit->Settings->Hotkeys->Mouse submenu.
  2. Select the "Select text" item. Then change the "Button:" line to be "Left" and un-check all three Modifiers boxes.
  3. Then click "Assign" - without this step none of your changes will actually take effect.

svec

Posted 2010-04-19T22:26:40.823

Reputation: 630

4

You can also just configure Select Text: Left Mouse Button

and then enable "Copy on select" on the "Behavior" tab under settings.

crusherjoe

Posted 2010-04-19T22:26:40.823

Reputation: 41

3

Console2 is not a shell. It is a console window enhancement. You can configure Console2 to run any shell you want such as cmd.exe or bash.

By default I believe the copy-paste functionality within the Console2 window is:

Select Text: Shift + Left Mouse Button
Copy Text: Left Mouse Button
Paste Text: Middle Mouse Button

note: by default, the right mouse button brings up a menu that allows you to configure Console2

You must Select and Copy text (by clicking the Left Mouse Button after you're done selecting). Simply selecting text does not copy it automatically (like the default windows console quick edit settings does).

randomfigure

Posted 2010-04-19T22:26:40.823

Reputation: 131

2

  • Make sure Behaviour > Copy on select is unchecked
  • In Hotkeys > Mouse set the following (note, press Assign after changing settings to save them)
    • Copy/clear selection : Right
    • Select text : Left
    • Paste text : Right
    • Drag window : Middle
    • Context menu : Right + Ctrl

With this setup:

  • Dragging with Left mouse will select
  • With text selected:
    • Right click on selected text will copy it
    • Left or Right click anywhere else will clear selection without copying
  • Right click will paste unless there is text selected

This setup is the nearest I could get to the usual cmd Quick Edit mode operations so it doesn't confuse my muscle memory, but it has the advantage that you can dismiss selections without copying.

Sam Hasler

Posted 2010-04-19T22:26:40.823

Reputation: 170

this is the dream setup! – Bobo – 2013-01-18T20:24:56.357

2

Yes, Console2 is just a front-end and I also use it with msys bash, powershell, and the basic cmd.exe. The shortcuts may be the same for more than one function (I have left mouse button for select and clear selection). However, the default in the "behavior" tab in the settings defines BOTH automatic copy on select AND clear selection on copy, so it will look like the selection is immediately being discarded (the text is still being properly copied though). Just uncheck the clear selection on copy and the selected text will stay highlighted.

Console2 is pretty great btw :)

El Ninja Trepador

Posted 2010-04-19T22:26:40.823

Reputation: 121

2

Click + Hold Shift does the highlighting as you probably think.

httpete

Posted 2010-04-19T22:26:40.823

Reputation: 121

1This is just a copy of another answer – DavidPostill – 2014-09-27T20:09:35.197

1Well DavidPostill, it's a long post and I couldn't find it. I have struggled with this seemingly obvious thing and I hoped to help someone else. – httpete – 2014-09-28T01:08:36.157

1

I completed the settings above, and found that console2 select fails sometimes, i.e. on a particular console2 screen I can select some text but some text won't select.

The answer was a window sizing bug. If you start console2 then drag the window to be taller, you may find that anything below the original lower border of the screen is not selectable. If you drag the bottom edge of the console up and down a little, it seems to correct itself.

incircuitous

Posted 2010-04-19T22:26:40.823

Reputation: 11

1

The default settings are awkward. I like these:

enter image description here

enter image description here

Colonel Panic

Posted 2010-04-19T22:26:40.823

Reputation: 9 529