walles/moar

Fix `select` based shutdown on Windows

walles opened this issue · 1 comments

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!

Never mind, I have no clue how anybody would do this on Windows. Can't say select() is or isn't involved.

On not-Windows, fancy shutdown is now in #225.

Windows PRs accepted, please read #225 first.