Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore terminal state when neatvi exits #76

Open
lobre opened this issue Dec 12, 2023 · 2 comments
Open

Restore terminal state when neatvi exits #76

lobre opened this issue Dec 12, 2023 · 2 comments

Comments

@lobre
Copy link
Contributor

lobre commented Dec 12, 2023

From what I have read from raw mode in the terminal, there is way to "restore" the terminal state when the application exits, so that the terminal goes back to where it was.

It means storing the original state in memory though.

See this link or the below snippet for more info.

struct termios orig_termios;

void disableRawMode() {
  tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios);
}

Is there a good reason why it is not implemented in neatvi? The outcome is that I continue to see some part of the editing session when I quit neatvi, instead of just being back to where I was before launching it.

@aligrudi
Copy link
Owner

aligrudi commented Dec 15, 2023 via email

@lobre
Copy link
Contributor Author

lobre commented Dec 20, 2023

Neatvi restores terminal state but not terminal contents.

Would it be using too much memory if it would restore terminal contents?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants