I want to restore the pos of cursor in terminal when I reopen the terminal:
- If the mode was terminal mode before, it is easy to feed a 'a' to terminal to change from normal mode to terminal mode.
- If the mode was normal mode before, record the pos of cursor and recover it after reopening the terminal
Now I get stuck in obtaining the mode when I press
<c-\><c-n> and then to call restore or other functions. Cause after pressing
<c-\><c-n>, the mode (output of
mode()) will always be normal.
Is there some feasible methods?