@@ -33,7 +33,7 @@ import Unison.Codebase qualified as Codebase
3333import Unison.Codebase.Branch (Branch )
3434import Unison.Codebase.Editor.HandleInput qualified as HandleInput
3535import Unison.Codebase.Editor.Input (Event (UnisonFileChanged ), Input (.. ))
36- import Unison.Codebase.Editor.Output (NumberedArgs , Output )
36+ import Unison.Codebase.Editor.Output (NumberedArgs , Output , outputShouldUsePager )
3737import Unison.Codebase.Editor.UCMVersion (UCMVersion )
3838import Unison.Codebase.ProjectPath qualified as PP
3939import Unison.Codebase.Watch qualified as Watch
@@ -225,8 +225,6 @@ main dir welcome ppIds initialInputs runtime sbRuntime codebase serverBaseUrl uc
225225
226226 let initialState = Cli. loopState0 ppIds
227227 initialInputsRef <- newIORef $ Welcome. run welcome ++ initialInputs ++ invalidProjectNamesInputs
228- pageOutput <- newIORef True
229-
230228 initialEcho <- hGetEcho stdin
231229 let restoreEcho = (\ currentEcho -> when (currentEcho /= initialEcho) $ hSetEcho stdin initialEcho)
232230 let getInput :: Cli. LoopState -> IO Input
@@ -243,14 +241,11 @@ main dir welcome ppIds initialInputs runtime sbRuntime codebase serverBaseUrl uc
243241 getProjectRoot
244242 (loopState ^. # numberedArgs)
245243 let notify :: Output -> IO ()
246- notify =
247- notifyUser (pure dir) fetchIssueFromGitHub
248- >=> ( \ o ->
249- ifM
250- (readIORef pageOutput)
251- (putPrettyNonempty o)
252- (putPrettyLnUnpaged o)
253- )
244+ notify o = do
245+ rendered <- notifyUser (pure dir) fetchIssueFromGitHub o
246+ if outputShouldUsePager o
247+ then putPrettyNonempty rendered
248+ else putPrettyLnUnpaged rendered
254249
255250 let awaitInput :: Cli. LoopState -> IO (Either Event Input )
256251 awaitInput loopState = do
@@ -267,11 +262,11 @@ main dir welcome ppIds initialInputs runtime sbRuntime codebase serverBaseUrl uc
267262 [ do
268263 event <- Ki. await fileEventThread
269264 pure do
270- writeIORef pageOutput False
271265 pure (Left event),
272266 do
273267 input <- Ki. await userInputThread
274- pure (pure (Right input))
268+ pure do
269+ pure (Right input)
275270 ]
276271 action
277272
0 commit comments