SAFERHANGUP
This is an initial round of SAFERHANGUP hangup changes. It introduces SAFERHANGUP, provides the core framework, and enables it for UNIX. Window-port changes are provided for win/tty, win/X11 and win/gnome. Qt changes should be forthcoming after having Warwick look at them. window.doc is updated so windowport maintainers have an clue what needs to be done to support SAFERHANGUP.
This commit is contained in:
+6
-6
@@ -58,12 +58,7 @@ getlin_hook_proc hook;
|
||||
(void) fflush(stdout);
|
||||
Sprintf(toplines, "%s ", query);
|
||||
Strcat(toplines, obufp);
|
||||
if((c = Getchar()) == EOF) {
|
||||
#ifndef NEWAUTOCOMP
|
||||
*bufp = 0;
|
||||
#endif /* not NEWAUTOCOMP */
|
||||
break;
|
||||
}
|
||||
if((c = Getchar()) == EOF) c = '\033';
|
||||
if(c == '\033') {
|
||||
*obufp = c;
|
||||
obufp[1] = 0;
|
||||
@@ -183,6 +178,11 @@ register const char *s; /* chars allowed besides return */
|
||||
|
||||
while((c = tty_nhgetch()) != '\n') {
|
||||
if(iflags.cbreak) {
|
||||
if (c == EOF || c == '\033') {
|
||||
ttyDisplay->dismiss_more = 1;
|
||||
morc = '\033';
|
||||
break;
|
||||
}
|
||||
if ((s && index(s,c)) || c == x) {
|
||||
morc = (char) c;
|
||||
break;
|
||||
|
||||
+4
-3
@@ -677,7 +677,7 @@ tty_askname()
|
||||
wins[BASE_WINDOW]->cury - 1);
|
||||
ct = 0;
|
||||
while((c = tty_nhgetch()) != '\n') {
|
||||
if(c == EOF) error("End of input\n");
|
||||
if(c == EOF) c = '\033';
|
||||
if (c == '\033') { ct = 0; break; } /* continue outer loop */
|
||||
#if defined(WIN32CON)
|
||||
if (c == '\003') bail("^C abort.\n");
|
||||
@@ -2520,6 +2520,7 @@ tty_nhgetch()
|
||||
i = tgetch();
|
||||
#endif
|
||||
if (!i) i = '\033'; /* map NUL to ESC since nethack doesn't expect NUL */
|
||||
else if (i == EOF) i = '\033'; /* same for EOF */
|
||||
if (ttyDisplay && ttyDisplay->toplin == 1)
|
||||
ttyDisplay->toplin = 2;
|
||||
return i;
|
||||
@@ -2546,8 +2547,8 @@ tty_nh_poskey(x, y, mod)
|
||||
if (WIN_MESSAGE != WIN_ERR && wins[WIN_MESSAGE])
|
||||
wins[WIN_MESSAGE]->flags &= ~WIN_STOP;
|
||||
i = ntposkey(x, y, mod);
|
||||
if (!i && mod && *mod == 0)
|
||||
i = '\033'; /* map NUL to ESC since nethack doesn't expect NUL */
|
||||
if (!i && mod && (*mod == 0 || *mod == EOF))
|
||||
i = '\033'; /* map NUL or EOF to ESC, nethack doesn't expect either */
|
||||
if (ttyDisplay && ttyDisplay->toplin == 1)
|
||||
ttyDisplay->toplin = 2;
|
||||
return i;
|
||||
|
||||
Reference in New Issue
Block a user