From dbe5d4882d8f16a40953cea08fe0557e389ad07f Mon Sep 17 00:00:00 2001 From: Arya Irani <538571+aryairani@users.noreply.github.com> Date: Wed, 17 Jun 2020 08:32:34 -0400 Subject: [PATCH] Revert "Fix #1131 : Add windows Ctrl+C handling" --- CONTRIBUTORS.markdown | 1 - .../unison-parser-typechecker.cabal | 6 ++---- parser-typechecker/unison/Main.hs | 17 +---------------- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/CONTRIBUTORS.markdown b/CONTRIBUTORS.markdown index b9c55e478d..037a11df58 100644 --- a/CONTRIBUTORS.markdown +++ b/CONTRIBUTORS.markdown @@ -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) diff --git a/parser-typechecker/unison-parser-typechecker.cabal b/parser-typechecker/unison-parser-typechecker.cabal index 9dc8f09bf2..5c2f0725f8 100644 --- a/parser-typechecker/unison-parser-typechecker.cabal +++ b/parser-typechecker/unison-parser-typechecker.cabal @@ -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 diff --git a/parser-typechecker/unison/Main.hs b/parser-typechecker/unison/Main.hs index 7adf5565ad..2101968c1b 100644 --- a/parser-typechecker/unison/Main.hs +++ b/parser-typechecker/unison/Main.hs @@ -1,7 +1,6 @@ {-# Language OverloadedStrings #-} {-# Language PartialTypeSignatures #-} {-# Language ScopedTypeVariables #-} -{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -Wno-partial-type-signatures #-} module Main where @@ -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 @@ -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", @@ -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 ()