git console, output bug

This commit is contained in:
voidlizard 2025-02-13 13:10:19 +03:00
parent a54fcb6ade
commit f4abd662f8
1 changed files with 20 additions and 9 deletions

View File

@ -147,7 +147,6 @@ main = flip runContT pure do
hSetBuffering stdin LineBuffering hSetBuffering stdin LineBuffering
hSetBuffering stdout LineBuffering hSetBuffering stdout LineBuffering
setupLogger
origStderr <- liftIO $ dup stdError origStderr <- liftIO $ dup stdError
(readEnd, writeEnd) <- liftIO createPipe (readEnd, writeEnd) <- liftIO createPipe
@ -158,16 +157,20 @@ main = flip runContT pure do
origHandle <- liftIO $ fdToHandle origStderr origHandle <- liftIO $ fdToHandle origStderr
liftIO $ hSetBuffering origHandle NoBuffering liftIO $ hSetBuffering origHandle NoBuffering
liftIO $ hSetBuffering rStderr NoBuffering
lift $ void $ installHandler sigPIPE Ignore Nothing lift $ void $ installHandler sigPIPE Ignore Nothing
ready_ <- newEmptyTMVarIO
cp_ <- newTVarIO Nothing cp_ <- newTVarIO Nothing
refz <- newTVarIO mempty refz <- newTVarIO mempty
-- doesPathExist -- doesPathExist
ContT $ withAsync $ liftIO $ flip runContT pure do pp <- ContT $ withAsync $ liftIO $ flip runContT pure do
callCC \finished -> do callCC \finished -> do
atomically $ putTMVar ready_ True
forever do forever do
pause @'Seconds 0.1 pause @'Seconds 0.1
@ -187,13 +190,21 @@ main = flip runContT pure do
_ -> none _ -> none
liftIO do liftIO do
hClearLine origHandle
hSetCursorColumn origHandle 0 hSetCursorColumn origHandle 0
IO.hPutStr origHandle s hClearLine origHandle
unless (null (words s)) do
IO.hPutStr origHandle s
hSetCursorColumn origHandle 0 hSetCursorColumn origHandle 0
ContT $ bracket none $ const do ContT $ bracket none $ const do
cancel pp
hClearLine origHandle
hSetCursorColumn origHandle 0
cp <- readTVarIO cp_ cp <- readTVarIO cp_
let cpHash = fst <$> cp let cpHash = fst <$> cp
@ -212,6 +223,10 @@ main = flip runContT pure do
hFlush origHandle hFlush origHandle
atomically $ takeTMVar ready_
setupLogger
env <- nullGit3Env env <- nullGit3Env
ops <- DeferredOps <$> newTQueueIO ops <- DeferredOps <$> newTQueueIO
@ -223,17 +238,13 @@ main = flip runContT pure do
void $ lift $ withGit3Env env do void $ lift $ withGit3Env env do
-- d_ <- asks gitRuntimeDict
-- atomically $ writeTVar d_ (Just (RuntimeDict fuck))
--
conf <- readLocalConf conf <- readLocalConf
cli <- parseCLI cli <- parseCLI
url <- case cli of url <- case cli of
[ ListVal [_, RepoURL x ] ] -> do [ ListVal [_, RepoURL x ] ] -> do
notice $ "git remote ref set:" <+> green (pretty (AsBase58 x)) notice $ "git remote ref set:" <+> green (pretty (AsBase58 x)) <> line
setGitRepoKey x setGitRepoKey x
pure $ Just x pure $ Just x