Skip to content

Commit ac6db5e

Browse files
authored
feat(cli): show information about --wait=no for ssh (#13847)
Fixes #11923
1 parent 54055dc commit ac6db5e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

cli/cliui/agent.go

+3
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ func Agent(ctx context.Context, writer io.Writer, agentID uuid.UUID, opts AgentO
137137
stage += " (non-blocking)"
138138
}
139139
sw.Start(stage)
140+
if follow {
141+
sw.Log(time.Time{}, codersdk.LogLevelInfo, "==> ℹ︎ To connect immediately, reconnect with --wait=no or CODER_SSH_WAIT=no, see --help for more information.")
142+
}
140143

141144
err = func() error { // Use func because of defer in for loop.
142145
logStream, logsCloser, err := opts.FetchLogs(ctx, agent.ID, 0, follow)

cli/cliui/agent_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ func TestAgent(t *testing.T) {
226226
},
227227
want: []string{
228228
"⧗ Running workspace agent startup scripts",
229+
"ℹ︎ To connect immediately, reconnect with --wait=no or CODER_SSH_WAIT=no, see --help for more information.",
229230
"testing: Hello world",
230231
"Bye now",
231232
"✔ Running workspace agent startup scripts",
@@ -255,6 +256,7 @@ func TestAgent(t *testing.T) {
255256
},
256257
want: []string{
257258
"⧗ Running workspace agent startup scripts",
259+
"ℹ︎ To connect immediately, reconnect with --wait=no or CODER_SSH_WAIT=no, see --help for more information.",
258260
"Hello world",
259261
"✘ Running workspace agent startup scripts",
260262
"Warning: A startup script exited with an error and your workspace may be incomplete.",
@@ -306,6 +308,7 @@ func TestAgent(t *testing.T) {
306308
},
307309
want: []string{
308310
"⧗ Running workspace agent startup scripts",
311+
"ℹ︎ To connect immediately, reconnect with --wait=no or CODER_SSH_WAIT=no, see --help for more information.",
309312
"Hello world",
310313
"✔ Running workspace agent startup scripts",
311314
},

0 commit comments

Comments
 (0)