Skip to content

Commit

Permalink
add run recent and go to cwd to command decoration menu (#171000)
Browse files Browse the repository at this point in the history
  • Loading branch information
meganrogge committed Jan 12, 2023
1 parent ea7e0d5 commit 865590e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Emitter } from 'vs/base/common/event';
import { Disposable, dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { localize } from 'vs/nls';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
Expand Down Expand Up @@ -49,6 +50,7 @@ export class DecorationAddon extends Disposable implements ITerminalAddon {
@IOpenerService private readonly _openerService: IOpenerService,
@IQuickInputService private readonly _quickInputService: IQuickInputService,
@ILifecycleService lifecycleService: ILifecycleService,
@ICommandService private readonly _commandService: ICommandService,
@IInstantiationService instantiationService: IInstantiationService
) {
super();
Expand Down Expand Up @@ -384,6 +386,19 @@ export class DecorationAddon extends Disposable implements ITerminalAddon {
if (actions.length > 0) {
actions.push(new Separator());
}
const labelRunRecent = localize('workbench.action.terminal.runRecentCommand', "Run Recent Command");
actions.push({
class: undefined, tooltip: labelRunRecent, id: 'workbench.action.terminal.runRecentCommand', label: labelRunRecent, enabled: true,
run: () => this._commandService.executeCommand('workbench.action.terminal.runRecentCommand')
});
const labelGoToRecent = localize('workbench.action.terminal.goToRecentDirectory', "Go To Recent Directory");
actions.push({
class: undefined, tooltip: labelRunRecent, id: 'workbench.action.terminal.goToRecentDirectory', label: labelGoToRecent, enabled: true,
run: () => this._commandService.executeCommand('workbench.action.terminal.goToRecentDirectory')
});

actions.push(new Separator());

const labelConfigure = localize("terminal.configureCommandDecorations", 'Configure Command Decorations');
actions.push({
class: undefined, tooltip: labelConfigure, id: 'terminal.configureCommandDecorations', label: labelConfigure, enabled: true,
Expand Down

0 comments on commit 865590e

Please sign in to comment.