Skip to content

Commit 13dd526

Browse files
authored
fix: prevent stdlib logging from messing up ssh (#13161)
Fixes #13144
1 parent b20c63c commit 13dd526

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

cli/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ func newProvisionerDaemon(
14411441

14421442
connector[string(database.ProvisionerTypeTerraform)] = sdkproto.NewDRPCProvisionerClient(terraformClient)
14431443
default:
1444-
return nil, fmt.Errorf("unknown provisioner type %q", provisionerType)
1444+
return nil, xerrors.Errorf("unknown provisioner type %q", provisionerType)
14451445
}
14461446
}
14471447

cli/ssh.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"errors"
77
"fmt"
88
"io"
9+
"log"
910
"net/http"
1011
"net/url"
1112
"os"
@@ -79,6 +80,10 @@ func (r *RootCmd) ssh() *serpent.Command {
7980
ctx, cancel := context.WithCancel(ctx)
8081
defer cancel()
8182

83+
// Prevent unnecessary logs from the stdlib from messing up the TTY.
84+
// See: https://github.com/coder/coder/issues/13144
85+
log.SetOutput(io.Discard)
86+
8287
logger := inv.Logger
8388
defer func() {
8489
if retErr != nil {

0 commit comments

Comments
 (0)