From a8a187f89b9272a8a8c866ab5ed58cf3d1816cb5 Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 4 Feb 2019 18:24:17 -0800 Subject: [PATCH] tty ^P recall for dolook/whatis feedback Noticed while testing the history suppression: if you have DECgraphics enabled and look at a graphics character on the map, the topline shows x description of x where 'x' is displayed as it appears on the map (line drawing char). ^P for msg_window:single knows about that and reproduces the effect if you recall such a line. But msg_window:full/combination/reverse didn't know about that and dumped it as-is into text output, ending up with a strange 8-bit character for 'x' instead of the line drawing one. I think other rendering schemes will be unaffected by this. It's just duplicating what is done for msg_window:single. --- doc/fixes36.2 | 4 +++- win/tty/topl.c | 4 ++-- win/tty/wintty.c | 21 ++++++++++++++++----- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index eeb470901..a5c243912 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.246 $ $NHDT-Date: 1549327954 2019/02/05 00:52:34 $ +$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.248 $ $NHDT-Date: 1549333449 2019/02/05 02:24:09 $ This fixes36.2 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.1 in April 2018. Please note, however, @@ -482,6 +482,8 @@ tty: try harder to prevent a disconnected terminal (SIGHUP) from running amok and using up all available CPU time tty: suppress intermediate 'Count: 123' prompt and getpos autodescribe feedback from being included in ^P message recall +tty: ^P feedback with msg_window:full/combination/reverse containing output + from dolook/whatis could show strange characters for DECgraphics MacOSX: add curses window port MacOSX: add Xcode project to sys/unixNetHack.xcodeproj MacOSX: add Xcode supporting files README.xcode and XCode.xcconfig diff --git a/win/tty/topl.c b/win/tty/topl.c index 15ed6097f..3040c7ed4 100644 --- a/win/tty/topl.c +++ b/win/tty/topl.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 topl.c $NHDT-Date: 1549327499 2019/02/05 00:44:59 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.43 $ */ +/* NetHack 3.6 topl.c $NHDT-Date: 1549333449 2019/02/05 02:24:09 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.44 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Michael Allison, 2009. */ /* NetHack may be freely redistributed. See license for details. */ @@ -24,9 +24,9 @@ int tty_doprev_message() { register struct WinDesc *cw = wins[WIN_MESSAGE]; - winid prevmsg_win; int i; + if ((iflags.prevmsg_window != 's') && !ttyDisplay->inread) { /* not single */ if (iflags.prevmsg_window == 'f') { /* full */ diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 939a32552..1f863f159 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 wintty.c $NHDT-Date: 1549327503 2019/02/05 00:45:03 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.193 $ */ +/* NetHack 3.6 wintty.c $NHDT-Date: 1549333450 2019/02/05 02:24:10 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.194 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ @@ -2151,6 +2151,7 @@ winid window; struct WinDesc *cw; { int i, n, attr; + boolean linestart; register char *cp; for (n = 0, i = 0; i < cw->maxrow; i++) { @@ -2184,15 +2185,25 @@ struct WinDesc *cw; ++ttyDisplay->curx; } term_start_attr(attr); - for (cp = &cw->data[i][1]; + for (cp = &cw->data[i][1], linestart = TRUE; #ifndef WIN32CON *cp && (int) ++ttyDisplay->curx < (int) ttyDisplay->cols; - cp++) + cp++ #else *cp && (int) ttyDisplay->curx < (int) ttyDisplay->cols; - cp++, ttyDisplay->curx++) + cp++, ttyDisplay->curx++ #endif - (void) putchar(*cp); + ) { + /* message recall for msg_window:full/combination/reverse + might have output from '/' in it (see redotoplin()) */ + if (linestart && (*cp & 0x80) != 0) { + g_putch(*cp); + end_glyphout(); + linestart = FALSE; + } else { + (void) putchar(*cp); + } + } term_end_attr(attr); } } -- 2.40.0