ShellPrompt: remove harcoded path when calling bash

This commit is contained in:
Andrea Rossato
2007-10-26 21:23:34 +00:00
parent d875c05252
commit 051eb3b814

View File

@@ -81,7 +81,7 @@ unsafePrompt c config = mkXPrompt Shell config (getShellCompl [c]) run
getShellCompl :: [String] -> String -> IO [String] getShellCompl :: [String] -> String -> IO [String]
getShellCompl cmds s | s == "" || last s == ' ' = return [] getShellCompl cmds s | s == "" || last s == ' ' = return []
| otherwise = do | otherwise = do
f <- fmap lines $ runProcessWithInput "/bin/bash" [] ("compgen -A file " ++ s ++ "\n") f <- fmap lines $ runProcessWithInput "bash" [] ("compgen -A file " ++ s ++ "\n")
return . map escape . uniqSort $ f ++ commandCompletionFunction cmds s return . map escape . uniqSort $ f ++ commandCompletionFunction cmds s
commandCompletionFunction :: [String] -> String -> [String] commandCompletionFunction :: [String] -> String -> [String]