Check out my first novel, midnight's simulacra!

Ncurses: Difference between revisions

From dankwiki
Line 2: Line 2:
* When modifying the palette via <tt>init_color()</tt>, this only affects the normal form of the color. Using <tt>A_BOLD</tt> with the color, for instance, will not reflect palette changes.
* When modifying the palette via <tt>init_color()</tt>, this only affects the normal form of the color. Using <tt>A_BOLD</tt> with the color, for instance, will not reflect palette changes.
* Modifying the palette requires a terminal that supports it, like "linux" or "xterm-256color"
* Modifying the palette requires a terminal that supports it, like "linux" or "xterm-256color"
{| class="wikitable" border="1"
! Terminal emulator
! Default terminfo
! 256-color terminfo
|-
| xterm
| xterm
| xterm-256color
|-
| Gnome-Terminal
| gnome
| gnome-256color
|-
|}
** The latter can be had from the ncurses-term package on [[Debian]].
** The latter can be had from the ncurses-term package on [[Debian]].
* ncurses will need have been compiled with --enable-ext-colors
* ncurses will need have been compiled with --enable-ext-colors

Revision as of 10:25, 1 November 2011

Colors

  • When modifying the palette via init_color(), this only affects the normal form of the color. Using A_BOLD with the color, for instance, will not reflect palette changes.
  • Modifying the palette requires a terminal that supports it, like "linux" or "xterm-256color"
Terminal emulator Default terminfo 256-color terminfo
xterm xterm xterm-256color
Gnome-Terminal gnome gnome-256color
    • The latter can be had from the ncurses-term package on Debian.
  • ncurses will need have been compiled with --enable-ext-colors

Unicode

  • You need use ncursesw, which ought have been built with --enable-widec
  • _XOPEN_SOURCE_EXTENDED must be #defined prior to including any ncurses headers (use -D_XOPEN_SOURCE_EXTENDED with gcc)
  • setlocale() needs have been called prior to calling any ncurses functions
    • ncurses assumes that the locale does not change once started