Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easily copy result of last command without having the command still in view #152097

Closed
somewhatabstract opened this issue Jun 14, 2022 · 4 comments · Fixed by #153235
Closed

Easily copy result of last command without having the command still in view #152097

somewhatabstract opened this issue Jun 14, 2022 · 4 comments · Fixed by #153235
Assignees
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders terminal-shell-integration Shell integration, command decorations, etc. verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@somewhatabstract
Copy link

somewhatabstract commented Jun 14, 2022

The awesome shell integration makes it really easy to rerun commands and copy the output from those commands. However, it seems one can only copy the output if the line the command was executed from is still within the scroll limit of the terminal. For some very long runs this is inconvenient. It would be really nice to be able to:

  1. Copy output of last command from a terminal
  2. Copy output of any command in the history of that terminal, if it is available to be copied

Both without having to scroll to the point the command was executed.

@Tyriar
Copy link
Member

Tyriar commented Jun 14, 2022

Once there is too much data we no longer have access to it. Sounds like you probably want to increase the size of your scrollback. This is what I use:

"terminal.integrated.scrollback": 50000

All the memory for the buffer gets reserved ahead of time for performance reasons so this will increase RAM usage by a fixed amount per terminal you have open.

I like the idea of having a command for copying the output of the last command that you could hook up to a keybinding 👍

@Tyriar Tyriar added this to the Backlog milestone Jun 14, 2022
@Tyriar Tyriar added help wanted Issues identified as good community contribution opportunities feature-request Request for new features or functionality terminal-shell-integration Shell integration, command decorations, etc. labels Jun 14, 2022
@meganrogge
Copy link
Contributor

meganrogge commented Jun 14, 2022

You can also get the output from a command via workbench.action.terminal.runRecentCommand and then click the output/document icon
Screen Shot 2022-06-14 at 12 31 30 PM

These are only stored for the session, but might help you. @Tyriar I don't believe we get rid of commands that are outside of the scrollback, do we?

@Tyriar
Copy link
Member

Tyriar commented Jun 14, 2022

@meganrogge I don't think so but we do lose access to their output

MonadChains added a commit to MonadChains/vscode that referenced this issue Jun 26, 2022
@Tyriar Tyriar modified the milestones: Backlog, July 2022 Jun 27, 2022
meganrogge pushed a commit that referenced this issue Jul 7, 2022
* Add command to copy output of the last command (#152097)

* Polish changes, casing, wording, etc.

Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com>
@VSCodeTriageBot VSCodeTriageBot added the unreleased Patch has not yet been released in VS Code Insiders label Jul 7, 2022
@VSCodeTriageBot VSCodeTriageBot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jul 8, 2022
@Tyriar Tyriar added the verification-needed Verification of issue is requested label Jul 22, 2022
@lramos15 lramos15 added the verified Verification succeeded label Jul 26, 2022
@lramos15
Copy link
Member

@Tyriar I wonder if the command name should change Terminal: Copy Last Command makes you think the command would be copied but instead this is to copy the output

@github-actions github-actions bot locked and limited conversation to collaborators Aug 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders terminal-shell-integration Shell integration, command decorations, etc. verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants