Ability to select/copy all the text in the session #1985

Closed
opened 2026-01-30 22:43:35 +00:00 by claunia · 22 comments
Owner

Originally created by @mrmlnc on GitHub (Jun 23, 2019).

Originally assigned to: @carlos-zamora on GitHub.

Summary of the new feature/enhancement

Sometimes there are situations when you need to select/copy all the text in the session.

ConEmu has such functionality (MenuEditCopy All).

Proposed technical implementation details (optional)

  • Keybinding for action Select All Text.

May intersect with #715.

Originally created by @mrmlnc on GitHub (Jun 23, 2019). Originally assigned to: @carlos-zamora on GitHub. # Summary of the new feature/enhancement Sometimes there are situations when you need to select/copy all the text in the session. > ConEmu has such functionality (`Menu` → `Edit` → `Copy All`). # Proposed technical implementation details (optional) * Keybinding for action `Select All Text`. May intersect with #715.
Author
Owner

@carlos-zamora commented on GitHub (May 13, 2020):

I should add this to the #4993 scenario.

@carlos-zamora commented on GitHub (May 13, 2020): I should add this to the #4993 scenario.
Author
Owner

@swinder0161 commented on GitHub (Sep 26, 2020):

@carlos-zamora what is the plan for this feature? Looks like an important feature.
Select by mouse/trackpad works. Adding by keyboard short cut would be easy to use.

@swinder0161 commented on GitHub (Sep 26, 2020): @carlos-zamora what is the plan for this feature? Looks like an important feature. Select by mouse/trackpad works. Adding by keyboard short cut would be easy to use.
Author
Owner

@theswordsmahin commented on GitHub (Nov 3, 2020):

For what its worth and to whomever finds this useful, if you zoom out really far with ctrl + scroll wheel highlighting the complete buffer is much less painful even for relatively long histories. Not ideal of course, workable.

@theswordsmahin commented on GitHub (Nov 3, 2020): For what its worth and to whomever finds this useful, if you zoom out really far with ctrl + scroll wheel highlighting the complete buffer is much less painful even for relatively long histories. Not ideal of course, workable.
Author
Owner

@sba923 commented on GitHub (Mar 7, 2021):

Make sure one can choose between plain text and formatted text e.g. with colors. MobaXterm supports saving as RTF, preserving formatting.

@sba923 commented on GitHub (Mar 7, 2021): Make sure one can choose between plain text and formatted text e.g. with colors. MobaXterm supports saving as RTF, preserving formatting.
Author
Owner

@DHowett commented on GitHub (Mar 7, 2021):

We already support RTF and HTML copy, @sba923 :)

@DHowett commented on GitHub (Mar 7, 2021): We already support RTF and HTML copy, @sba923 :)
Author
Owner

@sba923 commented on GitHub (Mar 7, 2021):

Typing my comment, on my phone, I kinda remembered reading about this somewhere... 😝 I promise I will check out the docs first thing in the morning 😜

@sba923 commented on GitHub (Mar 7, 2021): Typing my comment, on my phone, I kinda remembered reading about this somewhere... 😝 I promise I will check out the docs first thing in the morning 😜
Author
Owner

@sba923 commented on GitHub (May 5, 2021):

We already support RTF and HTML copy, @sba923 :)

I know, but you can't choose dynamically.

You have to define this in the settings. So it's either "always formatted" or "always plain text."

Being able to choose between formatted copy or unformatted copy e.g. by using two different key bindings would be nice.

Or maybe the choice should be at paste time, not at copy time. (I know, one day Win+V will allow pasting the plain-text version of whatever's on the clipboard. But this is not yet for corporate systems running non-Insider Windows 10 builds 😉).

@sba923 commented on GitHub (May 5, 2021): > We already support RTF and HTML copy, @sba923 :) I know, but you can't choose dynamically. You have to define this in the settings. So it's either "always formatted" or "always plain text." Being able to choose between formatted copy or unformatted copy e.g. by using two different key bindings would be nice. Or maybe the choice should be at _paste_ time, not at _copy_ time. (I know, one day Win+V will allow pasting the plain-text version of whatever's on the clipboard. But this is not yet for corporate systems running non-Insider Windows 10 builds 😉).
Author
Owner

@DHowett commented on GitHub (May 5, 2021):

Or maybe the choice should be at paste time, not at copy time.

That's completely up to the app reading the clipboard. Can't do anything about that.

Being able to choose between formatted copy or unformatted copy e.g. by using two different key bindings would be nice.

You mean like...

{ "command": { "action": "copy", "copyFormatting": "rtf" }, "keys": "ctrl+shift+r" },
{ "command": { "action": "copy", "copyFormatting": "html" }, "keys": "ctrl+shift+h" },
{ "command": { "action": "copy", "copyFormatting": ["html", "rtf"] }, "keys": "ctrl+win+alt+shift+h" },

? From the docs for the copy action.

@DHowett commented on GitHub (May 5, 2021): > Or maybe the choice should be at paste time, not at copy time. That's completely up to the app _reading_ the clipboard. Can't do anything about that. > Being able to choose between formatted copy or unformatted copy e.g. by using two different key bindings would be nice. You mean like... ```json { "command": { "action": "copy", "copyFormatting": "rtf" }, "keys": "ctrl+shift+r" }, { "command": { "action": "copy", "copyFormatting": "html" }, "keys": "ctrl+shift+h" }, { "command": { "action": "copy", "copyFormatting": ["html", "rtf"] }, "keys": "ctrl+win+alt+shift+h" }, ``` ? From the [docs for the copy action](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/actions#copy).
Author
Owner

@sba923 commented on GitHub (May 5, 2021):

Or maybe the choice should be at paste time, not at copy time.

That's completely up to the app reading the clipboard. Can't do anything about that.

I know. It's too bad too many apps don't provide a way to choose between plain-text paste and formatted paste.

I paste tons of stuff into Teams, from various sources like VScode and Windows Terminal, and I often don't get what I'd expect.

My current workaround is to first rewrite the clipboard as plain-text-only with some one-liner, such as this running in a WSL2 tab in Windows Terminal 😉

pwsh.exe -noprofile -c Get-ClipboardText | fold -w80 | clip.exe

(this also tackles a Teams issue with the lack of line-wrapping but that's another issue altogether)

Being able to choose between formatted copy or unformatted copy e.g. by using two different key bindings would be nice.

You mean like...

{ "command": { "action": "copy", "copyFormatting": "rtf" }, "keys": "ctrl+shift+r" },
{ "command": { "action": "copy", "copyFormatting": "html" }, "keys": "ctrl+shift+h" },
{ "command": { "action": "copy", "copyFormatting": ["html", "rtf"] }, "keys": "ctrl+win+alt+shift+h" },

? From the docs for the copy action.

Exactly. [blushing mode on] My bad for not RTFM. [blushing mode off]. I'll try defining a "copy as plain text" keybinding and see whether my muscle memory can be trained to using that.

@sba923 commented on GitHub (May 5, 2021): > > Or maybe the choice should be at paste time, not at copy time. > > That's completely up to the app _reading_ the clipboard. Can't do anything about that. I know. It's too bad too many apps don't provide a way to choose between _plain-text_ paste and _formatted_ paste. I paste tons of stuff into Teams, from various sources like VScode and Windows Terminal, and I often don't get what I'd expect. My current workaround is to first rewrite the clipboard as plain-text-only with some one-liner, such as this running in a WSL2 tab in Windows Terminal 😉 ```none pwsh.exe -noprofile -c Get-ClipboardText | fold -w80 | clip.exe ``` (this also tackles a Teams issue with the lack of line-wrapping but that's another issue altogether) > > > Being able to choose between formatted copy or unformatted copy e.g. by using two different key bindings would be nice. > > You mean like... > > ```json > { "command": { "action": "copy", "copyFormatting": "rtf" }, "keys": "ctrl+shift+r" }, > { "command": { "action": "copy", "copyFormatting": "html" }, "keys": "ctrl+shift+h" }, > { "command": { "action": "copy", "copyFormatting": ["html", "rtf"] }, "keys": "ctrl+win+alt+shift+h" }, > ``` > > ? From the [docs for the copy action](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/actions#copy). Exactly. _[blushing mode on]_ My bad for not RTFM. _[blushing mode off]_. I'll try defining a "copy as plain text" keybinding and see whether my muscle memory can be trained to using _that_.
Author
Owner

@sba923 commented on GitHub (May 5, 2021):

Or maybe the choice should be at paste time, not at copy time.

That's completely up to the app reading the clipboard. Can't do anything about that.

I know. It's too bad too many apps don't provide a way to choose between plain-text paste and formatted paste.

I paste tons of stuff into Teams, from various sources like VScode and Windows Terminal, and I often don't get what I'd expect.

My current workaround is to first rewrite the clipboard as plain-text-only with some one-liner, such as this running in a WSL2 tab in Windows Terminal 😉

pwsh.exe -noprofile -c Get-ClipboardText | fold -w80 | clip.exe

(this also tackles a Teams issue with the lack of line-wrapping but that's another issue altogether)

Being able to choose between formatted copy or unformatted copy e.g. by using two different key bindings would be nice.

You mean like...

{ "command": { "action": "copy", "copyFormatting": "rtf" }, "keys": "ctrl+shift+r" },
{ "command": { "action": "copy", "copyFormatting": "html" }, "keys": "ctrl+shift+h" },
{ "command": { "action": "copy", "copyFormatting": ["html", "rtf"] }, "keys": "ctrl+win+alt+shift+h" },

? From the docs for the copy action.

Exactly. [blushing mode on] My bad for not RTFM. [blushing mode off]. I'll try defining a "copy as plain text" keybinding and see whether my muscle memory can be trained to using that.

@sba923 commented on GitHub (May 5, 2021): > > Or maybe the choice should be at paste time, not at copy time. > > That's completely up to the app _reading_ the clipboard. Can't do anything about that. I know. It's too bad too many apps don't provide a way to choose between _plain-text_ paste and _formatted_ paste. I paste tons of stuff into Teams, from various sources like VScode and Windows Terminal, and I often don't get what I'd expect. My current workaround is to first rewrite the clipboard as plain-text-only with some one-liner, such as this running in a WSL2 tab in Windows Terminal 😉 ```none pwsh.exe -noprofile -c Get-ClipboardText | fold -w80 | clip.exe ``` (this also tackles a Teams issue with the lack of line-wrapping but that's another issue altogether) > > > Being able to choose between formatted copy or unformatted copy e.g. by using two different key bindings would be nice. > > You mean like... > > ```json > { "command": { "action": "copy", "copyFormatting": "rtf" }, "keys": "ctrl+shift+r" }, > { "command": { "action": "copy", "copyFormatting": "html" }, "keys": "ctrl+shift+h" }, > { "command": { "action": "copy", "copyFormatting": ["html", "rtf"] }, "keys": "ctrl+win+alt+shift+h" }, > ``` > > ? From the [docs for the copy action](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/actions#copy). Exactly. _[blushing mode on]_ My bad for not RTFM. _[blushing mode off]_. I'll try defining a "copy as plain text" keybinding and see whether my muscle memory can be trained to using _that_.
Author
Owner

@gyorokpeter commented on GitHub (Jul 16, 2021):

Leaving the text format aside, what is the status of being able to copy all text to the clipboard? Since we just got the ability to change the language to English, I can now actually read the menu options and in the "Command Palette" window there is nothing that is related to selecting text. Ctrl+A just inserts ^A instead of selecting the text.
This is a major blocker because I might have a program that spits out dozens of screens worth of output and I want to search for the first error in the output (since usually a single error triggers a cascade of error messages, checking the last one is useless).

@gyorokpeter commented on GitHub (Jul 16, 2021): Leaving the text format aside, what is the status of being able to copy all text to the clipboard? Since we just got the ability to change the language to English, I can now actually read the menu options and in the "Command Palette" window there is nothing that is related to selecting text. Ctrl+A just inserts ```^A``` instead of selecting the text. This is a major blocker because I might have a program that spits out dozens of screens worth of output and I want to search for the first error in the output (since usually a single error triggers a cascade of error messages, checking the last one is useless).
Author
Owner

@mloskot commented on GitHub (Jul 16, 2021):

@gyorokpeter

I might have a program that spits out dozens of screens worth of output and I want to search for the first error in the output

https://docs.microsoft.com/en-us/windows/terminal/search

I second request to support text selection and copying though.

@mloskot commented on GitHub (Jul 16, 2021): @gyorokpeter > I might have a program that spits out dozens of screens worth of output and I want to search for the first error in the output https://docs.microsoft.com/en-us/windows/terminal/search I second request to support text selection and copying though.
Author
Owner

@ohadschn commented on GitHub (Jul 16, 2021):

@gyorokpeter

I might have a program that spits out dozens of screens worth of output and I want to search for the first error in the output

https://docs.microsoft.com/en-us/windows/terminal/search

Unless you want wildcard search, regular expression search, find all, count, match whole word, find and replace, mark line and a million other things you'll never have inside a terminal...

One common scenario is using a command that dumps a huge JSON on the screen and you want to copy it over for further processing and formatting (yes, you can use stdout redirect but maybe you forgot, maybe you want to see the output first before saving it, etc).

@ohadschn commented on GitHub (Jul 16, 2021): > @gyorokpeter > > > I might have a program that spits out dozens of screens worth of output and I want to search for the first error in the output > > https://docs.microsoft.com/en-us/windows/terminal/search Unless you want wildcard search, regular expression search, find all, count, match whole word, find and replace, mark line and a million other things you'll never have inside a terminal... One common scenario is using a command that dumps a huge JSON on the screen and you want to copy it over for further processing and formatting (yes, you can use `stdout` redirect but maybe you forgot, maybe you want to see the output first before saving it, etc).
Author
Owner

@PolarGoose commented on GitHub (Nov 18, 2021):

I have found a workaround to select all text:

  1. Scroll to the beginning of the console window, for example by pressing Ctrl+Shift+Home
  2. Start selecting text by holding left mouse button
  3. While holding left mouse button press Ctrl+Shift+End, it will move the cursor to the bottom of the window and all console's text will be selected
  4. Release left mouse button
  5. Press Ctrl+C to copy the text
@PolarGoose commented on GitHub (Nov 18, 2021): I have found a workaround to select all text: 1. Scroll to the beginning of the console window, for example by pressing `Ctrl+Shift+Home` 2. Start selecting text by holding left mouse button 3. While holding left mouse button press `Ctrl+Shift+End`, it will move the cursor to the bottom of the window and all console's text will be selected 4. Release left mouse button 5. Press `Ctrl+C` to copy the text
Author
Owner

@Araxeus commented on GitHub (Feb 26, 2022):

Is it really so hard to make a keybind for atleast "Select all current input" ? 😢

@Araxeus commented on GitHub (Feb 26, 2022): Is it really so hard to make a keybind for atleast "Select all current input" ? 😢
Author
Owner

@zadjii-msft commented on GitHub (Feb 26, 2022):

Oh, no this should be super easy. This should be marked "Easy Starter", that's my bad. Alas, we haven't had time to get around to it, but it shouldn't be too hard to:

  • add a new ShortcutAction to ALL_SHORTCUT_ACTIONS in AllShortcutActions.h
  • Implement the handler in AppActionHandlers to call into the active panes's TermControls
  • Have the TermControl tell the COntrolCore to tell the Terminal to select all the text from 0,0 to the end of the mutable viewport

If anyone is interested, feel free to take a stab! I'll relabel this appropriately ☺️

d0d42c4ba1/doc/specs/Keyboard-Selection.md (L120-L130)

@zadjii-msft commented on GitHub (Feb 26, 2022): Oh, no this should be super easy. This should be marked "Easy Starter", that's my bad. Alas, we haven't had time to get around to it, but it shouldn't be too hard to: * add a new `ShortcutAction` to `ALL_SHORTCUT_ACTIONS` in `AllShortcutActions.h` * Implement the handler in `AppActionHandlers` to call into the active panes's `TermControl`s * Have the `TermControl` tell the `COntrolCore` to tell the `Terminal` to select all the text from 0,0 to the end of the mutable viewport If anyone is interested, feel free to take a stab! I'll relabel this appropriately ☺️ https://github.com/microsoft/terminal/blob/d0d42c4ba1196148c973f5fbaaa5516a76c8507b/doc/specs/Keyboard-Selection.md?plain=1#L120-L130
Author
Owner

@Araxeus commented on GitHub (Feb 26, 2022):

FYI ctrl+a works if the tab is powershell but not if its cmd

@Araxeus commented on GitHub (Feb 26, 2022): FYI `ctrl`+`a` works if the tab is powershell but not if its cmd
Author
Owner

@MartinDevillers commented on GitHub (Apr 8, 2022):

I probably have a silly workflow, but I just wanted to echo that for me "Select All" (Ctrl+A) and "Copy" (Ctrl+C) console output would be a pretty sweet feature to have.

@MartinDevillers commented on GitHub (Apr 8, 2022): I probably have a silly workflow, but I just wanted to echo that for me "Select All" (<kbd>Ctrl</kbd>+<kbd>A</kbd>) and "Copy" (<kbd>Ctrl</kbd>+<kbd>C</kbd>) console output would be a pretty sweet feature to have.
Author
Owner

@Menelion commented on GitHub (May 5, 2022):

Dear devs, could you please implement this? As a blind developer I'm not able to use the mouse at all and, as it seems, there is no way of selecting text in Windows Terminal using the keyboard only. Otherwise, a great app, thank you.

@Menelion commented on GitHub (May 5, 2022): Dear devs, could you please implement this? As a blind developer I'm not able to use the mouse at all and, as it seems, there is no way of selecting text in Windows Terminal using the keyboard only. Otherwise, a great app, thank you.
Author
Owner

@ghost commented on GitHub (May 24, 2022):

:tada:This issue was addressed in #13045, which has now been successfully released as Windows Terminal Preview v1.14.143.🎉

Handy links:

@ghost commented on GitHub (May 24, 2022): :tada:This issue was addressed in #13045, which has now been successfully released as `Windows Terminal Preview v1.14.143`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.14.143) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@Araxeus commented on GitHub (May 24, 2022):

Sorry but this is super unhelpful, it selects all the text in the prompt including the beginning

Microsoft Windows [Version 10.0.19044.1706]
(c) Microsoft Corporation. All rights reserved.

How about the ability to just select the current writable buffer??

@Araxeus commented on GitHub (May 24, 2022): Sorry but this is super unhelpful, it selects all the text in the prompt including the beginning ``` Microsoft Windows [Version 10.0.19044.1706] (c) Microsoft Corporation. All rights reserved. ``` ---- How about the ability to just select the current writable buffer??
Author
Owner

@DHowett commented on GitHub (May 24, 2022):

This feature request was for the ability to select all the text in the buffer. If you're looking for something else, please file a new feature request.

In addition: that part of the buffer is writable:

image
@DHowett commented on GitHub (May 24, 2022): This feature request was for the ability to select _all the text in the buffer._ If you're looking for something else, please file a new feature request. In addition: that part of the buffer _is_ writable: <img width="633" alt="image" src="https://user-images.githubusercontent.com/189190/170097730-bab849c8-082a-4c87-a0a8-f5c92faefdb4.png">
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1985