From 92ecf1043bbf30f3be2e0464bc428f8f1f919883 Mon Sep 17 00:00:00 2001 From: Ronald G Minnich Date: Mon, 27 Nov 2023 12:52:49 -0800 Subject: [PATCH] client/client.go: windows sucks you can make things raw, but sometimes, you can't get the window size. Signed-off-by: Ronald G Minnich --- client/client.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/client.go b/client/client.go index 37221885..ce99888a 100644 --- a/client/client.go +++ b/client/client.go @@ -113,6 +113,12 @@ func Command(host string, args ...string) *Cmd { col, row := 80, 40 if c, r, err := term.GetSize(int(os.Stdin.Fd())); err != nil { verbose("Can not get winsize: %v; assuming %dx%d and non-interactive", err, col, row) + // ah, windows. You suck. + oldState, err := term.MakeRaw(int(os.Stdin.Fd())) + if err == nil { + hasTTY = true + } + term.Restore(int(os.Stdin.Fd()), oldState) } else { hasTTY = true col, row = c, r