src: remove overzealous tcsetattr error check by bnoordhuis · Pull Request #58200 · nodejs/node

@bnoordhuis

Node calls tcsetattr on exit to reset the tty to its state on program
start. Good idea in general but tcsetattr can fail for a number of
reasons and since there really isn't anything we can do about it
at that point, simply ignore the error instead of aborting with
an inscrutable error message.

Most of the time it'll be fine because the most common failure is when
the user has already logged off and there isn't anything to restore in
the first place.

Fixes: nodejs#51519

@nodejs-github-bot added c++

Issues and PRs that require attention from people who are familiar with C++.

needs-ci

PRs that need a full CI run.

labels

May 6, 2025

juanarbol

BridgeAR

@daeyeon daeyeon added author ready

PRs that have at least one approval, no pending requests for changes, and a CI started.

request-ci

Add this label to start a Jenkins CI on a PR.

labels

May 6, 2025

addaleax

Ethan-Arrowood

targos pushed a commit that referenced this pull request

May 16, 2025
Node calls tcsetattr on exit to reset the tty to its state on program
start. Good idea in general but tcsetattr can fail for a number of
reasons and since there really isn't anything we can do about it
at that point, simply ignore the error instead of aborting with
an inscrutable error message.

Most of the time it'll be fine because the most common failure is when
the user has already logged off and there isn't anything to restore in
the first place.

Fixes: #51519
PR-URL: #58200
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>

aduh95 pushed a commit that referenced this pull request

Jun 10, 2025
Node calls tcsetattr on exit to reset the tty to its state on program
start. Good idea in general but tcsetattr can fail for a number of
reasons and since there really isn't anything we can do about it
at that point, simply ignore the error instead of aborting with
an inscrutable error message.

Most of the time it'll be fine because the most common failure is when
the user has already logged off and there isn't anything to restore in
the first place.

Fixes: #51519
PR-URL: #58200
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>