Open
Conversation
For example, put the following code in ~/.irbrc: ```ruby Reline::Face.config(:syntax_highlighting) do |conf| conf.define :pseudo_variable, foreground: "#4dacfd", style: :bold conf.define :global_variable, foreground: "#4dacfd", style: :bold conf.define :constant, foreground: "#ffa657", style: :bold conf.define :comment, foreground: "#abaeb1", style: :bold conf.define :string_edge, foreground: "#c1daec", style: :bold conf.define :string_body, foreground: "#c1daec" conf.define :symbol, foreground: "#c1daec" conf.define :number, foreground: "#4dacfd", style: :bold conf.define :float, foreground: "#4dacfd", style: :bold conf.define :keyword, foreground: "#f16636" conf.define :label, foreground: "#4dacfd" conf.define :method_name, foreground: "#a887e6", style: :bold conf.define :message_name, foreground: "#a887e6" conf.define :error, foreground: "#f16636", style: :negative end ```
shugo
commented
Apr 9, 2026
Comment on lines
+340
to
+347
| # Normalize SGR sequences for existing test cases | ||
| def normalize_sgr(seq) | ||
| s = seq.sub(/\A\e\[0m/, "") | ||
| return s if s.match?(/\e\[(38|48|58);/) # Do not normalize extended colors | ||
| s.gsub(/\e\[([0-9;]+)m/) { | ||
| $1.split(/;/).map { |i| "\e[#{i}m" }.join | ||
| } | ||
| end |
Member
Author
There was a problem hiding this comment.
Instead, it may be better to fix test cases.
st0012
reviewed
Apr 9, 2026
| conf.define :error, foreground: :red, style: :negative | ||
| end | ||
|
|
||
| IRB::Color.init |
Member
There was a problem hiding this comment.
Why do we call this here too? Are we initializing twice?
Member
Author
There was a problem hiding this comment.
It's called here just in case irb/color is required from applications other than irb.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For example, put the following code in ~/.irbrc: