Skip to content

Commit 9763e60

Browse files
committed
Document Ctrl+C behavior for discardStdin
Fixes #156
1 parent 5408a1e commit 9763e60

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎index.d.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ export type Options = {
111111
112112
This has no effect on Windows as there's no good way to implement discarding stdin properly there.
113113
114+
Note: `discardStdin` puts stdin into raw mode. In raw mode, `Ctrl+C` no longer generates `SIGINT` from the terminal. Ora re-emits `Ctrl+C` from stdin input, but if your code blocks the event loop with synchronous work, `Ctrl+C` handling is delayed until the blocking work ends. Use async APIs, a worker thread, or a child process to keep `Ctrl+C` responsive, or set `discardStdin` to `false`.
115+
114116
@default true
115117
*/
116118
readonly discardStdin?: boolean;

‎readme.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ Discard stdin input (except Ctrl+C) while running if it's TTY. This prevents the
138138

139139
This has no effect on Windows as there is no good way to implement discarding stdin properly there.
140140

141+
Note: `discardStdin` puts stdin into raw mode. In raw mode, `Ctrl+C` no longer generates `SIGINT` from the terminal. Ora re-emits `Ctrl+C` from stdin input, but if your code blocks the event loop with synchronous work, `Ctrl+C` handling is delayed until the blocking work ends. Use async APIs, a worker thread, or a child process to keep `Ctrl+C` responsive, or set `discardStdin` to `false`.
142+
141143
### Instance
142144

143145
#### .text <sup>get/set</sup>

0 commit comments

Comments
 (0)