Text selection using keyboard (Shift + arrow keys) #3325

Closed
opened 2026-01-30 23:18:37 +00:00 by claunia · 15 comments
Owner

Originally created by @vineethrp on GitHub (Aug 9, 2019).

Description of the new feature/enhancement

We can currently select text in the terminal by dragging mouse with key pressed. Linux terminals and Windows command prompt allows you to select text by also Shift + arrow keys. I have tried this in the Windows terminal and instead of selecting the texts it just prints characters (Shift + right arrow prints 'D' for me).

Would be great to have the keyboard method for text selection for windows users. Would be very helpful for keyboard heavy users

Update

I checked that powershell on terminal works as expected
cmd on terminal doesn't print extra characters, the cursor just moves instead of selection
WSL prints extra characters (shift + right => D, Shift + left => C, etc)

Originally created by @vineethrp on GitHub (Aug 9, 2019). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement We can currently select text in the terminal by dragging mouse with key pressed. Linux terminals and Windows command prompt allows you to select text by also Shift + arrow keys. I have tried this in the Windows terminal and instead of selecting the texts it just prints characters (Shift + right arrow prints 'D' for me). Would be great to have the keyboard method for text selection for windows users. Would be very helpful for keyboard heavy users ## Update I checked that powershell on terminal works as expected cmd on terminal doesn't print extra characters, the cursor just moves instead of selection WSL prints extra characters (shift + right => D, Shift + left => C, etc)
claunia added the Issue-FeatureArea-InputResolution-DuplicateProduct-Terminal labels 2026-01-30 23:18:37 +00:00
Author
Owner

@cinnamon-msft commented on GitHub (Aug 9, 2019):

I believe this is a duplicate of #715

@cinnamon-msft commented on GitHub (Aug 9, 2019): I believe this is a duplicate of #715
Author
Owner

@mfriedrich74 commented on GitHub (May 22, 2023):

I checked the feature from #715. This is not a duplicate. With above feature, the mentioned Shift + Ctrl + Arrow and Shift + Arrow keys still do not work in all modes. Only works in Powershell. Does not work in Command shell and also not in WSL Bash. Note, that CMD.exe supports those keys, but it works only when used without the terminal.

@mfriedrich74 commented on GitHub (May 22, 2023): I checked the feature from #715. This is not a duplicate. With above feature, the mentioned Shift + Ctrl + Arrow and Shift + Arrow keys still do not work in all modes. Only works in Powershell. Does not work in Command shell and also not in WSL Bash. Note, that CMD.exe supports those keys, but it works only when used without the terminal.
Author
Owner

@bpinske commented on GitHub (Jul 10, 2023):

Yeah mark mode isn't a substitution for this just working as expected in my opinion.

I use a macbook and iterm2 for work and use ctrl shift to highlight, copy, paste text dozens of times a day.
This is a pretty serious UX gap when I try to use WSL/Terminal on my personal computer.

@bpinske commented on GitHub (Jul 10, 2023): Yeah mark mode isn't a substitution for this just working as expected in my opinion. I use a macbook and iterm2 for work and use ctrl shift to highlight, copy, paste text dozens of times a day. This is a pretty serious UX gap when I try to use WSL/Terminal on my personal computer.
Author
Owner

@zadjii-msft commented on GitHub (Jul 10, 2023):

@bpinske have you tried adding a keybinding like:

        { "command": "markMode", "keys": "shift+left" },

That'll just immediately enter mark mode when you hit shift+left. It's like, one extra keystroke, but the UX is effectively the same.

@zadjii-msft commented on GitHub (Jul 10, 2023): @bpinske have you tried adding a keybinding like: ```json { "command": "markMode", "keys": "shift+left" }, ``` That'll just immediately enter mark mode when you hit <kbd>shift+left</kbd>. It's like, one extra keystroke, but the UX is effectively the same.
Author
Owner

@bpinske commented on GitHub (Jul 10, 2023):

I will give that a shot later this evening.
Thanks for the suggestion.

@bpinske commented on GitHub (Jul 10, 2023): I will give that a shot later this evening. Thanks for the suggestion.
Author
Owner

@aliulashayir commented on GitHub (Aug 1, 2023):

I believe this is a duplicate of #715

It is not a duplicate Shift + Ctrl + Arrow and Shift + Arrow keys still do not work in all modes. It only works in Powershell.
Markdown mode isn't enough. When you try to delete selected text with it will just delete the last character in cmd

@aliulashayir commented on GitHub (Aug 1, 2023): > I believe this is a duplicate of #715 It is not a duplicate Shift + Ctrl + Arrow and Shift + Arrow keys still do not work in all modes. It only works in Powershell. Markdown mode isn't enough. When you try to delete selected text with it will just delete the last character in cmd
Author
Owner

@zadjii-msft commented on GitHub (Aug 1, 2023):

@aliulashayir That's entirely a different thing. PowerShell maintains its own "selection" separate from the Terminal's. CMD.exe doesn't implement anything like that. It doesn't know how to backspace multiple characters at a time, and it doesn't know where the Terminal's selection is.

This is an unfortunately weird aspect about the separation between shells and terminals.

@zadjii-msft commented on GitHub (Aug 1, 2023): @aliulashayir That's entirely a different thing. PowerShell maintains its own "selection" separate from the Terminal's. CMD.exe doesn't implement anything like that. It doesn't know how to backspace multiple characters at a time, and it doesn't know where the Terminal's selection is. This is an unfortunately weird aspect about the separation between shells and terminals.
Author
Owner

