-
-
Notifications
You must be signed in to change notification settings - Fork 576
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
Imported view duplicates echo of async function #987
Comments
This is a race condition, this works fine: term.clear();
term.echo(async () => `<yellow>this is async function</yellow>`);
setTimeout(() => {
const view = term.export_view();
term.clear();
term.import_view(view);
}); Not sure if this is worth fixing, Maybe just document, to not export view after async echo. |
This is more problematic, the solution above only works when the async function does nothing. The export view needs to happen after the function is resolved. |
To not break the API, the export_view is still synchronous. I've added |
Issue summary
When import a view that contains echo with async function, the async function is duplicated after each import.
Expected behavior
Async function should behave the same as sync ones
Steps to reproduce
import_view
make the output show 2 async echoBrowser and OS
Additional notes
The more
import_view
are added, the more duplicated linesAs many extra async functions as there are
import_view
calls.The text was updated successfully, but these errors were encountered: