Windows-inspired tweaks to the UI #5883
Draft
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.
None of this is intended for direct merging - it's the result of some idle hacking while travelling at the moment.
There are four separable parts of this PR, which anyone should feel free to take and move to completion 🙂
-v
) is specified is implemented on Unix usingUnix.alarm
and so was consequently disabled on Windows in Semi-synchronous verbose mode #1915. It's an irritating limitation when debugging the compiler in opam on Windows, though! The approach is to use a thread instead of sigalrm, but the implementation needs to be hardened (theXXX
notes are things I didn't have in my frontal lobe and couldn't be bothered to lookup!)input_line
until it reachesEnd_of_file
, but the final line may not actually be complete. Regardless, opam then displays it on a complete. Even on Linux, this causes lines inconfigure
scripts to get split. There's a hack in the commit to fix it by usingseek_in
, but it would be better to use proper input functions and do the job properly (but it's fiddly). I'm fairly sure the statement of correctness in a comment in the code is wrong.OpamProcess
should acquire a more structured way of determining "progress" (which might allow, say, the download jobs to tick when content is received and the tarball extractions to tick when a file has been extracted) and the type for the status bar inOpamParallel
should be made richer so that it can be much less hackily annotated the a spinner. Obviously the spinner itself needs to get through the usual mechanisms in OpamConsole for UTF-8 detection, but I was hacking all this in Windows Terminal, with full Unicode joy...The verbose fixes are optional for 2.2.0, but both the extract and spinners I think are required for 2.2.0 because there are otherwise extremely long pauses on Windows which invite pressing CTRL+C.