handleOnNewCliCommand :: St -> EventMName (BrickTypes.Next St)
handleOnNewCliCommand st = do
  newState <- if not hasCommands
        then return st
        else do
            st' <- IOClass.liftIO $ parseAndEvaluateCommand handle c st
            let st'' = set commands (drop 1 cs) st'
            st''' <- IOClass.liftIO $  handleUserActivity st''    -- what to do when there is user activity ( send time logs for example)
            return st'''

  BrickMain.continue newState
  where
    hasCommands = not . null $ st ^. commands 
    cmds    = st ^. commands
    (c:cs) = cmds
    handle = DM.fromJust $ st ^. socketHandle
handleOnNewCliCommand :: St -> EventMName (BrickTypes.Next St)
handleOnNewCliCommand st = do
  newState <- if not hasCommands
        then return st
        else do
            st' <- IOClass.liftIO $ parseAndEvaluateCommand handle c st
            let st'' = set commands (drop 1 cs) st'
            st''' <- IOClass.liftIO $  handleUserActivity st''    -- what to do when there is user activity ( send time logs for example)
            return st'''

  BrickMain.continue newState
  where
    hasCommands = not . null $ st ^. commands 
    cmds    = st ^. commands
    (c:cs) = cmds
    handle = DM.fromJust $ st ^. socketHandle
handleOnNewCliCommand st = do
  newState <- if not hasCommands
        then return st
        else do
            st' <- IOClass.liftIO $ parseAndEvaluateCommand handle c st
            let st'' = set commands (drop 1 cs) st'
            st''' <- IOClass.liftIO $  handleUserActivity st''    -- what to do when there is user activity ( send time logs for example)
            return st'''

  BrickMain.continue newState
  where
    hasCommands = not . null $ st ^. commands 
    cmds    = st ^. commands
    (c:cs) = cmds
    handle = DM.fromJust $ st ^. socketHandle