aboutsummaryrefslogtreecommitdiff
path: root/xsrc/external/mit/xterm/dist/patch-interactive-reset
blob: 30874e502d4fb77077e1603906e02883ed483d50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
$NetBSD$

Add interactive-reset(string) action, which does the same as
hard-reset(), but it also sends the given string to the terminal
immediately after performing the reset.

The typical use is to send ^L after the hard reset, like so:

	interactive-reset(0x0c)

--- charproc.c.orig	2018-03-14 06:04:22.000000000 +0000
+++ charproc.c
@@ -205,6 +205,7 @@ static jmp_buf vtjmpbuf;
 
 /* event handlers */
 static void HandleBell PROTO_XT_ACTIONS_ARGS;
+static void HandleInteractiveReset PROTO_XT_ACTIONS_ARGS;
 static void HandleIgnore PROTO_XT_ACTIONS_ARGS;
 static void HandleKeymapChange PROTO_XT_ACTIONS_ARGS;
 static void HandleVisualBell PROTO_XT_ACTIONS_ARGS;
@@ -250,6 +251,7 @@ static XtActionsRec actionsList[] = {
     { "insert-eight-bit",	HandleEightBitKeyPressed },
     { "insert-selection",	HandleInsertSelection },
     { "insert-seven-bit",	HandleKeyPressed },
+    { "interactive-reset",	HandleInteractiveReset },
     { "interpret",		HandleInterpret },
     { "keymap",			HandleKeymapChange },
     { "popup-menu",		HandlePopupMenu },
@@ -11322,6 +11326,18 @@ HandleVisualBell(Widget w GCC_UNUSED,
 }
 
 /* ARGSUSED */
+void
+HandleInteractiveReset(Widget w,
+		       XEvent *event GCC_UNUSED,
+		       String *params GCC_UNUSED,
+		       Cardinal *param_count GCC_UNUSED)
+{
+    ReallyReset(term, True, False);
+    HandleStringEvent(w, event, params, param_count);
+    longjmp(vtjmpbuf, 1);
+}
+
+/* ARGSUSED */
 static void
 HandleIgnore(Widget w,
 	     XEvent *event,