G. Paul Ziemba
unread,Feb 5, 2012, 1:58:55 AM2/5/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I finally got annoyed enough at nn sending my xterm into goofball mode
due to non-ascii characters in posts that I made this quick and dirty
patch to mask off the high bit of characters sent to the terminal.
I'm open to suggestions for a better way to do it.
This patch is based on nn 6.7.3.
put "set term-7bit true" in .nn/init to enable.
--- term.c.orig 2005-06-29 14:40:27.000000000 -0700
+++ term.c 2012-02-04 22:29:13.000000000 -0800
@@ -153,6 +153,7 @@
int mouse_state; /* if xterm is in mouse state */
int mouse_usage; /* 0 don't set mouse, 1 only if xterm, 2 set
* mouse */
+int term_7bit = 0; /* mask top bit when displaying to terminal */
key_type help_key = '?';
key_type comp1_key = SP;
@@ -990,6 +991,9 @@
{
int i;
+ if (term_7bit)
+ c &= 0x7f;
+
#ifdef TERM_DEBUG
if (term_debug) {
fprintf(stderr, "tputc %d %d [%d] ", curxy_c, curxy_l, curxy_nonsp);
--- variable.c.orig 2005-03-30 11:15:31.000000000 -0800
+++ variable.c 2012-02-04 22:31:07.000000000 -0800
@@ -122,7 +122,7 @@
save_report, scroll_clear_page, select_leave_next, select_on_sender,
seq_cross_filtering, shell_restrictions, show_article_date,
show_current_time, show_motd_on_entry, silent, slow_mode,
- suggest_save_file, tidy_newsrc, use_ed_line, use_mail_folders,
+ suggest_save_file, term_7bit, tidy_newsrc, use_ed_line, use_mail_folders,
use_mmdf_folders, use_path_in_from, use_selections, use_visible_bell;
extern int /* integer variables */
@@ -386,6 +386,7 @@
"subject-match-offset", INT 0, (char **) &match_skip_prefix,
"subject-match-parts", BOOL 0, (char **) &match_parts_equal,
"suggest-default-save", BOOL 0, (char **) &suggest_save_file,
+ "term-7bit", BOOL 0, (char **) &term_7bit,
"tidy-newsrc", BOOL 0, (char **) &tidy_newsrc,
"time", BOOL 0, (char **) &show_current_time,
"trace-folder-packing", BOOL 0, (char **) &folder_rewrite_trace,
--
G. Paul Ziemba
FreeBSD unix:
10:56PM up 47 days, 1:17, 20 users, load averages: 0.32, 0.37, 0.35