diff options
| author | jao <jao@gnu.org> | 2020-05-17 23:44:49 +0100 | 
|---|---|---|
| committer | jao <jao@gnu.org> | 2020-05-17 23:44:49 +0100 | 
| commit | 16d1240ab8cd2502400c5ef1e4434654df8a2e1c (patch) | |
| tree | 59e48fef5a43f2f687150ee1ea4d68ec220873e7 /src/Xmobar | |
| parent | ad64ccf601e76a4504aacffffa234233b30ee24d (diff) | |
| download | xmobar-16d1240ab8cd2502400c5ef1e4434654df8a2e1c.tar.gz xmobar-16d1240ab8cd2502400c5ef1e4434654df8a2e1c.tar.bz2  | |
Temporarily restore Stdin to its previous state
Diffstat (limited to 'src/Xmobar')
| -rw-r--r-- | src/Xmobar/Plugins/StdinReader.hs | 9 | 
1 files changed, 2 insertions, 7 deletions
diff --git a/src/Xmobar/Plugins/StdinReader.hs b/src/Xmobar/Plugins/StdinReader.hs index ad7291e..bc4bb5f 100644 --- a/src/Xmobar/Plugins/StdinReader.hs +++ b/src/Xmobar/Plugins/StdinReader.hs @@ -22,21 +22,16 @@ import Prelude  import System.Posix.Process  import System.Exit  import System.IO +import Control.Exception (SomeException(..), handle)  import Xmobar.Run.Exec  import Xmobar.X11.Actions (stripActions) -import Xmobar.System.Utils (onSomeException)  data StdinReader = StdinReader | UnsafeStdinReader    deriving (Read, Show)  instance Exec StdinReader where    start stdinReader cb = do -    s <- -      getLine `onSomeException` -      (\e -> do -         let errorMessage = "xmobar: Received exception " <> show e -         hPrint stderr errorMessage -         cb errorMessage) +    s <- handle (\(SomeException e) -> do hPrint stderr e; return "") getLine      cb $ escape stdinReader s      eof <- isEOF      if eof  | 
