Skip to content

Commit 11308ef

Browse files
committed
Add comments
1 parent c57b580 commit 11308ef

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/vs/workbench/contrib/terminalContrib/history/browser/terminal.history.contribution.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,10 @@ registerTerminalAction({
147147
}
148148
],
149149
run: async (c, accessor) => {
150+
// If there are no active instances, then create a new terminal instance
150151
const activeInstance = await c.service.getActiveOrCreateInstance();
152+
// Newly created instances will not have a shell type set yet
153+
// This will result in the command picker not showing up, so wait for it to be set
151154
if (!activeInstance.shellType) {
152155
await c.service.revealActiveTerminal();
153156
const wasDisposedPrematurely = await new Promise<boolean>(resolve => {
@@ -158,6 +161,7 @@ registerTerminalAction({
158161
resolve(true);
159162
});
160163
});
164+
// If the instance was disposed before the shell type was set, then exit
161165
if (wasDisposedPrematurely) {
162166
return;
163167
}

0 commit comments

Comments
 (0)