Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions lib/ghcitui-brick/Ghcitui/Brick/AppState.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ import qualified Data.Text.IO as T
import qualified Data.Vector as Vec
import Lens.Micro ((^.))
import qualified Lens.Micro as Lens
import qualified System.Info

import Ghcitui.Brick.AppConfig (AppConfig (..))
import qualified Ghcitui.Brick.AppConfig as AppConfig
import qualified Ghcitui.Brick.AppInterpState as AIS
import Ghcitui.Brick.AppTopLevel (AppName (..), CustomAppEvent)


import qualified Ghcitui.Brick.SourceWindow as SourceWindow
import Ghcitui.Ghcid.Daemon (toggleBreakpointLine)
import qualified Ghcitui.Ghcid.Daemon as Daemon
Expand Down Expand Up @@ -89,8 +89,9 @@ data AppState n = AppState
, getCurrentWorkingDir :: !FilePath
-- ^ The current working directory.
, _appInterpState :: AIS.AppInterpState T.Text n
-- ^ The live interpreter state (separate from the interpreter
-- and the app state itself.
{- ^ The live interpreter state (separate from the interpreter
and the app state itself.
-}
, interpLogs :: ![Text]
, appConfig :: !AppConfig
-- ^ Program launch configuration.
Expand All @@ -104,8 +105,9 @@ data AppState n = AppState
, sourceMap :: Map.Map FilePath T.Text
-- ^ Mapping between source filepaths and their contents.
, _currentWidgetSizes :: WidgetSizes
-- ^ Current window/box/panel sizes (since it can change). Do not edit
-- directly.
{- ^ Current window/box/panel sizes (since it can change). Do not edit
directly.
-}
, displayDebugConsoleLogs :: !Bool
-- ^ Whether to display debug Console logs.
, debugConsoleLogs :: [Text]
Expand Down Expand Up @@ -336,10 +338,12 @@ makeInitialState appConfig target cwd chan = do
"stdout" -> Daemon.LogOutputStdOut
filepath -> Daemon.LogOutputFile filepath
let logLevel = LogConfig.LogLevel (AppConfig.getVerbosity appConfig)
let osType = Just . T.pack $ System.Info.os
let startupConfig =
Daemon.StartupConfig
{ Daemon.logLevel = logLevel
, Daemon.logOutput = logOutput
, Daemon.osType = osType
}
interpState <- do
result <- Daemon.startup (T.unpack fullCmd) cwd' startupConfig
Expand Down
5 changes: 5 additions & 0 deletions lib/ghcitui-core/Ghcitui/Ghcid/StartupConfig.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module Ghcitui.Ghcid.StartupConfig (StartupConfig (..)) where

import qualified Data.Text as T
import Ghcitui.Ghcid.LogConfig (LogLevel, LogOutput)

-- | Configuration passed during Daemon 'startup'
Expand All @@ -8,4 +9,8 @@ data StartupConfig = StartupConfig
-- ^ How much do we want to log?
, logOutput :: !LogOutput
-- ^ Where do we log?
, osType :: !(Maybe T.Text)
{- ^ What operating system are we on? 'mingw32', 'linux', 'darwin' are known,
should map to 'System.Info.os'.
-}
}
Loading