summaryrefslogtreecommitdiffhomepage
path: root/ControlWindow.hs
diff options
context:
space:
mode:
Diffstat (limited to 'ControlWindow.hs')
-rw-r--r--ControlWindow.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/ControlWindow.hs b/ControlWindow.hs
index 4f806c9..c5a6be9 100644
--- a/ControlWindow.hs
+++ b/ControlWindow.hs
@@ -67,7 +67,7 @@ openControlWindow = do
ichan <- newTMChanIO
ochan <- newTMChanIO
_ <- async $ serveControlSocket soc ichan ochan
- myexe <- getExecutablePath
+ myexe <- getMyExe
mproc <- runInVirtualTerminal winDesc myexe ["--control"]
let cannotrun = do
putStrLn "You need to open another shell prompt, and run: debug-me --control"
@@ -83,6 +83,13 @@ openControlWindow = do
Left (Just ControlWindowOpened) -> return (ichan, ochan)
Left _ -> error "unexpected message from control process"
Right _ -> cannotrun
+
+
+-- | Get path to debug-me program.
+--
+-- The standalone bundle sets DEBUG_ME_EXE to the path to use.
+getMyExe :: IO FilePath
+getMyExe = maybe getExecutablePath return =<< lookupEnv "DEBUG_ME_EXE"
type Prompt = ()
type Response = String