XMonad.Prompt.Unicode: use spawnPipe instead of runProcessWithInput

This commit is contained in:
Nick Hu
2020-10-13 20:39:21 +01:00
parent 02baee5f7e
commit 9c09072843
2 changed files with 9 additions and 2 deletions

View File

@@ -119,6 +119,11 @@
Added `compgenDirectories` and `compgenFiles` to get the directory/filename completion
matches returned by the compgen shell builtin.
* `XMonad.Prompt.Unicode`
Reworked internally to be call `spawnPipe` (asynchronous) instead of
`runProcessWithInput` (synchronous), which fixes `typeUnicodePrompt`.
* `XMonad.Hooks.DynamicLog`
Added `statusBar'` function, like existing `statusBar` but accepts a pretty

View File

@@ -112,8 +112,10 @@ mkUnicodePrompt prog args unicodeDataFilename config =
let m = searchUnicode entries s
return . map (\(c,d) -> printf "%s %s" [c] d) $ take 20 m
paste [] = return ()
paste (c:_) = do
runProcessWithInput prog args [c]
paste (c:_) = liftIO $ do
handle <- spawnPipe $ unwords $ prog : args
hPutChar handle c
hClose handle
return ()
-- | Prompt the user for a Unicode character to be inserted into the paste buffer of the X server.