Line breaks when using rails console(Terminal)

console, ruby-on-rails, terminal

Solution

Finally narrowed the issue to be with resizing the terminal.Usually I maximize the terminal for typing large commands , hence the problem. Found out that this can be solved by handling the SIGWINCH signal to resize IRB.In the solution below i am also resizing Hirb.

Add the following lines to ~/.irbrc (create one if it doesn't exist) :

Signal.trap('SIGWINCH', proc { y, x = `stty size`.split.map(&:to_i); Hirb::View.resize(x, y) if defined? Hirb } )

Problem

When I type large ActiveRecord queries,Before finishing the query, the line is breaking and I can't even reading or typing the command properly.I am using ubuntu.Any solution?

Original source