diff options
Diffstat (limited to 'src/cmd/pprof')
-rw-r--r-- | src/cmd/pprof/readlineui.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/cmd/pprof/readlineui.go b/src/cmd/pprof/readlineui.go index dbbb9c2787..f46e934e0f 100644 --- a/src/cmd/pprof/readlineui.go +++ b/src/cmd/pprof/readlineui.go @@ -19,7 +19,7 @@ import ( "strings" "github.com/google/pprof/driver" - "golang.org/x/crypto/ssh/terminal" + "golang.org/x/term" ) func init() { @@ -27,11 +27,11 @@ func init() { } // readlineUI implements driver.UI interface using the -// golang.org/x/crypto/ssh/terminal package. +// golang.org/x/term package. // The upstream pprof command implements the same functionality // using the github.com/chzyer/readline package. type readlineUI struct { - term *terminal.Terminal + term *term.Terminal } func newReadlineUI() driver.UI { @@ -39,19 +39,19 @@ func newReadlineUI() driver.UI { if v := strings.ToLower(os.Getenv("TERM")); v == "" || v == "dumb" { return nil } - // test if we can use terminal.ReadLine + // test if we can use term.ReadLine // that assumes operation in the raw mode. - oldState, err := terminal.MakeRaw(0) + oldState, err := term.MakeRaw(0) if err != nil { return nil } - terminal.Restore(0, oldState) + term.Restore(0, oldState) rw := struct { io.Reader io.Writer }{os.Stdin, os.Stderr} - return &readlineUI{term: terminal.NewTerminal(rw, "")} + return &readlineUI{term: term.NewTerminal(rw, "")} } // Read returns a line of text (a command) read from the user. @@ -61,8 +61,8 @@ func (r *readlineUI) ReadLine(prompt string) (string, error) { // skip error checking because we tested it // when creating this readlineUI initially. - oldState, _ := terminal.MakeRaw(0) - defer terminal.Restore(0, oldState) + oldState, _ := term.MakeRaw(0) + defer term.Restore(0, oldState) s, err := r.term.ReadLine() return s, err @@ -106,7 +106,7 @@ func colorize(msg string) string { // interactive terminal (as opposed to being redirected to a file). func (r *readlineUI) IsTerminal() bool { const stdout = 1 - return terminal.IsTerminal(stdout) + return term.IsTerminal(stdout) } // WantBrowser indicates whether browser should be opened with the -http option. |