Open krsh-off opened 7 years ago
The issue I think is with your code:
readline.GetSize(0)
GetSize requires the fd of the TTY, which in some cases will be zero (eg if it's your first console on Linux) but in many cases wont be. Assuming readline is outputting to the default stdout, you can find the value with:
os.Stdout.Fd()
So your code would read something like:
fd := int(os.Stdout.Fd())
_, maxRows, err := readline.GetSize(fd)
Hello,
I wrote a pretty simple Go script and tried to run it on different OS:
And it work fine on Linux system (Centos 6.5):
But fails on Windows (10):
Actually, I'm getting the same error
The handle is invalid.
when calling another readline functions, likereadline.MakeRaw(0)
. I feel that I missed something or use the lib in incorrect way for Windows. Could you please assist me with it?