Finally, the problem of changing the size of the terminal narrowed. I usually maximize the terminal to enter large commands, hence the problem. It turned out that this can be solved by processing the SIGWINCH signal to resize the IRB. In the solution below, I also resize the Hirb.
Add the following lines to ~ / .irbrc (create one if it does not exist):
Signal.trap('SIGWINCH', proc { y, x = `stty size`.split.map(&:to_i); Hirb::View.resize(x, y) if defined? Hirb } )
source share