[WIP] Fix shell initialization race condition with MOTD#3337
Open
unxed wants to merge 1 commit into
Open
Conversation
Terminal startup was previously relying on a fixed sleep duration, which frequently led to typeahead being swallowed by initialization scripts and TUI programs like glow that consume input while probing terminal features. The updated logic now employs a non-blocking read loop that waits until the output stream remains silent for 300ms, ensuring that the shell and all MOTD content are fully initialized before the command is sent. Touch elfmz#3171
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.
Improve VT shell startup by draining initial output before command injection. Previously, a fixed 300ms delay often proved insufficient if MOTD tools like glow were executed in .bashrc, leading to command buffer flushing or premature input loss. This change replaces the static sleep with an active wait loop that monitors terminal output and process group status, ensuring the shell is fully initialized and idle before sending commands.
Touch #3171