=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tty-keys.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -r1.59 -r1.60 --- src/usr.bin/tmux/tty-keys.c 2013/03/26 14:14:08 1.59 +++ src/usr.bin/tmux/tty-keys.c 2013/10/10 11:49:42 1.60 @@ -1,4 +1,4 @@ -/* $OpenBSD: tty-keys.c,v 1.59 2013/03/26 14:14:08 nicm Exp $ */ +/* $OpenBSD: tty-keys.c,v 1.60 2013/10/10 11:49:42 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -676,11 +676,17 @@ log_debug("mouse input: %.*s", (int) *size, buf); /* Check and return the mouse input. */ - if (b < 32 || x < 33 || y < 33) + if (b < 32) return (-1); b -= 32; - x -= 33; - y -= 33; + if (x >= 33) + x -= 33; + else + x = 256 - x; + if (y >= 33) + y -= 33; + else + y = 256 - y; } else if (buf[2] == '<') { /* Read the three inputs. */ *size = 3;