On Mon, Mar 14, 2011 at 08:30:30PM +0100, Tomas Cech wrote:
> I'm attaching simple patch which introduces secondarySendScroll
> resource support, which mostly does what I would like. Currently it
> sends some bogus escape sequence until I find something better (any
> ideas?). It is also enabled by default - I didn't find why and
> shift+up/down doesn't work at all. I hope that the idea is clear.

I fixed broken spacing (incorrect vim ts settings), removed this
setting from default configuration and found that shift+up/down
behaves correctly, but has to be enabled during compilation.
Attaching current version.

The last question still stands. What should be sent? When I looked
into code, Inoticed this:

command.C:855:   *   Prior = "ESC[5~"
command.C:856:   *   Shift+Prior = "ESC[5$"
command.C:857:   *   Ctrl+Prior = "ESC[5^"
command.C:858:   *   Ctrl+Shift+Prior = "ESC[5@

Is the shift+prior valid? How would look like the rest of sequences?

I run rxvt with bash. After pressing Ctrl+V and then Ctrl+Prior
generates  ^[[5^ and it matches what I have found in comment. Ctrl+V,
Ctrl+Next generates ^[[6^. Does it really mean that

Shift+Prior should send "ESC[5$"
Shift+Next  should send "ESC[6$"

?

xfce-terminal on the other hand generates
Ctrl+V, Ctrl+Prior      ^[[5;5~
Ctrl+V, Ctrl+Next       ^[[6;5~

which differs a lot from rxvt.

Further, rxvt after

Ctrl+V, Ctrl+up         generates ^[Oa
Ctrl+V, Ctrl+down       generates ^[Ob
Ctrl+V, up              generates ^[[A
Ctrl+V, down            generates ^[[B
Ctrl+V, Ctrl+Shift+up   generates ^[[a
Ctrl+V, Ctrl+Shift+down generates ^[[b

I have no clue here.

Best regards,

Tomas Cech
diff --git a/command.C b/command.C
index 9a99c29..a0bf803 100644
--- a/command.C
+++ b/command.C
@@ -509,13 +509,23 @@ rxvt_term::key_press (XKeyEvent &ev)
 #endif
               if (keysym == XK_Prior)
                 {
-                  scr_page (UP, lnsppg);
-                  return;
+                  if (current_screen == SECONDARY && option(Opt_secondarySendScroll)) {
+                    tt_write ("\033[1j", strlen("\033[1j"));
+                    return;
+                  } else {
+                    scr_page (UP, lnsppg);
+                    return;
+                  }
                 }
               else if (keysym == XK_Next)
                 {
-                  scr_page (DN, lnsppg);
-                  return;
+                  if (current_screen == SECONDARY && option(Opt_secondarySendScroll)) {
+                    tt_write ("\033[0j", strlen("\033[0j"));
+                    return;
+                  } else {
+                    scr_page (DN, lnsppg);
+                    return;
+                  }
                 }
             }
 #ifdef SCROLL_ON_UPDOWN_KEYS
@@ -523,13 +533,23 @@ rxvt_term::key_press (XKeyEvent &ev)
             {
               if (keysym == XK_Up)
                 {
-                  scr_page (UP, 1);
-                  return;
+                  if (current_screen == SECONDARY && option(Opt_secondarySendScroll)) {
+                    tt_write ("\033[3j", strlen("\033[3j"));
+                    return;
+                  } else {
+                    scr_page (UP, 1);
+                    return;
+                  }
                 }
               else if (keysym == XK_Down)
                 {
-                  scr_page (DN, 1);
-                  return;
+                  if (current_screen == SECONDARY && option(Opt_secondarySendScroll)) {
+                    tt_write ("\033[2j", strlen("\033[2j"));
+                    return;
+                  } else {
+                    scr_page (DN, 1);
+                    return;
+				  }
                 }
             }
 #endif
diff --git a/optinc.h b/optinc.h
index 4492d82..b864b3e 100644
--- a/optinc.h
+++ b/optinc.h
@@ -63,3 +63,5 @@
  nodef(buffered)
 #endif
 
+ def(secondarySendScroll,  35)
+
diff --git a/rsinc.h b/rsinc.h
index 903a771..a36d4d8 100644
--- a/rsinc.h
+++ b/rsinc.h
@@ -100,6 +100,7 @@
 #ifndef NO_SECONDARY_SCREEN
   def (secondaryScreen)
   def (secondaryScroll)
+  def (secondarySendScroll)
 #endif
 #ifdef OFF_FOCUS_FADING
   def (fade)
diff --git a/xdefaults.C b/xdefaults.C
index 1b654c5..bdc9d80 100644
--- a/xdefaults.C
+++ b/xdefaults.C
@@ -251,6 +251,7 @@ optList[] = {
 #ifndef NO_SECONDARY_SCREEN
               BOOL (Rs_secondaryScreen, "secondaryScreen", "ssc", Opt_secondaryScreen, 0, "enable secondary screen"),
               BOOL (Rs_secondaryScroll, "secondaryScroll", "ssr", Opt_secondaryScroll, 0, "enable secondary screen scroll"),
+              BOOL (Rs_secondarySendScroll, "secondarySendScroll", "sssr", Opt_secondarySendScroll, 0, "enable send scroll to application when using secondary screen"),
 #endif
 #if ENABLE_PERL
               RSTRG (Rs_perl_lib, "perl-lib", "string"), //, "colon-separated directories with extension scripts"),TODO

Attachment: signature.asc
Description: Digital signature

_______________________________________________
rxvt-unicode mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/rxvt-unicode

Reply via email to