Hello,
I'm using tmux on Linux machines and ConEmu on Windows machines and I really love that I can do text selection with the keyboard.
In ConEmu, there is a keybinding for "Start text selection (like text editors)", whereas in tmux there is the same thing with <prefix><b> (I think that is default), where I get a cursor that I can move with the arrow keys around the console window.
While doing this, I can select text while holding shift and (in case of ConEmu) press ENTER to copy the text into the clipboard and end the text selection.
It can also be compared with Vim's visual mode.
It would be nice if the new Windows Terminal could support this out of the box, so I can use it in e.g. PowerShell :-)
@carlos-zamora this may be of interest
Also, if the tmux property _mouse-mode_ does not work in the new Terminal.
It works well in conhost.
One possible implementation would be just to do what cmd does, where if the user has selected text and presses "Enter", it will just copy the selected text to the clipboard.
Or maybe it would be possible to let the application running control what's happening when marking...
Or that the user can change between the "cmd mode" and other things
If keyboard text selection is added, please don't forget about things like Shift+Home and Shift+End.
You could also have a selection go up and down a line/row with Shift+Up and Shift+Down.
Oh and with all these ligatures, copying and pasting text should probably uncombine those ligature characters - so the font choice does not affect what may get pasted in another place.
Added the "Help-Wanted" label. Most of this work should be able to go in TermControl (probably KeyDownHandler()). If the selection is active, edit the Terminals _endSelectionPositionAnchor by using _terminal->SetEndSelectionPosition(terminalPosition);
Terminals _ExpandWideGlyphSelectionLeft() and _ExpandWideGlyphSelectionRight() can be used to expand the selection on wide glyphs appropriately. We'd just have to make them public or have something else call them.
Terminal is slowly driving me crazy because unlike ConEmu pressing
One fun wrinkle--PSReadLine handles buffer selection and navigation for Windows PowerShell and PSCore. So if this does get implemented, there should also be an option to disable it per-profile, so a shell can handle selection itself.
@pingzing I'm also using PSReadLine, but I'm unaware of the feature. Can you give me a hint? (can't find any documentation on this).
What I'm talking about in this issue is the following (beware awesome screencapturing):

I think it only works for the input buffer, and not previously-written text. No idea if it's documented, but it's definitely in the keybindings. For example, invoking Get-PSReadLineKeyHandler yields the following for me:
Selection functions
===================
Key Function Description
--- -------- -----------
Ctrl+a SelectAll Select the entire line. Moves the cursor to the end of the line
Shift+LeftArrow SelectBackwardChar Adjust the current selection to include the previous character
Shift+Home SelectBackwardsLine Adjust the current selection to include from the cursor to the end of the line
Shift+Ctrl+LeftArrow SelectBackwardWord Adjust the current selection to include the previous word
Shift+RightArrow SelectForwardChar Adjust the current selection to include the next character
Shift+End SelectLine Adjust the current selection to include from the cursor to the start of the line
Shift+Ctrl+RightArrow SelectNextWord Adjust the current selection to include the next word
My fear is that if Terminal implements this, it'll interfere with PSReadLine's own handling. ConEmu has similar behavior, which I have to disable if I want PSReadLine's behavior.
One possible implementation would be just to do what cmd does, where if the user has selected text and presses "Enter", it will just copy the selected text to the clipboard.
I completely agree. I'm hitting this issue several times a day with Windows Terminal. After using cmd and ConEmu for years, I have been always using copy from text selection by pressing "ENTER", but the fact that Windows Terminal doesn't replicate that existing behavior is quite a burden so far. I'm constantly loosing my selection by pressing enter while I should not but use right mouse click. I really love Windows Terminal, but the missing legacy behavior of "ENTER" for copy is really hurting my productivity (I'm probably also starting to feel old that my brain is not able to quickly adapt to the new mouse right click, but that's a different story! 馃槄)
Is there any implementation problems to allow "ENTER" on copy - even if it is not the default but we can turn it on via config?
I agree with @xoofx on all.
Also asked-for here: https://twitter.com/Larswa/status/1203458135245107206
Is there any implementation problems to allow "ENTER" on copy - even if it is not the default but we can turn it on via config?
If you're going to support it, please do not add _only_ copy on ENTER. I cannot stand that. BUT, since others swear by it, and everyone either _loves_ or _hates_ each possibility, there is only one solution: Leave it to the user!
Given that you have already enabled a way to control copy/paste, I assume I don't need to say this but because it will make a difference in whether people continue to use and even love Windows Terminal.
Bonus points for also supporting mouse buttons (e.g. middle and custom specialty buttons) with or without modifier keys (shift+button to copy, button to paste). Again, unlock the possibilities and leave it to the user to customize. <3
It would be great to have text selection movement configurable. For example if someone want to configure it as in VIM's visual mode ('w' for word forward, 'b' for backsword ...)
We're not planning on adding enter as copy by default. The user is absolutely free to add that keybinding if they'd like though.
Configuring what the mouse buttons do is currently tracked by #1553.
I see @cinnamon-msft set this for v2. Any expectations on when we can see v2 even as beta? A rough estimate would be fine.

Due by May 31, 2021
@mahmoudajawad
@mahmoudajawad We basically release features as they're developed. When we say this is in the 2.0 milestone, that just means we want to get to it before 2.0 ships, sometime next year. When there's a more concrete timetable, we'll update the milestone accordingly (e.g. if it's going to land in the 1.6 release, we'll move it to that milestone).
I'm used to press "Shift + Arrow" (+Ctrl to jump words or Home, End, PgUp, PgDn) keys, what allow me to instantly select any text in terminal window and "Ctrl+C/Ctrl+V" to copy/paste in a very simple and fast manner (like in any text editor).
That behavior is available in ConEmu. And it's common keyboard shortcuts behavior in all CUA appliactions what is majority in Windows, Linux, MacOS (basicaly almost every GUI app).
It would be great to use same hotkeys for all apps on ones pc - less overhead about keyboard shortcuts more concentration on work. It would be even greater to have this in Windows Terminal.
Shift + Arrow / Home / End is working in Powershell but not for WSL. When I hit Shift + Home / End in WSL this sequence is pasted: [1;2H and [1;2F respectively.
Is there a way to configure WSL to work the same as Powershell?
@sinapis I'm pretty sure that's just how bash works. PowerShell manually handles the shift+home keys to highlight text, while bash doesn't know how to handle then, and just echos part of the keys to the input line. From some simple searching, it looks like this is a tricky issue with linux shells: here's one post, here's another.
Frankly, both of those don't seem to list any solutions I'd be happy with, so I think your best bet would be to wait for this to land, so the Terminal can take care of this for you 馃槈
Has this been implemented yet?
@ofek Nope. This issue is still open, the spec (#2840) is still in review, and the PR (#3758) is still open. We'll make sure to update this thread when there is. In the meantime, might I recommend the Subscribe button?

That way you'll be notified of any updates to this thread, without needlessly pinging everyone on this thread 鈽猴笍
Most helpful comment
I completely agree. I'm hitting this issue several times a day with Windows Terminal. After using cmd and ConEmu for years, I have been always using copy from text selection by pressing "ENTER", but the fact that Windows Terminal doesn't replicate that existing behavior is quite a burden so far. I'm constantly loosing my selection by pressing enter while I should not but use right mouse click. I really love Windows Terminal, but the missing legacy behavior of "ENTER" for copy is really hurting my productivity (I'm probably also starting to feel old that my brain is not able to quickly adapt to the new mouse right click, but that's a different story! 馃槄)
Is there any implementation problems to allow "ENTER" on copy - even if it is not the default but we can turn it on via config?