From 44af5659d7a674b5901a8a3baf1a9cca48a37f54 Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Sun, 16 Jan 1994 04:04:13 +0000 Subject: [PATCH] * readline.c, display.c: Patches to allow use of all 80 columns on most terminals (those with am and xn). --- readline/ChangeLog | 3 +++ readline/readline.c | 14 +++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/readline/ChangeLog b/readline/ChangeLog index 1aa1e98b946..48ed69dd250 100644 --- a/readline/ChangeLog +++ b/readline/ChangeLog @@ -1,5 +1,8 @@ Sat Jan 15 19:36:12 1994 Per Bothner (bothner@kalessin.cygnus.com) + * readline.c, display.c: Patches to allow use of all 80 + columns on most terminals (those with am and xn). + Merge in changes from bash-1.13. The most obvious one is that the file readline.c has been split into multiple files. * bind.c, complete.c, dispay.c, isearch.c, parens.c, rldefs.h, diff --git a/readline/readline.c b/readline/readline.c index 7e5a820bcd7..00af9d64212 100644 --- a/readline/readline.c +++ b/readline/readline.c @@ -1064,6 +1064,9 @@ char *term_forward_char; /* How to go up a line. */ char *term_up; +/* True if we have funny auto-line-wrap ("am" and "xn"). */ +int term_xn; + /* A visible bell, if the terminal can be made to flash the screen. */ char *visible_bell; @@ -1146,7 +1149,10 @@ _rl_set_screen_size (tty, ignore_env) set_lines_and_columns (screenheight, screenwidth); #endif - screenwidth--; + /* If we don't have xn (most modern terminals do), + don't use the last column. */ + if (!term_xn) + screenwidth--; } init_terminal_io (terminal_name) @@ -1169,7 +1175,7 @@ init_terminal_io (terminal_name) #if defined (HACK_TERMCAP_MOTION) term_forward_char = (char *)NULL; #endif - terminal_can_insert = 0; + terminal_can_insert = term_xn = 0; return; #else /* !__GO32__ */ char *term, *buffer; @@ -1202,7 +1208,7 @@ init_terminal_io (terminal_name) #if defined (HACK_TERMCAP_MOTION) term_forward_char = (char *)NULL; #endif - terminal_can_insert = 0; + terminal_can_insert = term_xn = 0; return; } @@ -1229,6 +1235,8 @@ init_terminal_io (terminal_name) screenwidth = screenheight = 0; + term_xn = tgetflag ("am", &buffer) && tgetflag ("xn", &buffer); + _rl_set_screen_size (tty, 0); term_im = tgetstr ("im", &buffer); -- 2.30.2