more self-recover prompting cleanup (tty)

This commit is contained in:
nhmall
2019-12-04 13:10:12 -05:00
parent ea2b8a90ee
commit 4868f83db1
3 changed files with 17 additions and 1 deletions

View File

@@ -451,6 +451,7 @@ extern void FDECL(safe_status_enablefield,
extern void FDECL(safe_status_update, (int, genericptr_t, int, int, int, unsigned long *));
extern boolean NDECL(safe_can_suspend);
extern void FDECL(stdio_raw_print, (const char *));
extern void FDECL(stdio_nonl_raw_print, (const char *));
extern void FDECL(stdio_raw_print_bold, (const char *));
extern void NDECL(stdio_wait_synch);
extern int NDECL(stdio_nhgetch);

View File

@@ -1199,7 +1199,9 @@ tty_self_recover_prompt()
c = 'n';
ct = 0;
saved_procs = windowprocs;
safe_routines();
if (!WINDOWPORT("safe-startup"))
windowprocs = *get_safe_procs(2); /* arg 2 uses no-newline variant */
windowprocs.win_nhgetch = windows_console_custom_nhgetch;
raw_print("\n");
raw_print("\n");
raw_print("\n");

View File

@@ -114,6 +114,8 @@ int optn;
safe_procs.win_raw_print_bold = stdio_raw_print_bold;
safe_procs.win_nhgetch = stdio_nhgetch;
safe_procs.win_wait_synch = stdio_wait_synch;
if (optn == 2)
safe_procs.win_raw_print = stdio_nonl_raw_print;
}
return &safe_procs;
}
@@ -536,6 +538,17 @@ stdio_wait_synch()
void
stdio_raw_print(str)
const char *str;
{
if (str)
fprintf(stdout, "%s\n", str);
return;
}
/* no newline variation, add to your code:
windowprocs.win_raw_print = stdio_nonl_raw_print; */
void
stdio_nonl_raw_print(str)
const char *str;
{
if (str)
fprintf(stdout, "%s", str);