mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-31 20:21:51 -07:00
Be consistent with core utf8-string usage.
Now that spawn assumes executeFile takes a String containing utf8 codepoints (and takes an actual String as input) adjust Prompt.Shell to avoid double encoding. U.Run functions are updated to be consistent with spawn.
This commit is contained in:
@@ -62,7 +62,7 @@ instance XPrompt Shell where
|
||||
shellPrompt :: XPConfig -> X ()
|
||||
shellPrompt c = do
|
||||
cmds <- io getCommands
|
||||
mkXPrompt Shell c (getShellCompl cmds) (spawn . encodeString)
|
||||
mkXPrompt Shell c (getShellCompl cmds) spawn
|
||||
|
||||
{- | See safe and unsafeSpawn. prompt is an alias for safePrompt;
|
||||
safePrompt and unsafePrompt work on the same principles, but will use
|
||||
@@ -81,9 +81,9 @@ shellPrompt c = do
|
||||
prompt, unsafePrompt, safePrompt :: FilePath -> XPConfig -> X ()
|
||||
prompt = unsafePrompt
|
||||
safePrompt c config = mkXPrompt Shell config (getShellCompl [c]) run
|
||||
where run = safeSpawn c . return . encodeString
|
||||
where run = safeSpawn c . return
|
||||
unsafePrompt c config = mkXPrompt Shell config (getShellCompl [c]) run
|
||||
where run a = unsafeSpawn $ c ++ " " ++ encodeString a
|
||||
where run a = unsafeSpawn $ c ++ " " ++ a
|
||||
|
||||
getShellCompl :: [String] -> String -> IO [String]
|
||||
getShellCompl cmds s | s == "" || last s == ' ' = return []
|
||||
|
Reference in New Issue
Block a user