term: add clear
parent
3cfeb92a4e
commit
72b09d4794
|
@ -871,14 +871,6 @@ pub fn write_file(path, text string) {
|
|||
f.close()
|
||||
}
|
||||
|
||||
// clear clears current terminal screen.
|
||||
pub fn clear() {
|
||||
$if !windows {
|
||||
C.printf('\x1b[2J')
|
||||
C.printf('\x1b[H')
|
||||
}
|
||||
}
|
||||
|
||||
pub fn on_segfault(f voidptr) {
|
||||
$if windows {
|
||||
return
|
||||
|
|
|
@ -75,3 +75,11 @@ fn supports_escape_sequences(fd int) bool {
|
|||
return is_atty(fd) > 0 && os.getenv('TERM') != 'dumb'
|
||||
}
|
||||
}
|
||||
|
||||
// clear clears current terminal screen.
|
||||
pub fn clear() {
|
||||
$if !windows {
|
||||
C.printf('\x1b[2J')
|
||||
C.printf('\x1b[H')
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue