diff --git a/src/util.c b/src/util.c index 2f4735b8..34da1a57 100644 --- a/src/util.c +++ b/src/util.c @@ -157,6 +157,10 @@ char *sanitize(char *arg, size_t len) return NULL; } +/* + * Called at boot, and shutdown, to (re)initialize the + * screen size for print() et al. + */ void screen_init(void) { if (!isatty(STDOUT_FILENO)) @@ -165,6 +169,16 @@ void screen_init(void) initscr(&screen_rows, &screen_cols); } +/* + * Called when debug mode is enabled to revert back + * to old-school safe defaults. + */ +void screen_exit(void) +{ + screen_rows = 24; + screen_cols = 80; +} + /** * Local Variables: * indent-tabs-mode: t diff --git a/src/util.h b/src/util.h index 26659b33..476afb44 100644 --- a/src/util.h +++ b/src/util.h @@ -48,6 +48,7 @@ char *uptime (long secs, char *buf, size_t len); char *sanitize (char *arg, size_t len); void screen_init (void); +void screen_exit (void); int screen_width (void); #endif /* FINIT_UTIL_H_ */