Remove 'Press any key to exit' in basic-rs and basic-cpp templates#4468
Merged
clockwork-labs-bot merged 2 commits intomasterfrom Feb 26, 2026
Merged
Remove 'Press any key to exit' in basic-rs and basic-cpp templates#4468clockwork-labs-bot merged 2 commits intomasterfrom
clockwork-labs-bot merged 2 commits intomasterfrom
Conversation
bfops
previously approved these changes
Feb 26, 2026
Collaborator
bfops
left a comment
There was a problem hiding this comment.
Builds and runs properly for me 🤷
dismissing my review because I'm waiting for another approval and I don't want the bot merging this prematurely
jdetter
approved these changes
Feb 26, 2026
cloutiertyler
approved these changes
Feb 26, 2026
Contributor
cloutiertyler
left a comment
There was a problem hiding this comment.
Also seems fine, but why does this only apply to basic-rs and basic-cpp, presumably it should also apply to basic-cs and basic-ts right?
Instead of prompting for input and exiting, keep the main thread alive with a sleep loop so the connection stays open — matching the behavior of basic-cs and basic-ts which stay alive via their event loops.
1d9e88e to
b69c81d
Compare
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.
The basic-rs and basic-cpp templates say "Press any key to exit..." but stdin is line-buffered in cooked mode, so
read(&mut [0u8])actually blocks until Enter is pressed.Adding a real "any key" handler would require a terminal crate dependency (crossterm, termion, etc.) which is heavy for a starter template. Instead, change the message to "Press Enter to exit..." and use
read_line()to match the actual behavior.Also removes the unused
Readimport.