(Edit 2024) For Ruby 3.3+:
Use Reline::Face
to configure the look. (Thanks to @xyz for the comment!)
For an older Ruby:
Some are hardcoded; but most of it is inside a constant, and thus editable (even though it's private). This should let you change all the pesky blues with cyans. The single downside is that keywords are indeed hardcoded to use CYAN
, but we can cheat and change the CYAN
constant itself to something else (e.g. BLUE
- readability for stuff like nil
and true
is not that important to me, but feel free to change to something else), and hope no other plugin relies on CYAN
actually being cyan :D
module IRB::Color
TOKEN_SEQ_EXPRS.each do |token, (seq, exprs)|
seq[0] = CYAN if seq[0] == BLUE
end
remove_const :CYAN
CYAN = BLUE
end
You can put it inside $HOME/.irbrc
to make it work across all future irb
sessions.
Needless to say, this is a hack, and should IRB::Color
change in the future, this may well stop working.
wirble
gem with works with Ruby 2.x (perhaps with Ruby 3 too) and allows you to configure the colours. – Dele