xterm alternate screen - alternateScroll - pageup/pagedown

Dennis Nezic dennisn at dennisn.mooo.com
Fri May 5 01:28:36 UTC 2023


In alternate screens, with alternateScroll mode, I wonder if it'd be more useful to send Prior / Next (PageUp / PageDown) signals instead of Up / Down when scrolling with a mouse/touchpad? Many apps (like irssi) use Up/Down to navigate through their command lines, whereas PageUp/PageDown seems a bit more universally understood.

The downside is that the simulated scolling won't be smooth, it'll jump by a page, but that can be customized in most of these apps to jump less, or to do single-line scrolling.

Currently my xterm sends five Up/Down signals each time I scroll. With the attached patch it sends one Prior/Next signal. "Scrolling" works in all my terminal apps now.

By the way, how can I get these alternateScroll events to include Shift- or Ctrl- modifiers? Currently they're being ignored.
-------------- next part --------------
--- a/scrollbar.c	2023-05-01 15:19:31.000000000 -0400
+++ b/scrollbar.c	2023-05-02 11:36:24.000000000 -0400
@@ -716,20 +716,16 @@
 	screen->alternateScroll && screen->whichBuf) {
 	ANSI reply;
 
-	amount /= FontHeight(screen);
 	memset(&reply, 0, sizeof(reply));
-	reply.a_type = ((xw->keyboard.flags & MODE_DECCKM)
-			? ANSI_SS3
-			: ANSI_CSI);
+	reply.a_type = ANSI_CSI;
+	reply.a_nparam = 1;
+	reply.a_final = '~';
 	if (amount > 0) {
-	    reply.a_final = 'B';
+	    reply.a_param[0] = (ParmType) 6;
 	} else {
-	    amount = -amount;
-	    reply.a_final = 'A';
-	}
-	while (amount-- > 0) {
-	    unparseseq(xw, &reply);
+	    reply.a_param[0] = (ParmType) 5;
 	}
+	unparseseq(xw, &reply);
     } else {
 	ScrollTextUpDownBy(w, (XtPointer) 0, (XtPointer) amount);
     }


More information about the xorg mailing list