Consolidate terminal input/output functionality in termstatus.Terminal#5518
Merged
MichaelEischer merged 25 commits intoOct 3, 2025
Merged
Conversation
f9396d3 to
7dd1179
Compare
d54ca9e to
1cf09cf
Compare
7e552ab to
c721f30
Compare
4060320 to
3335f62
Compare
This was referenced Oct 3, 2025
Merged
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.
What does this PR change? What problem does it solve?
Continue the termstatus refactoring. This PR now centralizes all low-level output related functionality in
termstatus.Terminal. This includes all stdin, stdout and stderr related functionality. The termstatus instance is now created in themain()function. This allows replacingglobalOptions.stdoutandglobalOptions.stderrwith new termstatus functionality in the course of this PR. In addition, theglobalOptionsvariable is no longer a global variable but passed individually to each command.Direct
os.Stdin,os.Stdoutandos.Stderrusage is restricted toglobal.goandmain.goby using the termstatus instance of classical dependency injection.fmt.Print*usages are also cut down to an absolute minimum. Backends now also receive a function to print warnings.Tests that need a
termstatus.Terminalmust now use eitherwithCaptureStdoutorwithTermStatus. Combining both is no longer necessary and possible.The changes happen in a slightly random order, but I've already spent too many hour reordering the commit and fixing thousands of merge conflicts to clean this up further.
Was the change previously discussed in an issue or on the forum?
Follow up to #5510 .
Checklist
[ ] I have added documentation for relevant changes (in the manual).[ ] There's a new file inI don't expect any notable user visible changes.changelog/unreleased/that describes the changes for our users (see template).