Fucking terminals, always broken in one way or another. For future reference, libedit acts even worse than readline.