diff --git a/main/Main.hs b/main/Main.hs index f96d695b..4c9a03d2 100644 --- a/main/Main.hs +++ b/main/Main.hs @@ -191,6 +191,10 @@ runKernel kOpts profileSrc = do -- Write the reply to the reply channel. liftIO $ writeChan (shellReplyChannel interface) reply + -- Notify the frontend that we're done computing. + idleHeader <- liftIO $ dupHeader replyHeader StatusMessage + liftIO $ writeChan (iopubChannel interface) $ PublishStatus idleHeader Idle + where ignoreCtrlC = installHandler keyboardSignal (CatchOnce $ putStrLn "Press Ctrl-C again to quit kernel.") @@ -290,10 +294,6 @@ replyTo interface req@ExecuteRequest { getCode = code } replyHeader state = do publish = publishResult send replyHeader displayed updateNeeded pOut (usePager state) updatedState <- evaluate state (T.unpack code) publish widgetMessageHandler - -- Notify the frontend that we're done computing. - idleHeader <- liftIO $ dupHeader replyHeader StatusMessage - send $ PublishStatus idleHeader Idle - -- Take pager output if we're using the pager. pager <- if usePager state then liftIO $ readMVar pOut @@ -440,8 +440,4 @@ handleComm send kernelState req replyHeader = do -- Only sensible thing to do. return kernelState - -- Notify the frontend that the kernel is idle once again - idleHeader <- liftIO $ dupHeader replyHeader StatusMessage - liftIO . send $ PublishStatus idleHeader Idle - return newState