RSS Feed

bash less resize terminal overflow problem solved


I always have a problem with terminal emulator when using bash but not zsh. The problem can be produced like this,

  1. Open any terminal emulator (gnome-terminal, xfce4-terminal, etc)
  2. Run any command with less, such as “ls |less”
  3. Resize the window to larger size, such as maximize
  4. Quit less
  5. Type anything in the terminal, then the text will not wrap to new line if the text length beyond the window size before resie. And it will overflow to the same line and overwrite the prompt.

This problem can be solved by adding “shopt -s checkwinsize” in .bashrc.

About Allen Choong

A cognitive science student, a programmer, a philosopher, a Catholic.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: