File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
src/vs/workbench/contrib/terminalContrib/history/browser Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ registerActiveInstanceAction({
129
129
}
130
130
} ) ;
131
131
132
- registerActiveInstanceAction ( {
132
+ registerTerminalAction ( {
133
133
id : TerminalHistoryCommandId . RunRecentCommand ,
134
134
title : localize2 ( 'workbench.action.terminal.runRecentCommand' , 'Run Recent Command...' ) ,
135
135
precondition,
@@ -146,7 +146,22 @@ registerActiveInstanceAction({
146
146
weight : KeybindingWeight . WorkbenchContrib
147
147
}
148
148
] ,
149
- run : async ( activeInstance , c ) => {
149
+ run : async ( c , accessor ) => {
150
+ const activeInstance = await c . service . getActiveOrCreateInstance ( ) ;
151
+ if ( ! activeInstance . shellType ) {
152
+ await c . service . revealActiveTerminal ( ) ;
153
+ const wasDisposedPrematurely = await new Promise < boolean > ( resolve => {
154
+ activeInstance . onDidChangeShellType ( ( ) => {
155
+ resolve ( false ) ;
156
+ } ) ;
157
+ activeInstance . onDisposed ( ( ) => {
158
+ resolve ( true ) ;
159
+ } ) ;
160
+ } ) ;
161
+ if ( wasDisposedPrematurely ) {
162
+ return ;
163
+ }
164
+ }
150
165
const history = TerminalHistoryContribution . get ( activeInstance ) ;
151
166
if ( ! history ) {
152
167
return ;
You can’t perform that action at this time.
0 commit comments