1
1

Ticket #1668: Screen and input corruption under xterm [non-UTF]

The problem:
    viewing binary files contain char 0x9A leads to massive screen corruption and Search
    dialog pops up with 1;2c search string (multiple times depending on actual screen contents).
    So it looks like the file 'presses' F7 or / and shift-right_arrow for every specified
    character combination occurrence. In case of bigger files it's impossible to exit from
    such viewer, as search dialog keeps popping up after closing.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
GoTaR 2011-02-27 14:50:32 +00:00 коммит произвёл Andrew Borodin
родитель 8f92ba1fcb
Коммит 795b3a76f0
2 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -42,6 +42,7 @@
#include "lib/global.h" #include "lib/global.h"
#include "lib/strutil.h" /* str_term_form */ #include "lib/strutil.h" /* str_term_form */
#include "lib/util.h" /* is_printable() */
#include "tty-internal.h" /* slow_tty */ #include "tty-internal.h" /* slow_tty */
#include "tty.h" #include "tty.h"
@ -630,6 +631,8 @@ tty_print_anychar (int c)
} }
else else
{ {
if (!is_printable (c))
c = '.';
SLsmg_write_char ((SLwchar_Type) ((unsigned int) c)); SLsmg_write_char ((SLwchar_Type) ((unsigned int) c));
} }
} }

Просмотреть файл

@ -746,6 +746,15 @@ init_xterm_support (void)
{ {
xterm_flag = 1; xterm_flag = 1;
#ifdef HAVE_SLANG
/* For 8-bit locales, NCurses handles 154 (0x9A) symbol properly, while S-Lang
* requires SLsmg_Display_Eight_Bit >= 154 (OR manual filtering if xterm display
* detected - but checking TERM would fail under screen, OR running xterm
* with allowC1Printable).
*/
tty_display_8bit (FALSE);
#endif
/* Default to the standard xterm sequence */ /* Default to the standard xterm sequence */
if (!xmouse_seq) if (!xmouse_seq)
{ {