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

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

Open
Tyriar opened this issue Nov 11, 2024 · 3 comments · May be fixed by #234124
Open

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

Tyriar opened this issue Nov 11, 2024 · 3 comments · May be fixed by #234124
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities terminal-shell-integration Shell integration, command decorations, etc.
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Nov 11, 2024

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.

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities terminal-shell-integration Shell integration, command decorations, etc. labels Nov 11, 2024
@Tyriar Tyriar added this to the Backlog milestone Nov 11, 2024
@Tyriar Tyriar self-assigned this Nov 11, 2024
@SalerSimo
Copy link

@Tyriar can i help with this issue?

@Tyriar
Copy link
Member Author

Tyriar commented Nov 18, 2024

@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);
}
}

@SalerSimo
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities terminal-shell-integration Shell integration, command decorations, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants