[ruby-core:102151] [Ruby master Bug#17557] IRB array returned in multiple lines
From:
takashikkbn@...
Date:
2021-01-19 06:18:29 UTC
List:
ruby-core #102151
Issue #17557 has been updated by k0kubun (Takashi Kokubun).
Status changed from Open to Closed
We changed the default IRB inspector from inspect-based one to pretty_inspect-based one, which prints a content in multiple lines when it exceeds 79 chars, for Ruby 3.1+ IRB.
Given that, we have two choices:
1. Use `IRB.conf[:INSPECT_MODE] = :inspect` in your ~/.irbrc. This makes the behavior compatible with Ruby 3.0 IRB, which, however, cannot syntax-highlight an inspect output of objects like Struct.
2. Dynamically change the threshold 79 using Reline's API in the new pp-based inspector. It would still print an array in a single line as long as it's not too large.
2 would be a valid feature request, but because my comment already addresses the ticket's concern, I'm closing this ticket.
----------------------------------------
Bug #17557: IRB array returned in multiple lines
https://bugs.ruby-lang.org/issues/17557#change-90003
* Author: sergioro (Sergio Romero)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
Hi Rubysts. In previous versions of IRB an array was displayed in a single line like:
's'.methods
=> [:unicode_normalize, :unicode_normalize!, :ascii_only?, :to_r, :unpack, ..., :!=, :equal?, :__id__, :instance_eval, :instance_exec]
But in version 1.3.1 (2021-01-12) the array is returned in multiple lines:
's'.methods
=>
[:unicode_normalize,
:unicode_normalize!,
:ascii_only?,
:to_r,
:unpack,
...,
:!=,
:equal?,
:__id__,
:instance_eval,
:instance_exec]
Is there a way to toggle this behavior, perhaps IRB.conf?
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>