.\" Automatically generated by Pandoc 2.9.2.1 .\" .TH "notcurses_stop" "3" "v2.0.4" "" "" .hy .SH NAME .PP notcurses_stop - free up resources and restore initial terminal state .SH SYNOPSIS .PP \f[B]#include \f[R] .PP \f[B]int notcurses_stop(struct notcurses* \f[R]\f[I]nc\f[R]\f[B]);\f[R] .SH DESCRIPTION .PP \f[B]notcurses_stop\f[R] frees up any resources associated with the \f[B]struct notcurses\f[R] provided as \f[B]nc\f[R], and attempts to restore the terminal to its state prior to calling \f[B]notcurses_init(3)\f[R]. It also unregisters any signal handlers put into place by \f[B]notcurses_init(3)\f[R]. \f[B]nc\f[R] must not be used following the call, and all references to ncplanes, cells, etc. are invalidated. .PP Once the terminal has been reset, a summary of runtime and performance is printed, unless \f[B]NCOPTION_SUPPRESS_BANNERS\f[R] was provided to \f[B]notcurses_init(3)\f[R]. .PP The first step taken by \f[B]notcurses_stop\f[R] is a call to the internal function \f[B]notcurses_stop_minimal\f[R]. This is the same function called by the fatal signal handlers installed in the absence of \f[B]NCOPTION_NO_QUIT_SIGHANDLERS\f[R]. This function: .IP \[bu] 2 Disables the Notcurses signal handlers .IP \[bu] 2 Emits the \f[B]op\f[R] terminfo capability, if supported .IP \[bu] 2 Emits the \f[B]sgr0\f[R] terminfo capability, if supported .IP \[bu] 2 Emits the \f[B]oc\f[R] terminfo capability, if supported .IP \[bu] 2 Emits the \f[B]rmcup\f[R] terminfo capability, if supported (and if \f[B]NCOPTION_NO_ALTERNATE_SCREEN\f[R] was not provided). .IP \[bu] 2 Emits the \f[B]cnorm\f[R] terminfo capability, if supported .PP Respectively, these restore the default colorpair to its original value (\f[B]op\f[R]), turn off all text attributes (\f[B]sgr0\f[R]), restore the default palette (\f[B]oc\f[R]), exit the alternate screen (\f[B]rmcup\f[R]), and restore the cursor to its default appearance (\f[B]cnorm\f[R]). .PP It is legal to pass \f[B]NULL\f[R] to \f[B]notcurses_stop\f[R]. This is a no-op. .SH NOTES .PP Behavior is undefined if other threads are working with \f[B]nc\f[R] when or after this function is called. It is unlikely to be good. .SH RETURN VALUES .PP On success, 0 is returned. Otherwise, a negative value is returned. .SH SEE ALSO .PP \f[B]notcurses(3)\f[R], \f[B]notcurses_init(3)\f[R], \f[B]terminfo(5)\f[R] .SH AUTHORS nick black .