summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2025-08-21 11:29:44 +1000
committerJustin Bedo <cu@cua0.org>2025-08-21 11:29:54 +1000
commitef0301f1feddc591d9307e07a867e099b2e4272e (patch)
tree0c4fbe99f956ccc57cadfc3bec34134b018b5766
parent2471d5c4bd1456692f88df5c0f051b035cc0b139 (diff)
split lines on \rHEADmaster
Hack around progress bars etc.
-rw-r--r--jterm.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/jterm.hs b/jterm.hs
index fdb0d98..8091f81 100644
--- a/jterm.hs
+++ b/jterm.hs
@@ -411,7 +411,7 @@ handleEvent buffer display win bgcolour fgcolour linecolour selcolour font event
redraw
T toAppend -> do
let noesc = stripAnsiEscapeCodes toAppend
- expandedTabs = T.intercalate "\n" $ map expandTabs $ T.splitOn "\n" noesc
+ expandedTabs = T.intercalate "\n" $ map expandTabs $ concatMap (T.splitOn "\n") $ concatMap (T.splitOn "\r") $ T.splitOn "\r\n" noesc
cl = ptycursor b & linePos
linePos p = content b & R.splitAt p & fst & R.lengthAsPosition & posLine
delins' True (ptycursor b) (ptycursor b) $ R.fromText expandedTabs
@@ -510,7 +510,7 @@ handleEvent buffer display win bgcolour fgcolour linecolour selcolour font event
go x = mconcat x
watch :: Pty -> IO HandledEvent
-watch h = T . T.filter (/= '\r') . T.pack . B.toString <$> readPty h
+watch h = T . T.pack . B.toString <$> readPty h
main :: IO ()
main = do