Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
ec9aa8e9
Commit
ec9aa8e9
authored
Jan 26, 2014
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ctrl-c once does nothing, ctrl-c twice kills everything, closes #145
parent
77701bfa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
Main.hs
src/Main.hs
+9
-0
No files found.
src/Main.hs
View file @
ec9aa8e9
...
...
@@ -15,6 +15,7 @@ import Data.String.Utils (strip)
import
System.Directory
import
System.Exit
(
exitSuccess
)
import
Text.Printf
import
System.Posix.Signals
import
qualified
Data.Map
as
Map
-- IHaskell imports.
...
...
@@ -149,6 +150,11 @@ runKernel profileSrc initInfo = do
-- Receive and reply to all messages on the shell socket.
interpret
True
$
do
-- Ignore Ctrl-C the first time. This has to go inside the
-- `interpret`, because GHC API resets the signal handlers for some
-- reason (completely unknown to me).
liftIO
ignoreCtrlC
-- Initialize the context by evaluating everything we got from the
-- command line flags. This includes enabling some extensions and also
-- running some code.
...
...
@@ -177,6 +183,9 @@ runKernel profileSrc initInfo = do
-- Write the reply to the reply channel.
liftIO
$
writeChan
(
shellReplyChannel
interface
)
reply
where
ignoreCtrlC
=
installHandler
keyboardSignal
(
CatchOnce
$
putStrLn
"Press Ctrl-C again to quit kernel."
)
Nothing
-- Initial kernel state.
initialKernelState
::
IO
(
MVar
KernelState
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment