mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-01 20:51:52 -07:00
Shell: escape the string in the command line only
This commit is contained in:
@@ -48,7 +48,8 @@ import XMonad.Prompt
|
|||||||
data Shell = Shell
|
data Shell = Shell
|
||||||
|
|
||||||
instance XPrompt Shell where
|
instance XPrompt Shell where
|
||||||
showXPrompt Shell = "Run: "
|
showXPrompt Shell = "Run: "
|
||||||
|
completionToCommand _ = escape
|
||||||
|
|
||||||
shellPrompt :: XPConfig -> X ()
|
shellPrompt :: XPConfig -> X ()
|
||||||
shellPrompt c = do
|
shellPrompt c = do
|
||||||
@@ -85,7 +86,7 @@ getShellCompl cmds s | s == "" || last s == ' ' = return []
|
|||||||
if isDirectory fs then return [x ++ "/"]
|
if isDirectory fs then return [x ++ "/"]
|
||||||
else return [x]
|
else return [x]
|
||||||
_ -> return f
|
_ -> return f
|
||||||
return . map escape . uniqSort $ files ++ commandCompletionFunction cmds s
|
return . uniqSort $ files ++ commandCompletionFunction cmds s
|
||||||
|
|
||||||
commandCompletionFunction :: [String] -> String -> [String]
|
commandCompletionFunction :: [String] -> String -> [String]
|
||||||
commandCompletionFunction cmds str | '/' `elem` str = []
|
commandCompletionFunction cmds str | '/' `elem` str = []
|
||||||
|
Reference in New Issue
Block a user