diff --git a/XMonad/Prompt/Pass.hs b/XMonad/Prompt/Pass.hs index 9f48b88016..bca8a41ded 100644 --- a/XMonad/Prompt/Pass.hs +++ b/XMonad/Prompt/Pass.hs @@ -302,11 +302,12 @@ typeString cmd = cmd ++ " | head -n1 | tr -d '\n' | xdotool type --clearmodifier -- | Generate a pass prompt. -- --- >>> pass "otp" "git\"hub\"" --- "pass otp \"git\\\"hub\\\"\"" +-- >>> pass "otp" "\\n'git'\"hub\"" +-- "pass otp \"\\\\n'git'\\\"hub\\\"\"" pass :: String -> String -> String pass cmd label = concat ["pass ", cmd, " \"", concatMap escape label, "\""] where escape :: Char -> String - escape '"' = "\\\"" - escape x = [x] + escape '"' = "\\\"" + escape '\\' = "\\\\" + escape x = [x]