diff -wur bash-4.1/bash/lib/readline/display.c bash-4.1.N/bash/lib/readline/display.c --- bash-4.1/bash/lib/readline/display.c 2009-09-26 11:37:33.000000000 -0700 +++ bash-4.1.N/bash/lib/readline/display.c 2010-06-14 22:54:30.000000000 -0700 @@ -65,6 +65,8 @@ static void insert_some_chars PARAMS((char *, int, int)); static void cr PARAMS((void)); +int _rl_extproc; + /* State of visible and invisible lines. */ struct line_state { @@ -728,6 +730,8 @@ It maintains an array of line breaks for display (inv_lbreaks). This handles expanding tabs for display and displaying meta characters. */ lb_linenum = 0; + if (_rl_extproc) goto do_ext; + #if defined (HANDLE_MULTIBYTE) in = 0; if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) @@ -902,6 +906,7 @@ #endif } +do_ext: line[out] = '\0'; if (cpos_buffer_position < 0) { diff -wur bash-4.1/bash/lib/readline/rlprivate.h bash-4.1.N/bash/lib/readline/rlprivate.h --- bash-4.1/bash/lib/readline/rlprivate.h 2009-08-31 05:46:04.000000000 -0700 +++ bash-4.1.N/bash/lib/readline/rlprivate.h 2010-06-14 22:20:03.000000000 -0700 @@ -396,6 +396,7 @@ extern int _rl_last_c_pos; extern int _rl_suppress_redisplay; extern int _rl_want_redisplay; +extern int _rl_extproc; /* isearch.c */ extern char *_rl_isearch_terminators; diff -wur bash-4.1/bash/lib/readline/rltty.c bash-4.1.N/bash/lib/readline/rltty.c --- bash-4.1/bash/lib/readline/rltty.c 2009-11-19 06:42:02.000000000 -0800 +++ bash-4.1.N/bash/lib/readline/rltty.c 2010-06-14 22:18:32.000000000 -0700 @@ -521,6 +521,12 @@ _rl_echoctl = (oldtio.c_lflag & ECHOCTL); #endif + if (oldtio.c_lflag & EXTPROC) { + tiop->c_cc[VEOL] = 9; /* TAB */ + _rl_extproc = 1; + return; + } + tiop->c_lflag &= ~(ICANON | ECHO); if ((unsigned char) oldtio.c_cc[VEOF] != (unsigned char) _POSIX_VDISABLE) diff -wur bash-4.1/bash/lib/readline/text.c bash-4.1.N/bash/lib/readline/text.c --- bash-4.1/bash/lib/readline/text.c 2009-09-07 10:40:57.000000000 -0700 +++ bash-4.1.N/bash/lib/readline/text.c 2010-06-14 23:22:02.000000000 -0700 @@ -971,7 +971,7 @@ if (rl_erase_empty_line && rl_point == 0 && rl_end == 0) return 0; - if (_rl_echoing_p) + if (_rl_echoing_p && !_rl_extproc) _rl_update_final (); return 0; }