I am currently experimenting with arrays in irb.
If my array has 22 elements, it will display properly as shown below: (Screenshot)
#Ruby Version 3.4.7
x = 1..22
#=> 1..22
x.to_a
#=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
# 22]
However, if my array has more than 22 elements, irb will render the array elements line by line:(Screenshot)
#Ruby Version 3.4.7
x = 1..23
#=> 1..23
x.to_a
#=>
# [1,
# 2,
# 3,
# 4,
# 5,
# 6,
# 7,
# 8,
# 9,
# 10,
# 11,
# 12,
# 13,
# 14,
# 15,
# 16,
# 17,
# 18,
# 19,
# 20,
# 21,
# 22,
# 23]
May I know what is going on?
I tried use control c but my terminal will hang and I have to restart the terminal.
lib/irb/color_printer.rb. You could switch to simple prompt viairb --simple-prompt.