Fix `select` based shutdown on Windows
walles opened this issue · 1 comments
walles commented
Using moar
? Have a Go setup on Windows? Please help!
On Windows, in the johan/select-shutdown
branch, this code triggers immediately on startup and moar
shuts down:
https://github.com/walles/moar/blob/johan/select-shutdown/twin/screen.go#L385-L387:
if rFDSet.IsSet(screen.shutdownPipeReader.Fd()) {
return 0, errShutdownInitiated
}
With the shutdown code on master
...
- ... when exiting on v to edit...
- ... using a terminal based editor...
- ... then
moar
will steal the first byte(s) of the editor's input before terminating.
The correct solution is to use select
for shutdown. The linked branch works fine on macOS but fails on Windows.
Kindly help figuring this out!