Skip to content

Commit ed163a5

Browse files
author
Ben Wilber
committed
getty: also clear console scrollback
If clearing the screen, also try to clear the vt/syscons history.
1 parent bdaa120 commit ed163a5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libexec/getty/main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <sys/stat.h>
3737
#include <sys/ttydefaults.h>
3838
#include <sys/utsname.h>
39+
#include <sys/consio.h>
3940

4041
#include <ctype.h>
4142
#include <errno.h>
@@ -293,8 +294,10 @@ main(int argc, char *argv[])
293294
dogettytab();
294295
continue;
295296
}
296-
if (CL && *CL)
297+
if (CL && *CL) {
298+
(void)ioctl(STDIN_FILENO, CONS_CLRHIST);
297299
putpad(CL);
300+
}
298301
edithost(HE);
299302

300303
/* if this is the first time through this, and an

0 commit comments

Comments
 (0)