Project

General

Profile

Actions

Bug #5423

closed

readlineの入力待機中に端末のウィンドウサイズ変更すると入力内容が乱れる

Added by matsuu (Takuto Matsuu) about 13 years ago. Updated over 12 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
Backport:
[ruby-dev:44586]

Description

Readline.readline("> ")の入力待機中にターミナルのウィンドウサイズを変更すると、
入力内容がウィンドウサイズ変更に合わせて変化せず、画面が乱れます。

readlineがSIGWINCHに反応しないように設定されているのが原因のようです。

revision 24140で追加されたrl_catch_sigwinch = 0;が該当部分になります。
rl_catch_signals=0を設定した場合でも、SIGWINCHは反応すべき(rl_catch_sigwinch=1)だと思います。

Index: ChangeLog

--- ChangeLog (revision 24139)
+++ ChangeLog (revision 24140)
@@ -1,3 +1,11 @@
+Thu Jul 16 12:42:10 2009 NARUSE, Yui
+

    • ext/readline/readline.c (readline_readline): rl_free_line_state
  • before rl_cleanup_after_signal.
    
    • ext/readline/readline.c (Init_readline): set rl_catch_signals and
  • rl_catch_signwinch as 0. [ruby-core:21884]
    

Thu Jul 16 08:59:22 2009 Koichi Sasada

* node.h, vm_core.h, variable.c: rename global_entry to rb_global_entry.

Index: ext/readline/readline.c

--- ext/readline/readline.c (revision 24139)
+++ ext/readline/readline.c (revision 24140)
@@ -253,6 +253,7 @@
if (status) {
#if defined HAVE_RL_CLEANUP_AFTER_SIGNAL
/* restore terminal mode and signal handler*/

  •    rl_free_line_state();
       rl_cleanup_after_signal();
    

#elif defined HAVE_RL_DEPREP_TERM_FUNCTION
/* restore terminal mode */
@@ -1450,6 +1451,8 @@
#elif defined HAVE_RL_EVENT_HOOK
rl_event_hook = readline_event;
#endif

  • rl_catch_signals = 0;
  • rl_catch_sigwinch = 0;
    #ifdef HAVE_RL_CLEAR_SIGNALS
    rl_clear_signals();
    #endif

Files

readline-sigwinch.patch (394 Bytes) readline-sigwinch.patch matsuu (Takuto Matsuu), 10/08/2011 10:19 AM

Related issues 2 (0 open2 closed)

Related to Backport193 - Backport #5023: irb does not like window resizesClosedusa (Usaku NAKAMURA)07/13/2011Actions
Related to Ruby master - Bug #1118: irb core dumps with 'CTRL-C' with zshClosed02/06/2009Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0