From: "zw963 (Wei Zheng)" Date: 2022-11-08T06:56:00+00:00 Subject: [ruby-core:110654] [Ruby master Bug#19037] [Ruby 3.1.2] irb display color character not correct(as literal form) when set IRB.conf[:USE_COLORIZE] = true (it is default) Issue #19037 has been updated by zw963 (Wei Zheng). zw963 (Wei Zheng) wrote in #note-6: > zw963 (Wei Zheng) wrote in #note-4: > > mame (Yusuke Endoh) wrote in #note-2: > > > Please write your ticket as self-contained and concise as possible. > > > > Done edit, please check. > > Any update? Hi, this issue get workaround by looksee gem, so, it works now. Thanks. ---------------------------------------- Bug #19037: [Ruby 3.1.2] irb display color character not correct(as literal form) when set IRB.conf[:USE_COLORIZE] = true (it is default) https://bugs.ruby-lang.org/issues/19037#change-99994 * Author: zw963 (Wei Zheng) * Status: Feedback * Priority: Normal * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- When work with ruby 3.1.X, [looksee](https://github.com/oggy/looksee) gem could not display color character correct in new version IRB, as you can see as following: ``` ^[[1;37m[Roda::RodaPlugins::Sprockets::Task instance]^[[0m ^[[1;32mbindings^[[0m ^[[1;32mirb_cwb^[[0m ^[[1;32mkill^[[0m ^[[1;32mcb^[[0m ^[[1;32mirb_cws^[[0m ^[[1;32mls^[[0m ^[[1;32mchws^[[0m ^[[1;32mirb_cwws^[[0m ^[[1;32mmeasure^[[0m ^[[1;32mconf^[[0m ^[[1;32mirb_pop_binding^[[0m ^[[1;32mpopb^[[0m ^[[1;32mcontext^[[0m ^[[1;32mirb_popb^[[0m ^[[1;32mpopws^[[0m ^[[1;32mcws^[[0m ^[[1;32mirb_popws^[[0m ^[[1;32mpushb^[[0m ^[[1;32mcwws^[[0m ^[[1;32mirb_print_working_binding^[[0m ^[[1;32mpushws^[[0m ^[[1;32mexit^[[0m ^[[1;32mirb_print_working_workspace^[[0m ^[[1;32mpwws^[[0m ^[[1;32mfg^[[0m ^[[1;32mirb_push_binding^[[0m ^[[1;32mquit^[[0m ^[[1;32mhelp^[[0m ^[[1;32mirb_pushb^[[0m ^[[1;32mshow_source^[[0m ^[[1;32mirb_bindings^[[0m ^[[1;32mirb_pushws^[[0m ^[[1;32msource^[[0m ^[[1;32mirb_cb^[[0m ^[[1;32mirb_pwb^[[0m ^[[1;32mwhereami^[[0m ^[[1;32mirb_change_binding^[[0m ^[[1;32mirb_pwws^[[0m ^[[1;32mworkspaces^[[0m ^[[1;32mirb_chws^[[0m ^[[1;32mirb_quit^[[0m ^[[1;32mirb_current_working_binding^[[0m ^[[1;32mjobs^[[0m ``` reproduce process [here](https://github.com/oggy/looksee/issues/57#issuecomment-989731946) But, it works before introduce the colorful feature of IRB, and work still quite well with Pry. we can fix this issue use following workaround. ```rb IRB.conf[:USE_COLORIZE] = false ``` But, that will make IRB lose colorful. So, i thought somethings break changes introduced since new IRB released. following is a screenshot, check how looks [here](https://github.com/oggy/looksee/issues/57#issuecomment-999771143) I thought this issue should possible be fixed, so, i do some hack myself. if change https://github.com/ruby/ruby/blob/v3_1_2/lib/irb/context.rb#L56 line from `@use_colorize = IRB.conf[:USE_COLORIZE]` into `@use_colorize = false`, it works perfect, that is, irb is colorful, and looksee output is colorful too. But, above source code was moved on newest master, I am not sure if this issue was fixed in ruby 3.2.0 too. because install ruby-head or 3.2.0-preview both failed on my laptop use RVM. so just ask here. thank you. -- https://bugs.ruby-lang.org/ Unsubscribe: