Improved compatibility with xterm.