Capture data between terminal creation and connected to terminal in demo#4194
Merged
Tyriar merged 4 commits intoxtermjs:masterfrom Oct 15, 2022
silamon:fixmissingline
Merged
Capture data between terminal creation and connected to terminal in demo#4194Tyriar merged 4 commits intoxtermjs:masterfrom silamon:fixmissingline
Tyriar merged 4 commits intoxtermjs:masterfrom
silamon:fixmissingline
Conversation
Tyriar
requested changes
Oct 9, 2022
Member
Tyriar
left a comment
There was a problem hiding this comment.
Thanks! I saw this but had no idea why it was happening.
demo/server.js
Outdated
Comment on lines
+58
to
+61
| logs[term.pid] = ''; | ||
| term.on('data', function(data) { | ||
| logs[term.pid] += data; | ||
| }); |
Member
There was a problem hiding this comment.
Can we dispose of this listener once the terminal is connected? So after right that ws.send call? That will give us the best of both worlds.
We could then rename logs to something more descriptive to prevent this accident in the future, like unsentOutput?
Member
There was a problem hiding this comment.
Oh well - yeah I removed it because it is a nuisance during perf measuring (backend constantly dies after testing a serious amount of data) - and I wasnt aware of the race condition (never happened for me). I think removing the aggregation buffer once the connection was successful would give us both advantages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When I opened the demo terminal, the first line was missing. The terminal is functioning whatsoever. Looks like the terminal first line is sent before the terminal frontend is connected. Thanks to
ws.send(logs[term.pid]);that line is sent to the terminal frontend when the terminal gets connected.This commit introducing this: 193d305
This reverts it but keeps the higher timeout.