Using a Mac terminal to connect to a machine not supporting the xterm-color terminal type can result in tools like vi not working.
One can get the error: xterm-color: Unknown terminal type
The solution to this problem is to identify the terminal types supported on the remote machine.
In my case, it was vt100
Steps (on remote machine running Solaris):
> export TERM=vt100
> vi anyfile.txt