fix unintentional cursor movement after a new tab is opened