-
-
Notifications
You must be signed in to change notification settings - Fork 545
Exporting recorded output of a Live display can give empty results. #1723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@FrankRay78 No, this is not related. |
@patriksvensson I thought they were related because if I could get the Perhaps not directly related, but more like an alternative approach / workaround to using AnsiConsole Recording. Although I'm happy to be corrected. |
Hi. Thank you for your reply. I came back to this topic after a while and tried the I have created PR with the fix, so you can decide if you want it to be merged. Thank you. |
There can't be any guarantees about live recording (animations) and text output I'm afraid. |
Hello everyone 👋. I was exploring this awesome library and started to improve my personal CLI tools with it, but unfortunately I have found an issue, which I wanted to share.
Information
Describe the bug
I have observed that live display of a table is not always properly recorded. For relatively small tables, when I call
AnsiConsole.ExportText()
after recording, it returns an empty string. However for large tables, it returns string with the full table output (as expected).To Reproduce
Example C# program to simulate issue:
Expected behavior
In the example the value of a
text
is empty, but should contain an exported table output (the expected result of the whole example program is to print the same table twice). When I increase number of rows to for ex. 50 or 100, it produces the expected result.Additional context
I want to be able to save my program live outputs into a file. Piping live outputs from shell is not possible/supported, and it throws
System.IO.IOException
(as described in this issue comment: #1393 (comment)), so the only reasonable way to do it seems to be: record, export and save into a file.Possible fix/workaround
I have looked into the source code and found that method
LiveDisplayRenderer.Completed(bool autoclear)
forces to redraw when overflow occurs, which causes, the output to be correctly recorded and exported for larger tables.As a workaround solution I have created small fix that turn this redraw behavior on, every time when recorder has been registered. You can see it on my fork: main...bmic86:spectre.console:fix/recording_on_live
Please upvote 👍 this issue if you are interested in it.
The text was updated successfully, but these errors were encountered: