1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

term: obtain the cursor position via termios.h (#11372)

This commit is contained in:
AAAA
2021-09-06 14:24:39 +00:00
committed by GitHub
parent 78c26e69cf
commit af28d09630
19 changed files with 190 additions and 123 deletions

View File

@@ -1008,3 +1008,15 @@ pub fn glob(patterns ...string) ?[]string {
matches.sort()
return matches
}
pub fn last_error() IError {
$if windows {
code := int(C.GetLastError())
msg := get_error_msg(code)
return error_with_code(msg, code)
} $else {
code := C.errno
msg := posix_get_error_msg(code)
return error_with_code(msg, code)
}
}