notcurses_stop(3)
π notcurses_stop(3) π
okay bestie, welcome to the notcurses_stop(3) page β the one about freeing up resources and restoring the initial terminal state. it's giving cleanup era. π
πΈ NAME πΈ
notcurses_stop β free up resources and restore initial terminal state
β¨ SYNOPSIS β¨
#include <notcurses/notcurses.h>
int notcurses_stop(struct notcurses* nc);
π DESCRIPTION π
notcurses_stop frees up any resources associated with the struct notcurses provided as nc, and it attempts to restore the terminal to its state prior to calling notcurses_init(3). it also unregisters any signal handlers put into place by notcurses_init(3). nc must not be used following the call, and all references to ncplanes, cells, etc. are invalidated. like, literally do not touch it after. π
once the terminal has been reset, a summary of runtime and performance is printed, unless NCOPTION_SUPPRESS_BANNERS was provided to notcurses_init(3).
the first step taken by notcurses_stop is a call to the internal function notcurses_stop_minimal. this is the same function called by the fatal signal handlers installed in the absence of NCOPTION_NO_QUIT_SIGHANDLERS. this function:
- disables the Notcurses signal handlers
- emits the
opterminfo capability, if supported - emits the
sgr0terminfo capability, if supported - emits the
octerminfo capability, if supported - emits the
rmcupterminfo capability, if supported (and ifNCOPTION_NO_ALTERNATE_SCREENwas not provided) - emits the
cnormterminfo capability, if supported
respectively, these restore the default colorpair to its original value (op), turn off all text attributes (sgr0), restore the default palette (oc), exit the alternate screen (rmcup), and restore the cursor to its default appearance (cnorm). iconic behavior, honestly. β¨
it is legal to pass NULL to notcurses_stop. this is a no-op. π«Ά
β οΈ NOTES β οΈ
behavior is undefined if other threads are working with nc when or after this function is called. and ngl, it is unlikely to be good. π
π RETURN VALUES π
on success, 0 is returned. otherwise, a negative value is returned.
π SEE ALSO π
notcurses(3), notcurses_init(3), terminfo(5)
ποΈ AUTHORS ποΈ
nick black nickblack@linux.com
okay that's the whole page, bestie! footer vibes: version v3.0.17 on the notcurses_stop(3) page β and the source footer didn't show a date, so i'm not inventing one. no cap, periodt. π
π¦ where this page comes from
- alpine 3.24: notcurses-doc 3.0.17-r0 Β· Apache-2.0
- ubuntu resolute: libnotcurses-core-dev 3.0.17+dfsg-3 Β· Apache-2.0
- ubuntu stonking: libnotcurses-core-dev 3.0.17+dfsg-3 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms