[Haskell-cafe] gracefully invoking `less` using System.Process (andignoring ctrl-c)

Donn Cave donn at avvanta.com
Fri Dec 12 18:19:03 UTC 2014


Quoth Guillaume Hoffmann <guillaumh at gmail.com>,
...
> * use System.Process.createProcess (just to update the code), and
> * in the "ortryrunning" function (that chains attempts at calling
> various pagers until one works), ignoring IOError's of the kind
> ResourceVanished (otherwise we would invoke every pager in the chain
> if we quit them before they read all their input)
>
> The problem is that pressing CTRL-C in `less` now kills everything (darcs+less).

And didn't before?  Do you suppose, because of the createProcess?

I don't keep track as well as I should, of the library's herculean
efforts to support UNIX functionality like this on a platform
independent layer, but I notice in the docs a "delegate_ctlc"
option, and some discussion of it and pointers to more discussion,
in System.Process.  Does any of that help?

Do you want to support this on Windows?

	Donn


More information about the Haskell-Cafe mailing list