Skip to content

Commit

Permalink
ui-vt100: write ouptut using write(3)
Browse files Browse the repository at this point in the history
we use raw write elsewhere; no need to go through stdio unnecessarily.
  • Loading branch information
rnpnr committed Jan 5, 2025
1 parent 1e52d33 commit 8a14a81
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ui-terminal-vt100.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
* See http://invisible-island.net/xterm/ctlseqs/ctlseqs.txt
* for further information.
*/
#include <stdio.h>
#include "buffer.h"

#define UI_TERMKEY_FLAGS TERMKEY_FLAG_UTF8
Expand Down Expand Up @@ -75,8 +74,7 @@ static CellColor color_terminal(Ui *ui, uint8_t index) {


static void output(const char *data, size_t len) {
fwrite(data, len, 1, stderr);
fflush(stderr);
write(STDERR_FILENO, data, len);
}

static void output_literal(const char *data) {
Expand Down Expand Up @@ -122,7 +120,7 @@ static void ui_term_backend_blit(Ui *tui) {
if ((style->attr & a) == (attr & a))
continue;
buffer_appendf(buf, "\x1b[%sm",
style->attr & a ?
style->attr & a ?
cell_attrs[i].on :
cell_attrs[i].off);
}
Expand Down

0 comments on commit 8a14a81

Please sign in to comment.