Skip to content

Commit f827f10

Browse files
committed
Skip "\ESC...\STX" sequences when printing output in the terminal-style Win32 backend.
1 parent 25fe300 commit f827f10

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

System/Console/Haskeline/Backend/Win32.hsc

+3-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,9 @@ crlf :: String
291291
crlf = "\r\n"
292292

293293
instance (MonadException m, MonadReader Layout m) => Term (Draw m) where
294-
drawLineDiff = drawLineDiffWin
294+
drawLineDiff (xs1,ys1) (xs2,ys2) = let
295+
fixEsc = filter ((/= '\ESC') . baseChar)
296+
in drawLineDiffWin (fixEsc xs1, fixEsc ys1) (fixEsc xs2, fixEsc ys2)
295297
-- TODO now that we capture resize events.
296298
-- first, looks like the cursor stays on the same line but jumps
297299
-- to the beginning if cut off.

0 commit comments

Comments
 (0)