Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

Commit5a6b14e

Browse files
committed
Set raw output for all commands
Change-Id: Id286904a99d3f3796a7679837ec4f168a273807c
1 parent6fc2c8c commit5a6b14e

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

‎cmd/coder/main.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ import (
66
_"net/http/pprof"
77
"os"
88

9+
"cdr.dev/coder-cli/internal/xterminal"
910
"github.com/spf13/pflag"
1011

12+
"go.coder.com/flog"
13+
1114
"go.coder.com/cli"
1215
)
1316

@@ -48,5 +51,12 @@ func main() {
4851
log.Println(http.ListenAndServe("localhost:6060",nil))
4952
}()
5053
}
54+
55+
stdoutState,err:=xterminal.MakeOutputRaw(os.Stdout.Fd())
56+
iferr!=nil {
57+
flog.Fatal("failed to set output to raw: %v",err)
58+
}
59+
deferxterminal.Restore(os.Stdout.Fd(),stdoutState)
60+
5161
cli.RunRoot(&rootCmd{})
5262
}

‎cmd/coder/shell.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,6 @@ func runCommand(ctx context.Context, envName string, command string, args []stri
9797
returnerr
9898
}
9999
deferxterminal.Restore(os.Stdin.Fd(),stdinState)
100-
101-
stdoutState,err:=xterminal.MakeOutputRaw(os.Stdout.Fd())
102-
iferr!=nil {
103-
returnerr
104-
}
105-
deferxterminal.Restore(os.Stdout.Fd(),stdoutState)
106100
}
107101

108102
ctx,cancel:=context.WithCancel(ctx)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp