
On 21 September 2010 06:06, Joachim Breitner
Hi,
I just noticed this in my process list:
│ ├─xmonad-x86_64-l │ │ └─sh -c gnome-terminal │ │ └─gnome-terminal
and the reason is here, in Core.hs:
-- | Like 'spawn', but returns the 'ProcessID' of the launched application spawnPID :: MonadIO m => String -> m ProcessID spawnPID x = io . forkProcess . finally nullStdin $ do uninstallSignalHandlers createSession executeFile "/bin/sh" False ["-c", x] Nothing where nullStdin = do fd <- openFd "/dev/null" ReadOnly Nothing defaultFileFlags dupTo fd stdInput closeFd fd
Generally, this is of course useful. But I bet that most commands passed to spawn are simple program names without arguments or any fancy shell-related stuff. Executing a shell here seems overkill. Not much, but still avoidable.
I believe the reason here is to do a double fork, such that when xmonad restarts the program you launched via xmonad isn't killed. -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com