diff options
author | Spencer Janssen <spencerjanssen@gmail.com> | 2009-02-13 00:46:08 +0100 |
---|---|---|
committer | Spencer Janssen <spencerjanssen@gmail.com> | 2009-02-13 00:46:08 +0100 |
commit | c7721521abd7bb7bb91b33c6f9e66adac9d3c76d (patch) | |
tree | 64c8f9a0484a00a04442792fbda837f4303ca8aa | |
parent | 0ae8191a492cdcc200d951c6c859853b55c4ebe7 (diff) | |
download | XMonadContrib-c7721521abd7bb7bb91b33c6f9e66adac9d3c76d.tar.gz XMonadContrib-c7721521abd7bb7bb91b33c6f9e66adac9d3c76d.tar.xz XMonadContrib-c7721521abd7bb7bb91b33c6f9e66adac9d3c76d.zip |
SpawnOn: add 'exec' to shell strings where possible
Ignore-this: c7de4e05803d60b10f38004dcbda4732
darcs-hash:20090212234608-25a6b-50ee5321e891aa595cd247ac2e4823f08df266f3.gz
-rw-r--r-- | XMonad/Actions/SpawnOn.hs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/XMonad/Actions/SpawnOn.hs b/XMonad/Actions/SpawnOn.hs index 80723a8..ec1d57d 100644 --- a/XMonad/Actions/SpawnOn.hs +++ b/XMonad/Actions/SpawnOn.hs @@ -26,6 +26,7 @@ module XMonad.Actions.SpawnOn ( shellPromptOn ) where +import Data.List (isInfixOf) import Data.IORef import System.Posix.Types (ProcessID) @@ -100,5 +101,11 @@ spawnHere sp cmd = withWindowSet $ \ws -> spawnOn sp (W.currentTag ws) cmd -- application on given workspace. spawnOn :: Spawner -> WorkspaceId -> String -> X () spawnOn sp ws cmd = do - p <- spawnPID cmd + p <- spawnPID $ mangle cmd io $ modifyIORef (pidsRef sp) (take maxPids . ((p, ws) :)) + where + -- TODO this is silly, search for a better solution + mangle xs | any (`elem` metaChars) xs || "exec" `isInfixOf` xs = xs + | otherwise = "exec " ++ xs + metaChars = "&|;" + |