Hopefully adding compatibility for xterm