diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 37a7ce57c..558341fce 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -632,6 +632,10 @@ gas spore explosion killing a gas spore which triggers a recursive explosion if multiple bands of blank lines were squeezed out of DUMPLOG's map, spurious blank lines appeared in the final map output cursor positioning autodescribe of a statue while hallucinating was blank +tty+EDIT_GETLIN: if prompt plus existing output buffer contents (result of + a prior getlin() used as default input) was long enough to wrap to + second line, the wrap point could be different from when the previous + input was typed, resulting it strange erase-char/kill-chars behavior Platform- and/or Interface-Specific Fixes diff --git a/win/tty/getline.c b/win/tty/getline.c index 058912186..f471d853f 100644 --- a/win/tty/getline.c +++ b/win/tty/getline.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 getline.c $NHDT-Date: 1522796701 2018/04/03 23:05:01 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.34 $ */ +/* NetHack 3.6 getline.c $NHDT-Date: 1523619111 2018/04/13 11:31:51 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.35 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -56,13 +56,19 @@ getlin_hook_proc hook; cw->flags &= ~WIN_STOP; ttyDisplay->toplin = 3; /* special prompt state */ ttyDisplay->inread++; + + /* issue the prompt */ + custompline(OVERRIDE_MSGTYPE | SUPPRESS_HISTORY, "%s ", query); #ifdef EDIT_GETLIN - custompline(OVERRIDE_MSGTYPE | SUPPRESS_HISTORY, "%s %s", query, bufp); + /* bufp is input/output; treat current contents (presumed to be from + previous getlin()) as default input */ + addtopl(obufp); bufp = eos(obufp); #else - custompline(OVERRIDE_MSGTYPE | SUPPRESS_HISTORY, "%s ", query); - *obufp = 0; + /* !EDIT_GETLIN: bufp is output only; init it to empty */ + *bufp = '\0'; #endif + for (;;) { (void) fflush(stdout); Strcat(strcat(strcpy(toplines, query), " "), obufp);