MCPcopy Create free account
hub / github.com/DFHack/dfhack / clear

Method clear

library/Console-posix.cpp:308–321  ·  view source on GitHub ↗

Clear the console, along with its scrollback

Source from the content-addressed store, hash-verified

306
307 /// Clear the console, along with its scrollback
308 void clear()
309 {
310 if(rawmode)
311 {
312 const char * clr = "\033c\033[3J\033[H";
313 if (::write(STDIN_FILENO,clr,strlen(clr)) == -1)
314 ;
315 }
316 else
317 {
318 print("\033c\033[3J\033[H");
319 fflush(dfout_C);
320 }
321 }
322 /// Position cursor at x,y. 1,1 = top left corner
323 void gotoxy(int x, int y)
324 {

Callers

nothing calls this directly

Calls 2

writeFunction · 0.50
printFunction · 0.50

Tested by

no test coverage detected