QUESTION :
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?
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.