|
From: | Ryan Johnson |
Subject: | bug#7117: 23.2.2 mangles terminal escape sequences |
Date: | Mon, 27 Sep 2010 14:10:29 +0200 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100802 Lightning/1.0b2 Thunderbird/3.1.2 |
Hi all, Emacs-23.2 occasionally loses parts of terminal escape sequences, confusing xt-mouse.el and dumping garbage text in the user's buffer. Steps to reproduce:
The number of characters missing ranges from 1 (only ESC missing) to all but one (only [ present); I don't think I've yet seen an entire sequence disappear. The harder the flick the more numerous the mangled escape sequences. It's not an OS issue because I can reproduce it on three very different machines (32-bit cygwin, 64-bit redhat, 32-bit solaris). It's also not a problem with the terminal because the intercepted input is correct. Finally, it's not a problem with xt-mouse.el because show-lossage is incorrect. To give one example I generated using the above steps, emacs *scratch* buffer shows: `b[[M`b[ The output of show-lossage is (note the orphaned ` b [, and later the orphaned [, and finally the orphaned M ` b [): ESC [ > 7 7 ; 9 0 0 ; 0 c ESC x x t e r m - m o u s e TAB RET ESC [ M ` b [ ` b [ ESC [ M ` b [ ESC [ M ` b [ ESC [ M ` b [ ESC [ M ` b [ ESC [ M ` b [ [ M ` b [ ESC [ M ` b [ ESC O P l The relevant snippet of input.txt is: ;;;;;ESC[M`b[ESC[M`b[ESC[M`b[ESC[M`b[ESC[M`b[ESC[M`b[ESC[M`b[ESC[M`b[ESC[M`b[ESC[M`b[ESC[M`b[ESCOPl Thoughts? Ryan ===== tee-input.c ==== #include <dlfcn.h> #include <unistd.h> typedef ssize_t (*read_func)(int fildes, void *buf, size_t nbyte); ssize_t read(int fildes, void *buf, size_t nbyte) { static read_func old_read = 0; if(!old_read) old_read = (read_func) dlsym(RTLD_NEXT, "read"); ssize_t rval = old_read(fildes, buf, nbyte); if(rval > 0) write(2, buf, rval); return rval; } ================= |
[Prev in Thread] | Current Thread | [Next in Thread] |