aboutsummaryrefslogtreecommitdiffstats
path: root/WorkspaceDir.hs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--WorkspaceDir.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/WorkspaceDir.hs b/WorkspaceDir.hs
index 97e5f94..32f548d 100644
--- a/WorkspaceDir.hs
+++ b/WorkspaceDir.hs
@@ -68,8 +68,10 @@ workspaceDir :: LayoutClass l a => String -> l a
workspaceDir s = ModifiedLayout (WorkspaceDir s)
scd :: String -> X ()
-scd x = do x' <- io (runProcessWithInput "bash" [] ("echo -n " ++ x) `catch` \_ -> return x)
- catchIO $ setCurrentDirectory x'
+scd x = do x' <- io (runProcessWithInput "bash" [] ("echo -n " ++ x) `catch` \_ -> return Nothing)
+ case x' of
+ Just newDir -> catchIO $ setCurrentDirectory newDir
+ Nothing -> return ()
changeDir :: XPConfig -> X ()
changeDir c = directoryPrompt c "Set working directory: " (sendMessage . Chdir)