TERM set to xterm by default (which broke a lot of stuff), better escape handling...