notcurses/doc/man/man3/notcurses.3.ronn

56 lines
2.2 KiB
Plaintext
Raw Normal View History

2019-12-28 20:17:34 -05:00
notcurses(3) -- TUI library for modern terminal emulators
=========================================================
2019-12-27 07:36:42 -05:00
## SYNOPSIS
`#include <notcurses.h>`
`-lnotcurses`
## DESCRIPTION
notcurses builds atop the terminfo(5) abstraction layer to provide reasonably
portable vivid character displays. It is an intellectual descendant of
ncurses(3NCURSES), but goes beyond that library (and the X/Open Curses API it
implements). notcurses is capable of subregion fades, 24bpp DirectColor,
transparency, multimedia, and safe multithreaded use.
A program wishing to use notcurses will need to link it, ideally using the
output of `pkg-config --libs notcurses` (see pkg-config(1)). It is advised to
compile with the output of `pkg-config --cflags notcurses`. If using CMake, a
support file is provided, and can be accessed as `notcurses` (see cmake(1)).
2019-12-28 20:17:34 -05:00
`notcurses_init(3)` can then be used to initialize a notcurses instance for a
given `FILE*` (usually `stdout`), after calling `setlocale(3)` to prepare a
UTF-8 locale (see [Initialization][]).
2019-12-27 08:16:13 -05:00
### Initialization
2019-12-27 07:36:42 -05:00
Before calling into notcurses—and usually as one of the first calls of the
2019-12-27 08:16:13 -05:00
program—be sure to call `setlocale` with an appropriate UTF-8 `LC_ALL`
2019-12-27 07:36:42 -05:00
locale. It is usually appropriate to use `setlocale(LC_ALL, "")`, relying on
the user to properly set the `LANG` environment variable. notcurses will
refuse to start if `nl_langinfo(3)` doesn't indicate UTF-8.
2019-12-27 08:16:13 -05:00
`notcurses_init` accepts a `struct notcurses_options` allowing fine-grained
control of notcurses behavior, including signal handlers, alternative screens,
and overriding the TERM environment variable. A `terminfo` entry appropriate
for the actual terminal must be available.
### Shutdown
2019-12-28 20:17:34 -05:00
Before exiting, `notcurses_stop(3)` should be called. In addition to freeing up
resources, this is necessary to restore the terminal to a state useful for the
shell. By default, `notcurses_init` installs signal handlers to catch all
signals which would normally terminate the process. The new handlers will try
to call `notcurses_stop`, and then propagate the received signal to the
previous action.
2019-12-27 08:16:13 -05:00
2019-12-27 07:36:42 -05:00
## AUTHORS
Nick Black <nickblack@linux.com>
## SEE ALSO
2019-12-28 20:17:34 -05:00
notcurses-demo(1), notcurses_init(3), notcurses_stop(3), ncurses(3NCURSES), terminfo(5)