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?

link|improve this question

40% accept rate
Use vim instead. – Daniel Beck Jan 25 at 14:28
is that the only way? i was really looking for something in iterm specifically. – aamiri Jan 25 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 at 20:10
feedback

1 Answer

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.