walles / moar

Moar is a pager. It's designed to just do the right thing without any configuration.
Other
585 stars 17 forks source link

Fix `select` based shutdown on Windows #222

Open walles opened 2 days ago

walles commented 2 days ago

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...

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!