using special enter/leave stderr escape sequence on DomTerm #66
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.
Stderrred doesn't work right if stderr contains escape sequences (one example is gcc). In that case only the initial part of the error message is red. This can be fixed by parsing the output looking for escape sequences (specifically "end style" sequences), but that is complex. Better would be for the terminal to understand a special escape sequence pair to delimit error messages. DomTerm defines such a pair of sequences.
Another advantage of a distinct escape sequence is that you can style it - even retroactively. DomTerm (being web-based) uses CSS, so you can use whatever style you want.
Note setting STDERRED_ESC_CODE is insufficient as it doesn't override the
end_color_code
. Plus it is nicer if it is automatic. An alternative way to deal with this would be to allow STDERRED_ESC_CODE to optionally contain both thestart_color_code
and theend_color_code
, perhaps separated by a newline.