XFree86 3.9Ac - xterm patch #61 - 1998/1/17 - T.Dickey <dickey@clark.net>
This patch modifies the reset behavior of xterm slightly:
+ change the terminfo entry so that rs1 (one of the strings used by
the 'reset' program) does a hard reset rather than switching
character sets. This is more in accord with other terminal
descriptions.
+ modifies the treatment of hard reset by the xterm program to
reset the saved lines.
+ corrects hard reset by also resetting user-defined keys (DECUDK).
--------------------------------------------------------------------------------
charproc.c | 15 ++++++++++++---
menu.c | 10 +++-------
misc.c | 25 +++++++++++++++----------
terminfo | 4 ++--
version.h | 2 +-
xterm.h | 3 ++-
6 files changed, 35 insertions, 24 deletions
--------------------------------------------------------------------------------
Index: charproc.c
--- xterm-60+/charproc.c Sun Jan 11 11:57:36 1998
+++ xterm-61/charproc.c Sat Jan 17 14:16:52 1998
@@ -2046,13 +2046,13 @@
case CASE_RIS:
/* RIS */
- VTReset(TRUE);
+ VTReset(TRUE, TRUE);
parsestate = groundtable;
break;
case CASE_DECSTR:
/* DECSTR */
- VTReset(FALSE);
+ VTReset(FALSE, FALSE);
parsestate = groundtable;
break;
@@ -4409,13 +4409,21 @@
*
* + autowrap mode should be reset (instead it's reset to the resource
* default).
+ * + the popup menu offers a choice of resetting the savedLines, or not.
+ * (but the control sequence does this anyway).
*/
void
-VTReset(full)
+VTReset(full, saved)
Boolean full;
+ Boolean saved;
{
register TScreen *screen = &term->screen;
+ if (saved) {
+ screen->savedlines = 0;
+ ScrollBarDrawThumb(screen->scrollWidget);
+ }
+
/* make cursor visible */
screen->cursor_set = ON;
@@ -4443,6 +4451,7 @@
update_appkeypad();
update_decbkm();
show_8bit_control(False);
+ reset_decudk();
FromAlternate(screen);
ClearScreen(screen);
Index: menu.c
--- xterm-60+/menu.c Mon Dec 29 12:22:34 1997
+++ xterm-61/menu.c Sat Jan 17 14:15:35 1998
@@ -826,7 +826,7 @@
Widget gw GCC_UNUSED;
XtPointer closure GCC_UNUSED, data GCC_UNUSED;
{
- VTReset (FALSE);
+ VTReset (FALSE, FALSE);
}
@@ -834,7 +834,7 @@
Widget gw GCC_UNUSED;
XtPointer closure GCC_UNUSED, data GCC_UNUSED;
{
- VTReset (TRUE);
+ VTReset (TRUE, FALSE);
}
@@ -842,11 +842,7 @@
Widget gw GCC_UNUSED;
XtPointer closure GCC_UNUSED, data GCC_UNUSED;
{
- register TScreen *screen = &term->screen;
-
- screen->savedlines = 0;
- ScrollBarDrawThumb(screen->scrollWidget);
- VTReset (TRUE);
+ VTReset (TRUE, TRUE);
}
Index: misc.c
--- xterm-60+/misc.c Sun Jan 11 11:57:36 1998
+++ xterm-61/misc.c Sat Jan 17 14:11:03 1998
@@ -871,6 +871,19 @@
}
void
+reset_decudk()
+{
+ int n;
+ for (n = 0; n < MAX_UDK; n++) {
+ if (user_keys[n].str != 0) {
+ free(user_keys[n].str);
+ user_keys[n].str = 0;
+ user_keys[n].len = 0;
+ }
+ }
+}
+
+void
do_dcs(dcsbuf, dcslen)
Char *dcsbuf;
Size_t dcslen;
@@ -964,16 +977,8 @@
if (*cp++ != '|')
return;
- if (clear_all) {
- int n;
- for (n = 0; n < MAX_UDK; n++) {
- if (user_keys[n].str != 0) {
- free(user_keys[n].str);
- user_keys[n].str = 0;
- user_keys[n].len = 0;
- }
- }
- }
+ if (clear_all)
+ reset_decudk();
while (*cp) {
char *str = malloc(strlen(cp) + 2);
Index: terminfo
--- xterm-60+/terminfo Sun Oct 26 16:05:57 1997
+++ xterm-61/terminfo Sat Jan 17 14:03:33 1998
@@ -117,7 +117,7 @@
rmkx=\E[?1l\E>,
rmso=\E[27m,
rmul=\E[24m,
- rs1=^O,
+ rs1=\Ec,
rs2=\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>,
sc=\E7,
setab=\E[4%p1%dm,
@@ -320,7 +320,7 @@
rmkx=\233?1l\E>,
rmso=\23327m,
rmul=\23324m,
- rs1=^O,
+ rs1=\Ec,
rs2=\E7\E[62"p\E\sG\233r\233m\233?7h\233?1;3;4;6l\2334l\E8\E>,
sc=\E7,
setab=\2334%p1%dm,
Index: version.h
--- xterm-60+/version.h Sun Jan 11 11:57:36 1998
+++ xterm-61/version.h Sat Jan 17 14:03:44 1998
@@ -6,4 +6,4 @@
* version of xterm has been built. The number in parentheses is my patch
* number (T.Dickey).
*/
-#define XTERM_VERSION "XFree86 3.9Ab(59)"
+#define XTERM_VERSION "XFree86 3.9Ac(61)"
Index: xterm.h
--- xterm-60+/xterm.h Sun Jan 11 11:57:36 1998
+++ xterm-61/xterm.h Sat Jan 17 14:14:25 1998
@@ -68,7 +68,7 @@
extern void ShowCursor PROTO((void));
extern void SwitchBufPtrs PROTO((TScreen *screen));
extern void ToggleAlternate PROTO((TScreen *screen));
-extern void VTReset PROTO((int full));
+extern void VTReset PROTO((int full, int saved));
extern void VTRun PROTO((void));
extern void dotext PROTO((TScreen *screen, int charset, Char *buf, Char *ptr));
extern void set_cursor_gcs PROTO((TScreen *screen));
@@ -154,6 +154,7 @@
extern void end_vt_mode PROTO((void));
extern void hide_tek_window PROTO((void));
extern void hide_vt_window PROTO((void));
+extern void reset_decudk PROTO((void));
extern void set_tek_visibility PROTO((int on));
extern void set_vt_visibility PROTO((int on));
extern void switch_modes PROTO((Bool tovt));