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:
@@ -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