From 7c84bca93d5816383854c663148bab94de27a0bb Mon Sep 17 00:00:00 2001 From: Adam Saponara Date: Fri, 24 Jun 2022 23:27:44 -0400 Subject: [PATCH] document optimistic nature of tb_set_output_mode (#37) --- termbox.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/termbox.h b/termbox.h index f5e3e19..ad26a2c 100644 --- a/termbox.h +++ b/termbox.h @@ -407,9 +407,11 @@ int tb_set_cell_ex(int x, int y, uint32_t *ch, size_t nch, uintattr_t fg, int tb_extend_cell(int x, int y, uint32_t ch); /* Sets the input mode. Termbox has two input modes: + * * 1. TB_INPUT_ESC * When escape (\x1b) is in the buffer and there's no match for an escape * sequence, a key event for TB_KEY_ESC is returned. + * * 2. TB_INPUT_ALT * When escape (\x1b) is in the buffer and there's no match for an escape * sequence, the next keyboard event is returned with a TB_MOD_ALT modifier. @@ -428,6 +430,7 @@ int tb_extend_cell(int x, int y, uint32_t ch); int tb_set_input_mode(int mode); /* Sets the termbox output mode. Termbox has three output modes: + * * 1. TB_OUTPUT_NORMAL => [1..8] * This mode provides 8 different colors: * TB_BLACK, TB_RED, TB_GREEN, TB_YELLOW, @@ -468,6 +471,11 @@ int tb_set_input_mode(int mode); * If mode is TB_OUTPUT_CURRENT, the function returns the current output mode. * * The default output mode is TB_OUTPUT_NORMAL. + * + * Note, not all terminals support all output modes, especially beyond + * TB_OUTPUT_NORMAL. There is also no very reliable way to determine color + * support dynamically. If portability is desired, callers are recommended to + * use TB_OUTPUT_NORMAL or make output mode end-user configurable. */ int tb_set_output_mode(int mode); -- 2.39.5