Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ async function runSessionsUpdateAction(
scheme: productService.urlProtocol,
query: 'windowId=_blank',
}), { openExternal: true });
await hostService.close();
await hostService.shutdown();
}

return;
Expand Down
4 changes: 4 additions & 0 deletions src/vs/workbench/services/host/browser/browserHostService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,10 @@ export class BrowserHostService extends Disposable implements IHostService {
mainWindow.close();
}

async shutdown(): Promise<void> {
return this.close();
}

async withExpectedShutdown<T>(expectedShutdownTask: () => Promise<T>): Promise<T> {
const previousShutdownReason = this.shutdownReason;
try {
Expand Down
7 changes: 7 additions & 0 deletions src/vs/workbench/services/host/browser/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ export interface IHostService {
*/
close(): Promise<void>;

/**
* Quit the entire application. Unlike {@link close}, this will
* terminate the process even on macOS where closing the last
* window normally keeps the app running.
*/
shutdown(): Promise<void>;

/**
* Execute an asynchronous `expectedShutdownTask`. While this task is
* in progress, attempts to quit the application will not be vetoed with a dialog.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ class WorkbenchHostService extends Disposable implements IHostService {
return this.nativeHostService.closeWindow();
}

shutdown(): Promise<void> {
return this.nativeHostService.quit();
}

async withExpectedShutdown<T>(expectedShutdownTask: () => Promise<T>): Promise<T> {
return await expectedShutdownTask();
}
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/test/browser/workbenchTestServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,7 @@ export class TestHostService implements IHostService {
async restart(): Promise<void> { }
async reload(): Promise<void> { }
async close(): Promise<void> { }
async shutdown(): Promise<void> { }
async withExpectedShutdown<T>(expectedShutdownTask: () => Promise<T>): Promise<T> {
return await expectedShutdownTask();
}
Expand Down
Loading