Skip to content

Commit 9ff3cb6

Browse files
authored
Automatically start a workspace if it is opened but not running (#583)
1 parent 43ba121 commit 9ff3cb6

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Changed
66

77
- Always enable verbose (`-v`) flag when a log directory is configured (`coder.proxyLogDir`).
8+
- Automatically start a workspace if it is opened but not running.
89

910
### Added
1011

src/remote.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,6 @@ export class Remote {
5454
private readonly mode: vscode.ExtensionMode,
5555
) {}
5656

57-
private async confirmStart(workspaceName: string): Promise<boolean> {
58-
const action = await this.vscodeProposed.window.showInformationMessage(
59-
`Unable to connect to the workspace ${workspaceName} because it is not running. Start the workspace?`,
60-
{
61-
useCustom: true,
62-
modal: true,
63-
},
64-
"Start",
65-
);
66-
return action === "Start";
67-
}
68-
6957
/**
7058
* Try to get the workspace running. Return undefined if the user canceled.
7159
*/
@@ -132,9 +120,6 @@ export class Remote {
132120
);
133121
break;
134122
case "stopped":
135-
if (!(await this.confirmStart(workspaceName))) {
136-
return undefined;
137-
}
138123
writeEmitter = initWriteEmitterAndTerminal();
139124
this.storage.output.info(`Starting ${workspaceName}...`);
140125
workspace = await startWorkspaceIfStoppedOrFailed(
@@ -150,9 +135,6 @@ export class Remote {
150135
// On a first attempt, we will try starting a failed workspace
151136
// (for example canceling a start seems to cause this state).
152137
if (attempts === 1) {
153-
if (!(await this.confirmStart(workspaceName))) {
154-
return undefined;
155-
}
156138
writeEmitter = initWriteEmitterAndTerminal();
157139
this.storage.output.info(`Starting ${workspaceName}...`);
158140
workspace = await startWorkspaceIfStoppedOrFailed(

0 commit comments

Comments
 (0)