@@ -82,8 +82,17 @@ repl orig mods
8282 repl orig mods
8383
8484-- | Run the IdeSlave
85−ideslave :: IState -> [FilePath] -> Idris ()
86−ideslave orig mods
85+ideslaveStart :: [FilePath] -> Idris ()
86+ideslaveStart mods
87+ = do i <- getIState
88+ case idris_outputmode i of
89+ IdeSlave n ->
90+ when (mods /= []) (do liftIO $ putStrLn $ convSExp "set-prompt" (mkPrompt mods) n)
91+ ideslave mods
92+
93+
94+ideslave :: [FilePath] -> Idris ()
95+ideslave mods
8796 = do idrisCatch
8897 (do l <- liftIO $ getLine
8998 let (sexp, id) = receiveMessage l
@@ -106,10 +115,12 @@ ideslave orig mods
106115 liftIO $ putStrLn $ sendMessage id (Right (map replacement compls, reverse unused))
107116 Just (LoadFile filename) -> do clearErr
108117 mod <- loadModule filename
118+ liftIO $ putStrLn $ convSExp "set-prompt" (mkPrompt [filename]) id
109119 liftIO $ putStrLn $ sendMessage id (Right (SymbolAtom "good"))
120+ ideslave [filename]
110121 Nothing -> do liftIO $ putStrLn $ sendMessage id (Left "did not understand"))
111122 (\e -> do liftIO $ putStrLn $ sendMessage 0 (Left (show e)))
112− ideslave orig mods
123+ ideslave mods
113124
114125-- | The prompt consists of the currently loaded modules, or "Idris" if there are none
115126mkPrompt [] = "Idris"
@@ -611,7 +622,7 @@ idrisMain opts =
611622 [] -> return ()
612623 (o:_) -> process "" (NewCompile o)
613624 when (runrepl && not idesl) $ runInputT replSettings $ repl ist inputs
614− when (idesl) $ ideslave ist inputs
625+ when (idesl) $ ideslaveStart inputs
615626 ok <- noErrors
616627 when (not ok) $ liftIO (exitWith (ExitFailure 1))
617628 where