os,term.termios: add termios.set_state/2, state.disable_echo/0, use them in os.input_password, to fix v -os wasm32_emscripten examples/2048/

This commit is contained in:
Delyan Angelov 2023-07-31 10:28:45 +03:00
parent 37e7d5f5ae
commit 32114a679a
No known key found for this signature in database
GPG key ID: 66886C0F12D595ED
13 changed files with 161 additions and 40 deletions

View file

@ -47,3 +47,13 @@ pub fn tcsetattr(fd int, optional_actions int, mut termios_p Termios) int {
pub fn ioctl(fd int, request u64, arg voidptr) int {
return -1
}
// set_state applies the flags in the `new_state` to the descriptor `fd`.
pub fn set_state(fd int, new_state Termios) int {
return -1
}
// disable_echo disables echoing characters as they are typed,
// when that Termios state is later set with termios.set_state(fd,t)
pub fn (mut t Termios) disable_echo() {
}