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

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

This reverts commit 0376cbf6bd.
This commit is contained in:
Delyan Angelov
2021-09-06 19:04:14 +03:00
parent 0376cbf6bd
commit 166dd61e90
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)
}
}