projects
/
visor
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
don't crash with no buffers, and clear the screen on exit
[visor]
/
visor
/
src
/
term.c
diff --git
a/visor/src/term.c
b/visor/src/term.c
index
af7d278
..
4746836
100644
(file)
--- a/
visor/src/term.c
+++ b/
visor/src/term.c
@@
-56,11
+56,20
@@
int term_init(const char *ttypath)
void term_cleanup(void)
{
void term_cleanup(void)
{
+ term_clear();
+ term_setcursor(0, 0);
+ term_flush();
tcsetattr(ttyfd, TCSAFLUSH, &saved_term);
close(ttyfd);
ttyfd = -1;
}
tcsetattr(ttyfd, TCSAFLUSH, &saved_term);
close(ttyfd);
ttyfd = -1;
}
+void term_reset(void)
+{
+ term_puts("\033c");
+ term_flush();
+}
+
void term_getsize(int *width, int *height)
{
*width = term_width;
void term_getsize(int *width, int *height)
{
*width = term_width;