fixed issue with terminal take over ruining cursor position

when an application takes over the terminal (such as less or vim), the cursor position syncing was raising an error and then the cursor would be in the wrong position for the rest of the time the user uses the program. this change gives the desired behavior