tuit

toolbox pour des tui - retour accueil

git clone git://bebou.netlib.re/tuit

Log | Files | Refs |

commit f2c5ab71f2bf7e97fefd8d187d94e44db3807beb
parent 89fd92d6011ff43698cc5f89e7e5d032728e73ec
Auteurice: Arthur Pons <arthur.pons@unistra.fr>
Date:   Wed, 11 Jun 2025 15:25:44 +0200

choose fonctionne sur un stdin vide

Il fallait déplacer l'init de termbox après la lecture de stdin.

Diffstat:
Mchoose.c | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/choose.c b/choose.c @@ -12,11 +12,6 @@ int max(int a, int b) { return a > b ? a : b; } int min(int a, int b) { return a < b ? a : b; } int main(int argc, char **argv) { - tb_init(); - tb_hide_cursor(); - tb_set_input_mode(TB_INPUT_ESC | TB_INPUT_MOUSE); - struct tb_event ev; - int curelem=0; int count=0; int start=0; char line[CARD_NAME_SIZE]; char **list; @@ -30,6 +25,11 @@ int main(int argc, char **argv) { bool quit=false; + tb_init(); + tb_hide_cursor(); + tb_set_input_mode(TB_INPUT_ESC | TB_INPUT_MOUSE); + struct tb_event ev; + while(!quit) { tb_clear(); for (int i=0;i<min(tb_height(),count);i++) {