Skip to content
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

Fix terminal newlines #547

Merged
merged 1 commit into from
Nov 23, 2023
Merged

Fix terminal newlines #547

merged 1 commit into from
Nov 23, 2023

Conversation

edlerd
Copy link
Collaborator

@edlerd edlerd commented Nov 23, 2023

Done

  • terminal was messy with newlines before due to race conditions on incoming messages through the websocket. Treating the messages as arraybuffer avoids the race
  • show prompt on tab or browser close, when user interacted with the terminal, this avoids accidental terminal closing. Before we'd only prompt on navigation, not on close.

Fixes #537

QA

  1. Run the LXD-UI:
    • On the demo server via the link posted by @webteam-app below. This is only available for PRs created by collaborators of the repo. Ask @lorumic or @edlerd for access.
    • With a local copy of this branch, run as described here.
  2. Perform the following QA steps:
    • test the instance terminal. The newline bug could be reproduced by just keeping enter pressed to force a lot of new lines. This was reproducible for me only in firefox, not in chrome. This should now produce stable newlines
    • test the instance terminal prompt on tab close or reload. It should show a prompt when interacted with the terminal.

Screenshots

Before broken terminal with newlines in wrong places due to a race condition:

Screenshot from 2023-11-23 12-11-40

Fixed terminal with stable newlines:

Screenshot from 2023-11-23 12-12-00

@webteam-app
Copy link

Demo starting at https://lxd-ui-547.demos.haus

@lorumic lorumic merged commit 6ef6caa into canonical:main Nov 23, 2023
5 checks passed
@edlerd edlerd deleted the terminal-fixes branch December 1, 2023 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Terminal is messy when redrawing
3 participants