Forum: Ruby-core [Ruby 1.9 - Bug #5023][Open] irb does not like window resizes

81cddd37b6db15f8c17312908e00320f?d=identicon&s=25 Michael Schnupp (Guest)
on 2011-07-13 08:29
(Received via mailing list)
Issue #5023 has been reported by Michael Schnupp.

----------------------------------------
Bug #5023: irb does not like window resizes
http://redmine.ruby-lang.org/issues/5023

Author: Michael Schnupp
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 1.9.3dev (2011-07-10 trunk 32499) [x86_64-linux]


- open irb
- type until line wraps to the next line
- increase the width of the terminal
- notice that the text of in the second line will not come up to the
first line.
-> there is no more useful display/navigation in long lines unless
window is resized to exactly the same width. :(

My irb uses libreadline. (Readline module is visible and config in
~/.inputrc is applied.)
Other readline applications like bash do not have that problem.
irb in 1.8 works fine, too.
all versions of 1.9 (including head) have the described problem.
(I tested mainly on my ubuntu box.)
9361878d459f1709feec780518946ee5?d=identicon&s=25 Yui NARUSE (Guest)
on 2011-07-25 13:09
(Received via mailing list)
Issue #5023 has been updated by Yui NARUSE.

Status changed from Open to Assigned
Assignee set to Keiju Ishitsuka
Target version set to 1.9.x


----------------------------------------
Bug #5023: irb does not like window resizes
http://redmine.ruby-lang.org/issues/5023

Author: Michael Schnupp
Status: Assigned
Priority: Normal
Assignee: Keiju Ishitsuka
Category:
Target version: 1.9.x
ruby -v: ruby 1.9.3dev (2011-07-10 trunk 32499) [x86_64-linux]


- open irb
- type until line wraps to the next line
- increase the width of the terminal
- notice that the text of in the second line will not come up to the
first line.
-> there is no more useful display/navigation in long lines unless
window is resized to exactly the same width. :(

My irb uses libreadline. (Readline module is visible and config in
~/.inputrc is applied.)
Other readline applications like bash do not have that problem.
irb in 1.8 works fine, too.
all versions of 1.9 (including head) have the described problem.
(I tested mainly on my ubuntu box.)
E15028f4cfbbdf1c2b42bd5abb326ecc?d=identicon&s=25 ralf.kistner@gmail.com (Ralf Kistner) (Guest)
on 2012-05-04 08:58
(Received via mailing list)
Issue #5023 has been updated by ralf.kistner@gmail.com (Ralf Kistner).


This is solved by using Readline.set_screen_size(lines, columns) to the
correct size, every time the size has changed.

The only reliable way I've found to get the terminal size is with the
'ruby-terminfo' gem: https://github.com/genki/ruby-terminfo

require 'terminfo'
Readline.set_screen_size(TermInfo.screen_size[0],
TermInfo.screen_size[1])

Calling the above two lines before each readline() solved the issue for
me.

Also see my answer on this stackoverflow post:
http://stackoverflow.com/a/10444128/214837

----------------------------------------
Bug #5023: irb does not like window resizes
https://bugs.ruby-lang.org/issues/5023#change-26441

Author: michas (Michael Schnupp)
Status: Assigned
Priority: Normal
Assignee: keiju (Keiju Ishitsuka)
Category:
Target version: 2.0.0
ruby -v: ruby 1.9.3dev (2011-07-10 trunk 32499) [x86_64-linux]


- open irb
- type until line wraps to the next line
- increase the width of the terminal
- notice that the text of in the second line will not come up to the
first line.
-> there is no more useful display/navigation in long lines unless
window is resized to exactly the same width. :(

My irb uses libreadline. (Readline module is visible and config in
~/.inputrc is applied.)
Other readline applications like bash do not have that problem.
irb in 1.8 works fine, too.
all versions of 1.9 (including head) have the described problem.
(I tested mainly on my ubuntu box.)
7fe945668a4fc098e886e20dea71d2ee?d=identicon&s=25 zzak (Zachary Scott) (Guest)
on 2013-01-20 05:54
(Received via mailing list)
Issue #5023 has been updated by zzak (Zachary Scott).


Using 1.9.3-p372 I was able to reproduce this issue, but unable to
reproduce in 2.0.0-dev.
----------------------------------------
Bug #5023: irb does not like window resizes
https://bugs.ruby-lang.org/issues/5023#change-35492

Author: michas (Michael Schnupp)
Status: Assigned
Priority: Normal
Assignee: keiju (Keiju Ishitsuka)
Category:
Target version: 2.0.0
ruby -v: ruby 1.9.3dev (2011-07-10 trunk 32499) [x86_64-linux]


- open irb
- type until line wraps to the next line
- increase the width of the terminal
- notice that the text of in the second line will not come up to the
first line.
-> there is no more useful display/navigation in long lines unless
window is resized to exactly the same width. :(

My irb uses libreadline. (Readline module is visible and config in
~/.inputrc is applied.)
Other readline applications like bash do not have that problem.
irb in 1.8 works fine, too.
all versions of 1.9 (including head) have the described problem.
(I tested mainly on my ubuntu box.)
7fe945668a4fc098e886e20dea71d2ee?d=identicon&s=25 zzak (Zachary Scott) (Guest)
on 2013-01-20 05:56
(Received via mailing list)
Issue #5023 has been updated by zzak (Zachary Scott).


I think we just need to backport to 1.9.3 branch, but I'm not sure what
to backport.
----------------------------------------
Bug #5023: irb does not like window resizes
https://bugs.ruby-lang.org/issues/5023#change-35493

Author: michas (Michael Schnupp)
Status: Assigned
Priority: Normal
Assignee: keiju (Keiju Ishitsuka)
Category:
Target version: 2.0.0
ruby -v: ruby 1.9.3dev (2011-07-10 trunk 32499) [x86_64-linux]


- open irb
- type until line wraps to the next line
- increase the width of the terminal
- notice that the text of in the second line will not come up to the
first line.
-> there is no more useful display/navigation in long lines unless
window is resized to exactly the same width. :(

My irb uses libreadline. (Readline module is visible and config in
~/.inputrc is applied.)
Other readline applications like bash do not have that problem.
irb in 1.8 works fine, too.
all versions of 1.9 (including head) have the described problem.
(I tested mainly on my ubuntu box.)
97f338629741aa42d6717bfba0c2830f?d=identicon&s=25 keiju (Keiju Ishitsuka) (Guest)
on 2013-01-23 15:14
(Received via mailing list)
Issue #5023 has been updated by keiju (Keiju Ishitsuka).


zzak (Zachary Scott) wrote:
> I think we just need to backport to 1.9.3 branch, but I'm not sure what to
backport.

I have identified a commit which solve this problem.
The commit is revision 36130.

I think the following is applied only:

--- ext/readline/readline.c  (revision 38896)
+++ ext/readline/readline.c  (working copy)
@@ -1679,9 +1679,7 @@
 #ifdef HAVE_RL_CATCH_SIGNALS
     rl_catch_signals = 0;
 #endif
-#ifdef HAVE_RL_CATCH_SIGWINCH
-    rl_catch_sigwinch = 0;
-#endif
+
 #ifdef HAVE_RL_CLEAR_SIGNALS
     rl_clear_signals();
 #endif

----------------------------------------
Bug #5023: irb does not like window resizes
https://bugs.ruby-lang.org/issues/5023#change-35553

Author: michas (Michael Schnupp)
Status: Assigned
Priority: Normal
Assignee: keiju (Keiju Ishitsuka)
Category:
Target version: 2.0.0
ruby -v: ruby 1.9.3dev (2011-07-10 trunk 32499) [x86_64-linux]


- open irb
- type until line wraps to the next line
- increase the width of the terminal
- notice that the text of in the second line will not come up to the
first line.
-> there is no more useful display/navigation in long lines unless
window is resized to exactly the same width. :(

My irb uses libreadline. (Readline module is visible and config in
~/.inputrc is applied.)
Other readline applications like bash do not have that problem.
irb in 1.8 works fine, too.
all versions of 1.9 (including head) have the described problem.
(I tested mainly on my ubuntu box.)
7fe945668a4fc098e886e20dea71d2ee?d=identicon&s=25 zzak (Zachary Scott) (Guest)
on 2013-01-23 15:43
(Received via mailing list)
Issue #5023 has been updated by zzak (Zachary Scott).


Thank you Keiju-san!

Will you please open a backport request for usa?
----------------------------------------
Bug #5023: irb does not like window resizes
https://bugs.ruby-lang.org/issues/5023#change-35556

Author: michas (Michael Schnupp)
Status: Assigned
Priority: Normal
Assignee: keiju (Keiju Ishitsuka)
Category:
Target version: 2.0.0
ruby -v: ruby 1.9.3dev (2011-07-10 trunk 32499) [x86_64-linux]


- open irb
- type until line wraps to the next line
- increase the width of the terminal
- notice that the text of in the second line will not come up to the
first line.
-> there is no more useful display/navigation in long lines unless
window is resized to exactly the same width. :(

My irb uses libreadline. (Readline module is visible and config in
~/.inputrc is applied.)
Other readline applications like bash do not have that problem.
irb in 1.8 works fine, too.
all versions of 1.9 (including head) have the described problem.
(I tested mainly on my ubuntu box.)
97f338629741aa42d6717bfba0c2830f?d=identicon&s=25 keiju (Keiju Ishitsuka) (Guest)
on 2013-01-23 16:24
(Received via mailing list)
Issue #5023 has been updated by keiju (Keiju Ishitsuka).

Assignee changed from keiju (Keiju Ishitsuka) to usa (Usaku NAKAMURA)
Target version changed from 2.0.0 to 1.9.3

zzak (Zachary Scott) wrote:
> Thank you Keiju-san!
>
> Will you please open a backport request for usa?

OK.

Usa-san, yoroshiku.
----------------------------------------
Bug #5023: irb does not like window resizes
https://bugs.ruby-lang.org/issues/5023#change-35559

Author: michas (Michael Schnupp)
Status: Assigned
Priority: Normal
Assignee: usa (Usaku NAKAMURA)
Category:
Target version: 1.9.3
ruby -v: ruby 1.9.3dev (2011-07-10 trunk 32499) [x86_64-linux]


- open irb
- type until line wraps to the next line
- increase the width of the terminal
- notice that the text of in the second line will not come up to the
first line.
-> there is no more useful display/navigation in long lines unless
window is resized to exactly the same width. :(

My irb uses libreadline. (Readline module is visible and config in
~/.inputrc is applied.)
Other readline applications like bash do not have that problem.
irb in 1.8 works fine, too.
all versions of 1.9 (including head) have the described problem.
(I tested mainly on my ubuntu box.)
This topic is locked and can not be replied to.