From c366c94c6507af5f4bde211bc66d230e127f9de1 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 24 Apr 2019 20:29:24 +0000 Subject: Use setaf/setab for aixterm colours, from Ailin Nemui. --- usr.bin/tmux/tty.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'usr.bin/tmux/tty.c') diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index fbf706cd6c2..c6a2df97feb 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.320 2019/04/17 14:43:49 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.321 2019/04/24 20:29:24 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -2388,8 +2388,7 @@ tty_colours_fg(struct tty *tty, const struct grid_cell *gc) /* Is this an aixterm bright colour? */ if (gc->fg >= 90 && gc->fg <= 97) { - xsnprintf(s, sizeof s, "\033[%dm", gc->fg); - tty_puts(tty, s); + tty_putcode1(tty, TTYC_SETAF, gc->fg - 90 + 8); goto save_fg; } @@ -2417,8 +2416,7 @@ tty_colours_bg(struct tty *tty, const struct grid_cell *gc) /* Is this an aixterm bright colour? */ if (gc->bg >= 90 && gc->bg <= 97) { - xsnprintf(s, sizeof s, "\033[%dm", gc->bg + 10); - tty_puts(tty, s); + tty_putcode1(tty, TTYC_SETAB, gc->bg - 90 + 8); goto save_bg; } -- cgit v1.2.3-59-g8ed1b