[xmonad] Re: Issue 359 in xmonad: shellPromptHere from XMonad.Actions.SpawnOn doesn't work as claimed

codesite-noreply at google.com codesite-noreply at google.com
Thu Jan 21 02:36:26 EST 2010

Comment #2 on issue 359 by wei.hoo: shellPromptHere from  
XMonad.Actions.SpawnOn doesn't work as claimed

I think I've found the issue. The way SpawnOn works is by associating a
managehook which will move the program to a specific workspace, with the
program's pid. Say we want to execute opera, the pid we recorded is  
for "/bin/sh

However, when manageSpawn comes to manage the spawned program, the pid it
sees is for "/usr/bin/opera", different from what we recorded. Therefore,  
it does
nothing, and opera is placed on our current window.

This issues begs a question: why does spawnPID do a double-fork? Below is  
from XMonad.Core:

-- | spawn. Launch an external application. Specifically, it double-forks  
-- runs the 'String' you pass as a command to /bin/sh.
spawn :: MonadIO m => String -> m ()
spawn x = spawnPID x >> return ()

-- | Like 'spawn', but returns the 'ProcessID' of the launched application
spawnPID :: MonadIO m => String -> m ProcessID
spawnPID x = xfork $ executeFile "/bin/sh" False ["-c", x] Nothing

You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:

More information about the xmonad mailing list