-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Closed
Labels
bugSomething isn't working correctlySomething isn't working correctlyclirelated to cli/ dirrelated to cli/ dirwindowsRelated to Windows platformRelated to Windows platform
Description
It is currently impossible to know when the user presses a special key in Console Window Host (the default terminal, conhost.exe) or Windows Terminal.
Here's a test script (needs --unstable because of Deno.setRaw()):
const stdinRid = Deno.stdin.rid;
if (Deno.isatty(stdinRid))
Deno.setRaw(stdinRid, true);
(async () => {
for await (const data of Deno.iter(Deno.stdin)) {
if (data[0] === 0x03) // Ctrl+C
Deno.exit();
console.log(data);
}
})();This could log an escape sequence when the user presses, for example, the arrow keys (I think it does on Linux), but it logs nothing.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't working correctlySomething isn't working correctlyclirelated to cli/ dirrelated to cli/ dirwindowsRelated to Windows platformRelated to Windows platform