mirror of
https://github.com/denoland/deno.git
synced 2024-12-15 11:58:42 -05:00
16 lines
388 B
TypeScript
16 lines
388 B
TypeScript
|
Deno.setRaw(0, true);
|
||
|
Deno.setRaw(0, true, { cbreak: true }); // Can be called multiple times
|
||
|
|
||
|
const signal = Deno.signals.interrupt();
|
||
|
|
||
|
Deno.stdout.writeSync(new TextEncoder().encode("S"));
|
||
|
|
||
|
await signal;
|
||
|
|
||
|
Deno.stdout.writeSync(new TextEncoder().encode("A"));
|
||
|
|
||
|
signal.dispose();
|
||
|
|
||
|
Deno.setRaw(0, false); // restores old mode.
|
||
|
Deno.setRaw(0, false); // Can be safely called multiple times
|