/* Set default console usage if applicable */
#if ! ( defined ( CONSOLE_VMWARE ) && CONSOLE_EXPLICIT ( CONSOLE_VMWARE ) )
#undef CONSOLE_VMWARE
-#define CONSOLE_VMWARE CONSOLE_USAGE_ALL
+#define CONSOLE_VMWARE ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_TUI )
#endif
/** VMware logfile console GuestRPC channel */
unsigned short _COLS = 80;
unsigned short _LINES = 24;
+static unsigned int saved_usage;
+
static void ansiscr_reset ( struct _curses_screen *scr ) {
/* Reset terminal attributes and clear screen */
scr->attrs = 0;
printf ( "\033[0m" );
}
+static void ansiscr_init ( struct _curses_screen *scr ) {
+ saved_usage = console_set_usage ( CONSOLE_USAGE_TUI );
+ ansiscr_reset ( scr );
+}
+
+static void ansiscr_exit ( struct _curses_screen *scr ) {
+ ansiscr_reset ( scr );
+ console_set_usage ( saved_usage );
+}
+
static void ansiscr_movetoyx ( struct _curses_screen *scr,
unsigned int y, unsigned int x ) {
if ( ( x != scr->curs_x ) || ( y != scr->curs_y ) ) {
}
SCREEN _ansi_screen = {
- .init = ansiscr_reset,
- .exit = ansiscr_reset,
+ .init = ansiscr_init,
+ .exit = ansiscr_exit,
.movetoyx = ansiscr_movetoyx,
.putc = ansiscr_putc,
.getc = ansiscr_getc,
/** Debug messages */
#define CONSOLE_USAGE_DEBUG 0x0002
+/** Text-based user interface */
+#define CONSOLE_USAGE_TUI 0x0004
+
/** All console usages */
-#define CONSOLE_USAGE_ALL ( CONSOLE_USAGE_STDOUT | CONSOLE_USAGE_DEBUG )
+#define CONSOLE_USAGE_ALL \
+ ( CONSOLE_USAGE_STDOUT | CONSOLE_USAGE_DEBUG | CONSOLE_USAGE_TUI )
/** @} */
/* Set default console usage if applicable */
#if ! ( defined ( CONSOLE_SYSLOG ) && CONSOLE_EXPLICIT ( CONSOLE_SYSLOG ) )
#undef CONSOLE_SYSLOG
-#define CONSOLE_SYSLOG CONSOLE_USAGE_ALL
+#define CONSOLE_SYSLOG ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_TUI )
#endif
/** The syslog server */