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

Commit28475c1

Browse files
committed
Set output correctly
Change-Id: Idc792af25471e7becbac8facd27eb149cfd8514a
1 parent12f601a commit28475c1

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

‎cmd/coder/shell.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,17 @@ func runCommand(ctx context.Context, envName string, command string, args []stri
101101

102102
tty:=terminal.IsTerminal(int(termfd))
103103
iftty {
104-
state,err:=xterminal.MakeRaw(termfd)
104+
stdinState,err:=xterminal.MakeRaw(termfd)
105105
iferr!=nil {
106106
returnerr
107107
}
108-
deferfunc() {
109-
err:=xterminal.Restore(termfd,state)
110-
iferr!=nil {
111-
flog.Error("restore term state: %v",err)
112-
}
113-
}()
108+
deferxterminal.Restore(termfd,stdinState)
109+
110+
stdoutState,err:=xterminal.MakeOutputRaw(os.Stdout.Fd())
111+
iferr!=nil {
112+
returnerr
113+
}
114+
deferxterminal.Restore(os.Stdout.Fd(),stdoutState)
114115
}
115116

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

‎go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module cdr.dev/coder-cli
33
go1.14
44

55
require (
6-
cdr.dev/wsepv0.0.0-20200727194627-13ef1f8df965
6+
cdr.dev/wsepv0.0.0-20200728004104-4f85e914f20c
77
github.com/fatih/colorv1.9.0// indirect
88
github.com/gorilla/websocketv1.4.1
99
github.com/kirsle/configdirv0.0.0-20170128060238-e45d2f54772f

‎go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cdr.dev/slogv1.3.0 h1:MYN1BChIaVEGxdS7I5cpdyMC0+WfJfK8BETAfzfLUGQ=
22
cdr.dev/slogv1.3.0/go.mod h1:C5OL99WyuOK8YHZdYY57dAPN1jK2WJlCdq2VP6xeQns=
3-
cdr.dev/wsepv0.0.0-20200727194627-13ef1f8df965 h1:zFpraxgmcgX60oWFs8r1moWFMJ0x945t4moxNb6fjJ8=
4-
cdr.dev/wsepv0.0.0-20200727194627-13ef1f8df965/go.mod h1:N20HJdMn6q9NG7sjxL4uYdBQBGOf8/6psfdMyuJnYw8=
3+
cdr.dev/wsepv0.0.0-20200728004104-4f85e914f20c h1:opj4lhqu4wdFQEeoDw2GVp5SB+NxRnMkS8H62kodF1k=
4+
cdr.dev/wsepv0.0.0-20200728004104-4f85e914f20c/go.mod h1:2VKClUml3gfmLez0gBxTJIjSKszpQotc2ZqPdApfK/Y=
55
cloud.google.com/gov0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
66
cloud.google.com/gov0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
77
cloud.google.com/gov0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
@@ -107,8 +107,6 @@ github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad
107107
github.com/hashicorp/golang-lruv0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
108108
github.com/hashicorp/golang-lruv0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
109109
github.com/hashicorp/hclv1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
110-
github.com/iamacarpet/go-winptyv1.0.2 h1:jwPVTYrjAHZx6Mcm6K5i9G4opMp5TblEHH5EQCl/Gzw=
111-
github.com/iamacarpet/go-winptyv1.0.2/go.mod h1:/GHKJicG/EVRQIK1IQikMYBakBkhj/3hTjLgdzYsmpI=
112110
github.com/jessevdk/go-flagsv1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
113111
github.com/json-iterator/gov1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns=
114112
github.com/json-iterator/gov1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp