Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Fix #1131 : Add windows Ctrl+C handling" #1615

Merged
merged 1 commit into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CONTRIBUTORS.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,3 @@ The format for this list: name, GitHub handle, and then optional blurb about wha
* Dave Nicponski (@virusdave)
* Cody Allen (@ceedubs)
* Ludvig Sundström (@lsund)
* Mohamed Elsharnouby (@sharno)
6 changes: 2 additions & 4 deletions parser-typechecker/unison-parser-typechecker.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,8 @@ executable unison
temporary,
text,
unison-core,
unison-parser-typechecker
if !os(windows)
build-depends:
unix
unison-parser-typechecker,
unix

executable prettyprintdemo
main-is: Main.hs
Expand Down
17 changes: 1 addition & 16 deletions parser-typechecker/unison/Main.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{-# Language OverloadedStrings #-}
{-# Language PartialTypeSignatures #-}
{-# Language ScopedTypeVariables #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -Wno-partial-type-signatures #-}

module Main where
Expand All @@ -27,6 +26,7 @@ import qualified Unison.Util.Cache as Cache
import qualified Version
import qualified Unison.Codebase.TranscriptParser as TR
import qualified System.Path as Path
import qualified System.Posix.Signals as Sig
import qualified System.FilePath as FP
import qualified System.IO.Temp as Temp
import qualified System.Exit as Exit
Expand All @@ -38,12 +38,6 @@ import qualified Data.Text as Text
import qualified Data.Configurator as Config
import Text.Megaparsec (runParser)

#if defined(mingw32_HOST_OS)
import qualified GHC.ConsoleHandler as WinSig
#else
import qualified System.Posix.Signals as Sig
#endif

usage :: String -> P.Pretty P.ColorText
usage executableStr = P.callout "🌻" $ P.lines [
P.bold "Usage instructions for the Unison Codebase Manager",
Expand Down Expand Up @@ -108,17 +102,8 @@ installSignalHandlers = do
case r of
Nothing -> return ()
Just t -> throwTo t UserInterrupt

#if defined(mingw32_HOST_OS)
let sig_handler WinSig.ControlC = interrupt
sig_handler WinSig.Break = interrupt
sig_handler _ = return ()
_ <- WinSig.installHandler (WinSig.Catch sig_handler)
#else
_ <- Sig.installHandler Sig.sigQUIT (Sig.Catch interrupt) Nothing
_ <- Sig.installHandler Sig.sigINT (Sig.Catch interrupt) Nothing
#endif

return ()

main :: IO ()
Expand Down