<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Indeed. I hope it's not difficult to fix this, but I'm not sure where to start. Any suggestions are very welcome.<br>
<br></blockquote><div><br></div><div>It is unfortunately, because it's not a bug. Odds are both of you are using MinTTY which people blindly recommend to use.</div><div>The problem is MinTTY is not designed to run native Windows applications, it is designed to run ported POSIX applications. e.g. things linked against the</div><div>msys2/cygwin runtime. Because of this it implements a very intrusive hack in order to be able to handle signals the way they would be under a posix application,</div><div>which simply isn't compatible with Windows signals see <a href="https://github.com/mintty/mintty/issues/56">https://github.com/mintty/mintty/issues/56</a></div><div><br></div><div>Because your build is triggered by a batch file, when you press ctrl+c mintty will terminate the parent process indiscriminately if it's a script, e.g. the batch process is killed but</div><div>none of the children are.  This is why ghci has ghcii.sh as a workaround. e.g. why pressing ctrl+c terminate ghci instead of the computation as we can't.</div><div><br></div><div>this is why you should not use MinTTY with a native Windows application. MinTTY also introduces a number of character encoding problems for native Windows applications, see</div><div><a href="https://github.com/mintty/mintty/wiki/Tips#inputoutput-interaction-with-alien-programs">https://github.com/mintty/mintty/wiki/Tips#inputoutput-interaction-with-alien-programs</a>. In short, the issues you're seeing are by design.</div><div><br></div><div>Now you have two options:</div><div><br></div><div>1) Don't use mintty, instead use something like ConEmu <a href="https://conemu.github.io/">https://conemu.github.io/</a> with bash.exe from msys2 as the terminal host.This will work for Native application but have</div><div>issues with interactive posix applications like msys2 gdb (mingw64 gdb should in theory work fine though, but it's slightly more limited) and i.e.. tmux won't work. (the problems are thus flipped).</div><div><br></div><div>2) Use WinPTY <a href="https://github.com/rprichard/winpty">https://github.com/rprichard/winpty</a> to wrap native application calls (you can just install it via pacman), which works and you can keep using MinTTY, but this does have a slight performance overhead</div><div>as the reason it works is that it spawns a hidden buffer and scrapes output from it and send events to it to check the native behavior for Windows applications.</div><div><br></div><div>TL;DR; It's not a simple issue, the application can only deal with one signal processing method at a time.</div><div><br></div><div>Cheers,</div><div>Tamar<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Cheers,<br>
Andrey<br>
_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div></div></div></div></div></div>