NS equivalents of xterm.c and w32term.c changes