The problem is that you're using literal characters ┌, ─, ┐, └, ─, ┘ instead of using the ncurses-independent symbols. You should use the ACS_??CORNER (for Upper/Lower and Left/Right) valuesand ACS_HLINE symbolic names and let ncurses work out how to represent those on your terminal.
Modifying your code from this,
mvprintw(0,0,"┏━┓");
mvprintw(1,0,"┗━┛");
Toto this,
move(0,0); addch(ACS_ULCORNER); addch(ACS_HLINE); addch(ACS_URCORNER);
move(1,0); addch(ACS_LLCORNER); addch(ACS_HLINE); addch(ACS_LRCORNER);
should ensure that the code works portably. I also changed the end of your main() procedure from a plain return 0 to thisthe following, so that the terminal couldwill be correctly reset when the program ends:
endwin();
exit(0);
Compile test.cpp and execute with,
LDLIBS=-lncurses make test && ./test
Useful references, in no particular order: