You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote some data using term.writeln. At the same time, I can't get the value I just set using term._core.buffer. But when I set a timer, everything works fine setTimeout(getBuffer, 3000);
write and writeln are async methods, they get not immediately processed. The reason for this is the output, we have to process incomming data in chunks to allow the renderer to update the viewport in between.
term._core.writeBuffer Is it a reliable way to use it ?
You should not rely on term._core.writeBuffer - its not exposed via API thus may change over time. Furthermore its the buffer for incomming data, the terminal has not yet dealt with that data.
As @Tyriar wrote the plan is to add a callback to write methods (nodejs style) that gets called once the chunk was processed by the parser. With this you can promisify your code later on:
...
awaitnewPromise(resolve=>term.write('some string data',resolve));doSomething();// executed after the chunk was processed
...
Hi @Tyriar
I wrote some data using
term.writeln
. At the same time, I can't get the value I just set usingterm._core.buffer
. But when I set a timer, everything works finesetTimeout(getBuffer, 3000);
I tested the demo used:
https://codesandbox.io/embed/elated-davinci-mue6q
I am very confused. Do you know why? 🤔
thank you very much!
The text was updated successfully, but these errors were encountered: