Use smcup and rmcup to save/restore screen buffer
- Lenguaje dominante
- C
- Estrellas
- 9.1k
- Forks
- 997
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Vim and others appear to do this. It also has the added benefit of fixing `Page Up` and `Page Down` on MacOS using Terminal.app.
```c
void initEditor() {
write(STDOUT_FILENO, "\033[?47h", 6); // New (smcup)
EditorConfig.cursor.x = 0;
EditorConfig.cursor.y = 0;
if (getWindowSize(&EditorConfig.screenRows, &EditorConfig.screenCols) == -1) die("getWindowSize");
terminalClearScreen();
}
// ...
void disableRawMode() {
write(STDOUT_FILENO, "\033[?47l", 6); // New (rmcup)
tcsetattr(STDIN_FILENO, TCSAFLUSH, &EditorConfig.orig_termios);
}
```
More info [here](http://austinhanson.com/page-up-page-down-with-kilo-editor).
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.