@@ -315,11 +315,16 @@ runGhcid root chdirToRoot dotGhci packages mcmd =
315315 opts =
316316 [ "-W"
317317 , "--command='ghci -ignore-dot-ghci " <> makeBaseGhciOptions dotGhci <> "' "
318− , "--reload=config"
319318 , "--outputfile=ghcid-output.txt"
320− ] <> testCmd
319+ ] <> map (\x -> "--reload='" <> x <> "'") reloadFiles
320+ <> map (\x -> "--restart='" <> x <> "'") restartFiles
321+ <> testCmd
321322 testCmd = maybeToList (flip fmap mcmd $ \cmd -> "--test='" <> cmd <> "'") -- TODO: Shell escape
322323
324+ adjustRoot x = if chdirToRoot then makeRelative root x else x
325+ reloadFiles = map adjustRoot [root </> "config"]
326+ restartFiles = map (adjustRoot . _cabalPackageInfo_packageFile) packages
327+
323328makeBaseGhciOptions :: FilePath -> String
324329makeBaseGhciOptions dotGhci =
325330 unwords