clear.c 588 B

12345678910111213141516171819
  1. /* vim: tabstop=4 shiftwidth=4 noexpandtab
  2. * This file is part of ToaruOS and is released under the terms
  3. * of the NCSA / University of Illinois License - see LICENSE.md
  4. * Copyright (C) 2013 K. Lange
  5. *
  6. * clear - Clear the terminal
  7. *
  8. * Sends an escape code to clear the screen. Ideally, this should
  9. * come from a database of terminal escape codes (eg. terminfo),
  10. * but we don't have one of those yet, so just send a code that
  11. * makes sense for a lot of terminals.
  12. */
  13. #include <stdio.h>
  14. int main(int argc, char ** argv) {
  15. printf("\033[H\033[2J");
  16. fflush(stdout);
  17. return 0;
  18. }