Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using iTerm2 to ssh to various servers. When i use VI to edit a file i get an error that reads 'Terminal Too Wide.' To fix this I use the following command 'stty columns 120.' Is there a setting that I can set in iTerm that will prevent me from having to enter this command?

share|improve this question
Use vim instead. – Daniel Beck Jan 25 '12 at 14:28
is that the only way? i was really looking for something in iterm specifically. – aamiri Jan 25 '12 at 19:46
You can always add the stty the the SSH system's shell profile so it's executed automatically. But vi simply cannot handle more columns, unless you patch and compile it. – Daniel Beck Jan 25 '12 at 20:10

Don't make the terminal window too wide (e.g. fullscreen). Both Terminal and iTerm make the terminal as wide as the window can handle by default to not waste screen space. Unfortunately, vi doesn't appear to handle more than a hardcoded number of columns (160, currently).

In the ex-vi source code, Release 050325, check out config.h line 94, and in ex_v.c, the vok function definition that produces this error.

Some Linux distributions apparently patch vi source code to get more columns for bigger screens.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .