src: add --no-restore-terminal-state - #66540
Open
fatihguzeldev wants to merge 1 commit into
Open
fatihguzeldev wants to merge 1 commit into
fatihguzeldev wants to merge 1 commit into
Conversation
Restoring startup terminal settings on exit can overwrite changes made by another process sharing the terminal, such as an interactive pager. Add a POSIX opt-out that preserves libuv's terminal mode cleanup and restoration of the O_NONBLOCK flag. Refs: nodejs#66440 Signed-off-by: Fatih Güzel <fatihguzeldev@gmail.com>
Collaborator
|
Review requested:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #66540 +/- ##
==========================================
- Coverage 90.40% 90.39% -0.01%
==========================================
Files 791 791
Lines 276011 276017 +6
Branches 52983 52977 -6
==========================================
- Hits 249529 249519 -10
- Misses 16891 16902 +11
- Partials 9591 9596 +5
🚀 New features to boost your workflow:
|
|
Thanks for the suggested fix. While it can help if one knows to manually use this flag and override the default behavior, is there a good reason to perform this reset by default even if no tty fd was used at all from-start-to-finish of this node instance? After all, when node exits, it already knows (or technically can know) whether something was read-from and/or written-to a tty fd, and surely this reset is never required if such tty fd was not touched at all? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restoring startup terminal settings on exit can overwrite changes made
by another process sharing the terminal, such as an interactive pager.
Add --no-restore-terminal-state as a POSIX opt-out while preserving
libuv's terminal mode cleanup and restoration of O_NONBLOCK.
The default behavior is unchanged.
Includes documentation and pseudo-TTY tests covering exit paths,
NODE_OPTIONS, option precedence, and raw-mode cleanup.
Refs: #66440
Refs: #66134
Tested on macOS arm64: release build, focused pseudo-TTY and CLI tests,
raw-mode cleanup, less 710 reproduction, and lint checks passed.