diff options
| author | ruki <[email protected]> | 2021-12-19 00:16:02 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-12-19 00:16:02 +0800 |
| commit | 2ab866f4457c9074255d0104b32fce420bb8b13e (patch) | |
| tree | ccfef243ae29218ea696315f7959d51feee92676 | |
| parent | 06a82b1a794b0481a91db073754f188d54b0d87f (diff) | |
fix compile errors
| -rw-r--r-- | core/src/xmake/tty/term_mode.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/src/xmake/tty/term_mode.c b/core/src/xmake/tty/term_mode.c index e035236a5..975c8fc37 100644 --- a/core/src/xmake/tty/term_mode.c +++ b/core/src/xmake/tty/term_mode.c @@ -50,6 +50,7 @@ tb_int_t xm_tty_term_mode(lua_State* lua) // get std type, (stdin: 1, stdout: 2, stderr: 3) tb_int_t stdtype = (tb_int_t)luaL_checkinteger(lua, 1); + // get and set terminal mode DWORD mode = 0; HANDLE console_handle; switch (stdtype) @@ -59,7 +60,7 @@ tb_int_t xm_tty_term_mode(lua_State* lua) case 3: console_handle = GetStdHandle(STD_ERROR_HANDLE); break; } GetConsoleMode(console_handle, &mode); - if (lua_isinteger(lua, 2)) + if (lua_isnumber(lua, 2)) { tb_int_t newmode = (tb_int_t)lua_tointeger(lua, 2); SetConsoleMode(console_handle, (DWORD)newmode); |
