diff --git a/cli/cliui/cliui_darwin.go b/cli/cliui/cliui_darwin.go deleted file mode 100644 index 0fd9a57f61729..0000000000000 --- a/cli/cliui/cliui_darwin.go +++ /dev/null @@ -1,31 +0,0 @@ -//go:build darwin -// +build darwin - -package cliui - -import ( - "golang.org/x/sys/unix" - - "golang.org/x/xerrors" -) - -func removeLineLengthLimit(inputFD int) (func(), error) { - termios, err := unix.IoctlGetTermios(inputFD, unix.TIOCGETA) - if err != nil { - return nil, xerrors.Errorf("get termios: %w", err) - } - newState := *termios - // MacOS has a default line limit of 1024. See: - // https://unix.stackexchange.com/questions/204815/terminal-does-not-accept-pasted-or-typed-lines-of-more-than-1024-characters - // - // This removes canonical input processing, so deletes will not function - // as expected. This _seems_ fine for most use-cases, but is unfortunate. - newState.Lflag &^= unix.ICANON - err = unix.IoctlSetTermios(inputFD, unix.TIOCSETA, &newState) - if err != nil { - return nil, xerrors.Errorf("set termios: %w", err) - } - return func() { - _ = unix.IoctlSetTermios(inputFD, unix.TIOCSETA, termios) - }, nil -} diff --git a/cli/cliui/cliui_other.go b/cli/cliui/cliui_other.go deleted file mode 100644 index a9c10a1df4f6b..0000000000000 --- a/cli/cliui/cliui_other.go +++ /dev/null @@ -1,10 +0,0 @@ -//go:build !darwin -// +build !darwin - -package cliui - -import "golang.org/x/xerrors" - -func removeLineLengthLimit(_ int) (func(), error) { - return nil, xerrors.New("not implemented") -} diff --git a/cli/cliui/prompt.go b/cli/cliui/prompt.go index 6a741e526def3..3e4c0689da162 100644 --- a/cli/cliui/prompt.go +++ b/cli/cliui/prompt.go @@ -7,7 +7,6 @@ import ( "fmt" "os" "os/signal" - "runtime" "strings" "github.com/bgentry/speakeasy" @@ -48,16 +47,6 @@ func Prompt(cmd *cobra.Command, opts PromptOptions) (string, error) { if opts.Secret && isInputFile && isatty.IsTerminal(inFile.Fd()) { line, err = speakeasy.Ask("") } else { - if !opts.IsConfirm && runtime.GOOS == "darwin" && isInputFile { - var restore func() - restore, err = removeLineLengthLimit(int(inFile.Fd())) - if err != nil { - errCh <- err - return - } - defer restore() - } - reader := bufio.NewReader(cmd.InOrStdin()) line, err = reader.ReadString('\n')