Skip to content

Terminal: Run Recent Command shows up when there are no terminals #233604

Closed

Description

@Tyriar

Repro:

  1. Close all terminals
  2. Run the command, 🐛 nothing happens

Image

We should either hide it or implement it when there isn't a terminal.

Activity

  1. added
    bugIssue identified by VS Code Team member as probable bug
    help wantedIssues identified as good community contribution opportunities
    terminal-shell-integrationShell integration infrastructure, command decorations, etc.
    on Nov 11, 2024
  2. added this to the Backlog milestone on Nov 11, 2024
  3. SalerSimo commented on Nov 18, 2024

    @SalerSimo
    Contributor

    Daniel Imms (@Tyriar) can i help with this issue?

  4. Tyriar commented on Nov 18, 2024

    @Tyriar
    ContributorAuthor

    Simone Salerno (@SalerSimo) sure! Here's a code pointer:

    run: async (activeInstance, c) => {
    const history = TerminalHistoryContribution.get(activeInstance);
    if (!history) {
    return;
    }
    await history.runRecent('command');
    if (activeInstance?.target === TerminalLocation.Editor) {
    await c.editorService.revealActiveEditor();
    } else {
    await c.groupService.showPanel(false);
    }
    }

  5. SalerSimo commented on Nov 21, 2024

    @SalerSimo
    Contributor

    Daniel Imms (@Tyriar) I opened a PR for this, can you tell me if the code I wrote is fine? I'm not sure if using a sleep function is accepted here, and, if it's not, I think that the only solution for this issue would be hiding the "Run Recent Command" command when there are no open terminals.

  6. Sublimeful commented on Jun 6, 2025

    @Sublimeful
    Contributor

    Daniel Imms (@Tyriar) Since there has been no recent activity on this issue, I have created a PR that addresses this. If you have time, please take a look at the PR and let me know if you have any questions!

  7. added
    unreleasedPatch has not yet been released in VS Code Insiders
    insiders-releasedPatch has been released in VS Code Insiders
    and removed
    unreleasedPatch has not yet been released in VS Code Insiders
    on Jun 6, 2025
  8. locked and limited conversation to collaborators on Jul 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitiesinsiders-releasedPatch has been released in VS Code Insidersterminal-shell-integrationShell integration infrastructure, command decorations, etc.verifiedVerification succeeded

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions