improve iterm cursor handling