Search code examples
ncursescurses

How to print rounded corner with curses/ncurses?


I printed my first curses program.

I suddenly get curious whether the round corners are possible in Curses UI. Is it possible to draw round corners? If it supports Unicode, and if it's possible to print some character like;

  ╭╮ ╰╯(U+256D~2570)

 it would be possible. Should I change the source code...? Or is there some API to change that characters?

enter image description here


Solution

  • ncurses uses a table (from terminfo/termcap) which tells ncurses how to map the "alternate" character set to the terminal's set of graphic characters.

    If you want to change this you will need to alter the terminfo/termcap entry for your terminal.

    See the terminfo man page for details of the terminfo file format. In particular look at the "Line Graphics" section.