pkgsrc/security/putty-devel/patches/patch-am
ahoka 27ce463e2d Import putty-0.6.20090906 as security/putty-devel.
PuTTY is a client program for the SSH, Telnet and Rlogin network protocols.

These protocols are all used to run a remote session on a computer, over a
network. PuTTY implements the client end of that session: the end at which
the session is displayed, rather than the end at which it runs.
2009-09-07 18:01:43 +00:00

48 lines
1.3 KiB
Text

$NetBSD: patch-am,v 1.1.1.1 2009/09/07 18:01:43 ahoka Exp $
Make the home/end keys work on BSD servers as well as Linux ones
Index: terminal.c
===================================================================
--- terminal.c (revision 8466)
+++ terminal.c (working copy)
@@ -6131,13 +6131,6 @@
}
}
- /* RXVT Home/End */
- if (term->cfg.rxvt_homeend &&
- (keysym == PK_HOME || keysym == PK_END)) {
- p += sprintf((char *) p, keysym == PK_HOME ? "\x1B[H" : "\x1BOw");
- goto done;
- }
-
if (term->vt52_mode) {
int xkey;
@@ -6158,11 +6151,23 @@
goto done;
}
+ /* Home/End */
+ if (keysym == PK_HOME || keysym == PK_END) {
+ /* Send the correct XTerm or rxvt codes for home/end
+ * We used to send ^[1~ and [4~ for Xterm,
+ * but those are Linux console */
+ const char *he;
+ if (term->cfg.rxvt_homeend)
+ he = keysym == PK_HOME ? "\x1B[7~" : "\x1B[8~";
+ else
+ he = keysym == PK_HOME ? "\x1BOH" : "\x1BOF";
+ p += sprintf((char *) p, he);
+ goto done;
+ }
+
switch (keysym) {
- case PK_HOME: code = 1; break;
case PK_INSERT: code = 2; break;
case PK_DELETE: code = 3; break;
- case PK_END: code = 4; break;
case PK_PAGEUP: code = 5; break;
case PK_PAGEDOWN: code = 6; break;
default: code = 0; break; /* else gcc warns `enum value not used' */