@aliulashayir commented on GitHub (Aug 2, 2023):

@zadjii-msft Oh, I didn't know that. It is annoying that these are not implemented the same way. I mean in the cmd without the new terminal app you can select with ctrl + shift + arrow key and then ctrl + backspace deletes the selection but you can't do it in the terminal app cmd

@aliulashayir commented on GitHub (Aug 2, 2023): @zadjii-msft Oh, I didn't know that. It is annoying that these are not implemented the same way. I mean in the cmd without the new terminal app you can select with ctrl + shift + arrow key and then ctrl + backspace deletes the selection but you can't do it in the terminal app cmd
Author
Owner

@zadjii-msft commented on GitHub (Aug 2, 2023):

in the cmd without the new terminal app you can select with ctrl + shift + arrow key and then ctrl + backspace deletes the selection

Does it though? ctrl+bksp will delete the previous word, but I don't believe it'll delete the entire selection:

e786f81c-aab1-46f5-bbf5-8b41319bbc52

@zadjii-msft commented on GitHub (Aug 2, 2023): > in the cmd without the new terminal app you can select with ctrl + shift + arrow key and then ctrl + backspace deletes the selection Does it though? <kbd>ctrl+bksp</kbd> will delete the previous word, but I don't believe it'll delete the entire selection: ![e786f81c-aab1-46f5-bbf5-8b41319bbc52](https://github.com/microsoft/terminal/assets/18356694/0efaaaec-ba1a-43b1-969c-5cd26412438e)
Author
Owner

@aliulashayir commented on GitHub (Aug 2, 2023):

@zadjii-msft Yes sorry I meant this but wrote it incorrectly. Still, this is better than nothing. For example, this is still useful when you are using a tool like yt-dlp and want to quickly delete a URL or something it is treated like a single word selection. I use, copy&paste URL s a lot so it is a nice to have
ezgif-3-34dca50bec

@aliulashayir commented on GitHub (Aug 2, 2023): @zadjii-msft Yes sorry I meant this but wrote it incorrectly. Still, this is better than nothing. For example, this is still useful when you are using a tool like yt-dlp and want to quickly delete a URL or something it is treated like a single word selection. I use, copy&paste URL s a lot so it is a nice to have ![ezgif-3-34dca50bec](https://github.com/microsoft/terminal/assets/57371604/7157fc16-011d-4d52-9566-07c78bc4a4e4)
Author
Owner

@zadjii-msft commented on GitHub (Aug 2, 2023):

I mean, Ctrl+Bksp will delete the previous "word" in CMD regardless of having text selected or not (in both Terminal and conhost).

@zadjii-msft commented on GitHub (Aug 2, 2023): I mean, <kbd>Ctrl+Bksp</kbd> will delete the previous "word" in CMD regardless of having text selected or not (in both Terminal and conhost).
Author
Owner

@aliulashayir commented on GitHub (Aug 3, 2023):

yes but can't select copy it though on Terminal cmd because you can't select the word and I guess not seeing the text highlighted just messes with my muscle memory. It is just a bit annoying that Powershell, cmd, wsl are different. Not a big problem. Thank you for your answers. I really appreciate that someone who works on the project takes the time to answer 🥇

@aliulashayir commented on GitHub (Aug 3, 2023): yes but can't select copy it though on Terminal cmd because you can't select the word and I guess not seeing the text highlighted just messes with my muscle memory. It is just a bit annoying that Powershell, cmd, wsl are different. Not a big problem. Thank you for your answers. I really appreciate that someone who works on the project takes the time to answer 🥇
Author
Owner

@levicki commented on GitHub (Jul 18, 2024):

@zadjii-msft Is there a way this can be implemented? It's really annoying not to be able to use Shift+arrow keys (standard LUA shortcuts for text editing for like at least 3-4 decades now).

@levicki commented on GitHub (Jul 18, 2024): @zadjii-msft Is there a way this can be implemented? It's really annoying not to be able to use Shift+arrow keys (standard LUA shortcuts for text editing for like at least 3-4 decades now).
Author
Owner

@BWWIT commented on GitHub (Nov 9, 2024):

@aliulashayir That's entirely a different thing. PowerShell maintains its own "selection" separate from the Terminal's. CMD.exe doesn't implement anything like that. It doesn't know how to backspace multiple characters at a time, and it doesn't know where the Terminal's selection is.

This is an unfortunately weird aspect about the separation between shells and terminals.

But you can select text with shift+arrow-keys in the legacy cmd prompt (W10)!
That contradict the above statement, that it's not possible to get the functionality with cmd.

@BWWIT commented on GitHub (Nov 9, 2024): > [@aliulashayir](https://github.com/aliulashayir) That's entirely a different thing. PowerShell maintains its own "selection" separate from the Terminal's. CMD.exe doesn't implement anything like that. It doesn't know how to backspace multiple characters at a time, and it doesn't know where the Terminal's selection is. > > This is an unfortunately weird aspect about the separation between shells and terminals. But you can select text with shift+arrow-keys in the legacy cmd prompt (W10)! That contradict the above statement, that it's not possible to get the functionality with cmd.
Author
Owner

@myudak commented on GitHub (Nov 28, 2024):

so this will neer implemented?? why is this closed

@myudak commented on GitHub (Nov 28, 2024): so this will neer implemented?? why is this closed
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3325