Skip to content

Instantly share code, notes, and snippets.

@cmacrae
Created December 11, 2015 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmacrae/1343683fd0be35e733dd to your computer and use it in GitHub Desktop.
Save cmacrae/1343683fd0be35e733dd to your computer and use it in GitHub Desktop.
diff --git a/ui.go b/ui.go
index 33c1263..62eb283 100644
--- a/ui.go
+++ b/ui.go
@@ -1,15 +1,11 @@
package cli
import (
- "bufio"
"errors"
"fmt"
"io"
"os"
"os/signal"
- "strings"
-
- "golang.org/x/crypto/ssh/terminal"
)
// Ui is an interface for interacting with the terminal, or "interface"
@@ -72,13 +68,13 @@ func (u *BasicUi) ask(query string, secret bool) (string, error) {
// Ask for input in a go-routine so that we can ignore it.
errCh := make(chan error, 1)
lineCh := make(chan string, 1)
- go func() {
+ /* go func() {
var line string
var err error
stdin := int(os.Stdin.Fd())
- if secret && terminal.IsTerminal(stdin) {
+ if secret {
var lineBytes []byte
- lineBytes, err = terminal.ReadPassword(stdin)
+ //lineBytes, err = terminal.ReadPassword(stdin)
line = string(lineBytes)
} else {
r := bufio.NewReader(u.Reader)
@@ -90,7 +86,7 @@ func (u *BasicUi) ask(query string, secret bool) (string, error) {
}
lineCh <- strings.TrimRight(line, "\r\n")
- }()
+ }() */
select {
case err := <-errCh:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment