Input bar at console bottom in C

后端 未结 4 1145
Happy的楠姐
Happy的楠姐 2021-02-04 03:20

Window bottom

Some applications like vim, mutt, aptitude contain

  • a top window section for output and
  • a bottom section for the user to type in
4条回答
  •  情书的邮戳
    2021-02-04 03:49

    Using ANSI escape sequence it's possible to control the position of the cursor:

    void gotoxy(int x, int y) {
        printf("\033[%d;%dH",x,y);
    }
    

    So once you figure out the terminal height and width then you can use that function to position the cursor wherever you like and print stuff.

提交回复
热议问题