Mac OS X Lion, Rascal and nano

When using Terminal on OS X Lion to connect to the Rascal (e.g. ssh root@rascalNN.local), I noticed that nano was unreliable. For example when deleting a long line, the cursor sometimes jumps to the right leaving characters on the screen which do not match the nano buffer (which you can redisplay with Ctrl-L). This seems to be a common problem with Lion, not confined to Rascal, for example see this blog page. The problem seems to be that Lion has changed the default TERM setting from xterm-color to xterm256-color.

There are a number of ways to change your TERM setting but one of the simplest is to open Preferences from the Terminal menu, choose the Settings tab, click on the scheme you will be using (e.g. “Basic”) then click on the Advanced tab and change “Declare terminal as:” from xterm256-color to xterm-color. This setting gets carried over to Rascal when you use ssh and seems to make nano work as expected. If not, according to a nano FAQ, setting TERM to vt100 should always work!

First posted in the Rascal hardware and software forum.