Multi output creates launch delay when a lot of output was previously created
vanowm opened this issue · comments
The multi output feature has a side effect: because it doesn't clear global Autoit
output panel, after a while VSCode become sluggish when executing a script.
What can we do to fix that?
A few possible solutions I could think of:
- have a hotkey to clear global output
- display a toast message with a button to clear the output
- forcibly clear it after NN bytes of data displayed. Of course, a best solution would be to keep last NN bytes of data, unfortunately VSCode API doesn't provide such capability, at least my research didn't turn up anything useful.
Any suggestions?
According to the docs --
You can access the visible or active output channel as a text document from visible editors or active editor and use the language id to contribute language features like syntax coloring, code lens etc.,
Could you use this feature to obtain the channel's text, prune it, then rewrite it using the channel's replace
method?
The delay is actually happening when "global" output opens after old "process" output panel closed and unfortunately that API only available for currently opened panels.
Since we are in control what goes to which output channel, we could potentially keep global output data in memory at all times, and trim it as needed, but I think this would be very inefficient.
Would it help if you performed the pruning action when launching a new script?
At first I was going to say "no, because it opens global output for a moment when launching script", but then the whole delay is happening because there is no trimming happening, so I think it would help as long as it doesn't let output to be too large in the first place.