Skip to content

Commit d69cca2

Browse files
committed
xterm.js expects \r\n instead of \n
Otherwise, the cursor will not be moved to the beginning of the row after switching new line.
1 parent b103be8 commit d69cca2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/log.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ static void stdout_callback(log_event_t *ev)
5252
ev->file, ev->line);
5353
#endif /* RV32_HAS(LOG_COLOR) */
5454
vfprintf(ev->udata, ev->fmt, ev->ap);
55+
#if defined(__EMSCRIPTEN__)
56+
fprintf(ev->udata, "\r\n");
57+
#else
5558
fprintf(ev->udata, "\n");
59+
#endif
5660
fflush(ev->udata);
5761
}
5862

0 commit comments

Comments
 (0)