Code change:
private async _getCommandActions(command: ITerminalCommand): Promise<IAction[]> { const actions: IAction[] = []; <ins> if (command.command !== '') { const labelRun = localize("terminal.rerunCommand", 'Rerun Command'); actions.push({ class: undefined, tooltip: labelRun, dispose: () => { }, id: 'terminal.rerunCommand', label: labelRun, enabled: true, run: () => this._onDidRequestRunCommand.fire({ command }) }); const labelCopy = localize("terminal.copyCommand", 'Copy Command'); actions.push({ class: undefined, tooltip: labelCopy, dispose: () => { }, id: 'terminal.copyCommand', label: labelCopy, enabled: true, run: () => this._clipboardService.writeText(command.command) }); } </ins> if (command.hasOutput) { <ins> if (actions.length > 0) { actions.push(new Separator()); } const labelText = localize("terminal.copyOutput", 'Copy Output'); </ins> actions.push({ <del> class: 'copy-output', tooltip: 'Copy Output', dispose: () => { }, id: 'terminal.copyOutput', label: localize("terminal.copyOutput", 'Copy Output'), enabled: true, </del> <ins> class: undefined, tooltip: labelText, dispose: () => { }, id: 'terminal.copyOutput', label: labelText, enabled: true, </ins> run: () => this._clipboardService.writeText(command.getOutput()!) }); <ins> const labelHtml = localize("terminal.copyOutputAsHtml", 'Copy Output as HTML'); </ins> actions.push({ <del> class: 'copy-output', tooltip: 'Copy Output as HTML', dispose: () => { }, id: 'terminal.copyOutputAsHtml', label: localize("terminal.copyOutputAsHtml", 'Copy Output as HTML'), enabled: true, </del> <ins> class: undefined, tooltip: labelHtml, dispose: () => { }, id: 'terminal.copyOutputAsHtml', label: labelHtml, enabled: true, </ins> run: () => this._onDidRequestRunCommand.fire({ command, copyAsHtml: true }) }); } <del> if (command.command !== '') { actions.push({ class: 'rerun-command', tooltip: 'Rerun Command', dispose: () => { }, id: 'terminal.rerunCommand', label: localize("terminal.rerunCommand", 'Rerun Command'), enabled: true, run: () => this._onDidRequestRunCommand.fire({ command }) }); </del> <ins> if (actions.length > 0) { actions.push(new Separator()); </ins> } <ins> const label = localize("terminal.learnShellIntegration", 'Learn About Shell Integration'); </ins> actions.push({ <del> class: 'how-does-this-work', tooltip: 'How does this work?', dispose: () => { }, id: 'terminal.howDoesThisWork', label: localize("terminal.howDoesThisWork", 'How does this work?'), enabled: true, </del> <ins> class: undefined, tooltip: label, dispose: () => { }, id: 'terminal.learnShellIntegration', label, enabled: true, </ins> run: () => this._openerService.open('https://code.visualstudio.com/docs/editor/integrated-terminal#_shell-integration') }); return actions;

Related discussion:
text: I wanted to copy this command to a diff't window and see how the selection didn't work so well https://user- Since we know where the prompt ends, could we do something about this? If not, should we have a copy command action?
Double click is all driven by the links system which works pretty well generally, adding prompt knowledge in there would be a bit of a mess and need some more APIs to override specific cell double-click selection handling since links live in but shell integration is all in vscode. The way I do this is to double click and drag it to the right a bit. I'd say this is out of scope but we can talk about it more if you want.
Yeah I thought abt the complications with the existing link/selection code and decided that would be too much. I wonder if we should have a copy command action though?
Sure we could do that, it would also be good to get some more order to this: ! Proposal: Rerun Command Copy Command - Copy Output Copy Output as HTML - How does this work?
Verified. Looks like the proposal to me. <img width="277" alt="image" src="https://user-"