Skip to content

Commit

Permalink
Revert "Fix #1131 : Add windows Ctrl+C handling"
Browse files Browse the repository at this point in the history
  • Loading branch information
aryairani authored Jun 17, 2020
1 parent ff131de commit dbe5d48
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
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

0 comments on commit dbe5d48

Please sign in to comment.