mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
term: add clear
This commit is contained in:
@@ -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')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user