Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Adds support for windows #79

Merged
merged 3 commits into from
Jul 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Set raw output for all commands
Change-Id: Id286904a99d3f3796a7679837ec4f168a273807c
  • Loading branch information
cmoog committed Jul 28, 2020
commit 5a6b14e51eacf251a005eff8152f4fd85fa5e465
10 changes: 10 additions & 0 deletions cmd/coder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ import (
_ "net/http/pprof"
"os"

"cdr.dev/coder-cli/internal/xterminal"
"github.com/spf13/pflag"

"go.coder.com/flog"

"go.coder.com/cli"
)

Expand Down Expand Up @@ -48,5 +51,12 @@ func main() {
log.Println(http.ListenAndServe("localhost:6060", nil))
}()
}

stdoutState, err := xterminal.MakeOutputRaw(os.Stdout.Fd())
if err != nil {
flog.Fatal("failed to set output to raw: %v", err)
}
defer xterminal.Restore(os.Stdout.Fd(), stdoutState)

cli.RunRoot(&rootCmd{})
}
6 changes: 0 additions & 6 deletions cmd/coder/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,6 @@ func runCommand(ctx context.Context, envName string, command string, args []stri
return err
}
defer xterminal.Restore(os.Stdin.Fd(), stdinState)

stdoutState, err := xterminal.MakeOutputRaw(os.Stdout.Fd())
if err != nil {
return err
}
defer xterminal.Restore(os.Stdout.Fd(), stdoutState)
}

ctx, cancel := context.WithCancel(ctx)
Expand Down