diff options
author | tv <tv@shackspace.de> | 2014-07-28 23:38:40 +0200 |
---|---|---|
committer | tv <tv@shackspace.de> | 2014-07-28 23:38:40 +0200 |
commit | a30e97644079226e91614e70bef9e895e79a189f (patch) | |
tree | 3628b079747b1f357630f8c28e786a16c2dd032e | |
parent | f7695d4df8fd0d565d02c0d258090d372eddbfe9 (diff) |
replace dateThread by pre-filled buffer^_^
-rw-r--r-- | src/Main.hs | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/Main.hs b/src/Main.hs index 1a26868..f170492 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -7,11 +7,8 @@ import Control.Monad import Data.Char import Data.IORef import Data.List -import Data.Time.Clock (getCurrentTime) -import Data.Time.Format (formatTime) import Numeric (showIntAtBase) import System.IO -import System.Locale (defaultTimeLocale, rfc822DateFormat) --import System.Posix.Signals import GHC.Stats (getGCStats) @@ -46,7 +43,7 @@ main = do let st = VTState { mode = InsertMode - , buffer = ("", "") + , buffer = ("!while date; do sleep 1; done", "") , processCount = 0 } @@ -69,19 +66,9 @@ main = do -- render initial input line _withOutput $ return () - forkIO $ dateThread _withOutput 1000000 - uiThread cf _putState _getState -dateThread :: (IO () -> IO ()) -> Int -> IO () -dateThread _withOutput delay = forever $ do - t <- liftIO getCurrentTime - _withOutput $ - putStrLn $ formatTime defaultTimeLocale rfc822DateFormat t - threadDelay delay - - uiThread :: VTConfig -> (VTState -> IO ()) -> IO VTState -> IO () uiThread cf putState getState = forever $ do q0 <- getState |