Open AshlinHarris opened 1 year ago
Adding this feature would allow users to reproduce the spinners from Pkg.jl and PackageCompiler.jl.
There should be a Spinner
struct that includes style, location, etc.
ANSI escape codes can be used for positioning the cursor.
As far as I can tell, the Pkg.jl spinners uses REPL.TerminalMenus
in order to manage multiple spinners. I can't find a simple and widely-supported way to get the terminal cursor position, I'll use the REPL's terminal menu feature.
In this case, would Julia 1.9's interactive threadpools still be needed for updating a spinner during computation?
REPL.Terminals.jl's WIP for accessing terminal cursor location:
getX(t::TextTerminal) = error("Unimplemented")
getY(t::TextTerminal) = error("Unimplemented")
It might be straightforward to create a menu with blank cursors and empty actions. The entire menu would need to be redrawn in the same spot. Additionally, the frame rate might have to be increased so that all spinners won't appear to be in sync.
This could be done with ANSI cursor commands.