ditEmail :: LazymailCurses ()
editEmail = do
  st <- get
  cfg <- ask
  fp <- getFileName
  exitStatus <- liftIO $ do
    child <- runProcess (textEditor cfg) [fp] Nothing Nothing Nothing Nothing Nothing
    waitForProcess child
  case exitStatus of
    ExitSuccess -> do
      st <- get
      let cs = (composeState st) { bodyReady = True }
      put $ st { composeState = cs }
    _ -> drawNotification "The text editor exited abnormally"

-- | Retrieve current file name. Create a randomized one if its's Nothing.

editEmail :: LazymailCurses ()
editEmail = do
  st <- get
  cfg <- ask
  fp <- getFileName
  exitStatus <- liftIO $ do
    child <- runProcess (textEditor cfg) [fp] Nothing Nothing Nothing Nothing Nothing
    waitForProcess child
  case exitStatus of
    ExitSuccess -> do
      st <- get
      let cs = (composeState st) { bodyReady = True }
      put $ st { composeState = cs }
    _ -> drawNotification "The text editor exited abnormally"

-- | Retrieve current file name. Create a randomized one if its's Nothing.
editEmail = do
  st <- get
  cfg <- ask
  fp <- getFileName
  exitStatus <- liftIO $ do
    child <- runProcess (textEditor cfg) [fp] Nothing Nothing Nothing Nothing Nothing
    waitForProcess child
  case exitStatus of
    ExitSuccess -> do
      st <- get
      let cs = (composeState st) { bodyReady = True }
      put $ st { composeState = cs }
    _ -> drawNotification "The text editor exited abnormally"

-- | Retrieve current file name. Create a randomized one if its's Nothing.