From: "zw963 (Wei Zheng)" Date: 2022-10-06T05:27:40+00:00 Subject: [ruby-core:110193] [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). mame (Yusuke Endoh) wrote in #note-2: > Please write your ticket as self-contained and concise as possible. Done edit, please check. ---------------------------------------- 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-99469 * 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. we can fix it 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 a screenshot, check [here](https://github.com/oggy/looksee/issues/57#issuecomment-999771143) I thought this issue be fixed should possible, 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, code is colorful, and looksee output is colorful too. But, above source code was moved for current newest master, I am not sure if this was fixed in ruby 3.2.0, 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: