Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 155df9c

Browse filesBrowse files
sam-githubbnoordhuis
authored andcommitted
doc: document node signal handling
Partly lifted from uv.h, partly from observation of node.cc.
1 parent 9f7f9d1 commit 155df9c
Copy full SHA for 155df9c

File tree

Expand file treeCollapse file tree

1 file changed

+27
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+27
-2
lines changed
Open diff view settings
Collapse file

‎doc/api/process.markdown‎

Copy file name to clipboardExpand all lines: doc/api/process.markdown
+27-2Lines changed: 27 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,33 @@ Example of listening for `SIGINT`:
7777
An easy way to send the `SIGINT` signal is with `Control-C` in most terminal
7878
programs.
7979

80-
Note: SIGUSR1 is reserved by node.js to kickstart the debugger. It's possible
81-
to install a listener but that won't stop the debugger from starting.
80+
Note:
81+
82+
- `SIGUSR1` is reserved by node.js to start the debugger. It's possible to
83+
install a listener but that won't stop the debugger from starting.
84+
- `SIGTERM` and `SIGINT` have default handlers on non-Windows platforms that resets
85+
the terminal mode before exiting with code `128 + signal number`. If one of
86+
these signals has a listener installed, its default behaviour will be removed
87+
(node will no longer exit).
88+
- `SIGPIPE` is ignored by default, it can have a listener installed.
89+
- `SIGHUP` is generated on Windows when the console window is closed, and on other
90+
platforms under various similar conditions, see signal(7). It can have a
91+
listener installed, however node will be unconditionally terminated by Windows
92+
about 10 seconds later. On non-Windows platforms, the default behaviour of
93+
`SIGHUP` is to terminate node, but once a listener has been installed its
94+
default behaviour will be removed.
95+
- `SIGTERM` is not supported on Windows, it can be listened on.
96+
- `SIGINT` is supported on all platforms, and can usually be generated with
97+
`CTRL+C` (though this may be configurable). It is not generated when terminal
98+
raw mode is enabled.
99+
- `SIGBREAK` is delivered on Windows when `CTRL+BREAK` is pressed, on non-Windows
100+
platforms it can be listened on, but there is no way to send or generate it.
101+
- `SIGWINCH` is delivered when the console has been resized. On Windows, this will
102+
only happen on write to the console when the cursor is being moved, or when a
103+
readable tty is used in raw mode.
104+
- `SIGKILL` cannot have a listener installed, it will unconditionally terminate
105+
node on all platforms.
106+
- `SIGSTOP` cannot have a listener installed.
82107

83108
## process.stdout
84109

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.