Fixed the bug of cursor not return to the position it was before opened the dedicated terminal window.