Restore cusor position after executing command