Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
ui: removed fix for resolved safari bug with xterm/webgl
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabrina Ko committed Oct 17, 2022
1 parent d12f7df commit 2506f66
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 34 deletions.
3 changes: 3 additions & 0 deletions .changelog/4054.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui: fix safari bug with xterm/webgl rendering
```
7 changes: 0 additions & 7 deletions ui/app/utils/browser.ts

This file was deleted.

7 changes: 0 additions & 7 deletions ui/app/utils/create-terminal.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ITerminalOptions, Terminal } from 'xterm';

import { isSafari } from 'waypoint/utils/browser';
import terminalTheme from 'waypoint/utils/terminal-theme';

interface TerminalOptions {
Expand All @@ -18,12 +17,6 @@ export function createTerminal(options: TerminalOptions): Terminal {
theme: terminalTheme.light,
};

// The optional boolean is used for DOM rendering in tests
// Because of a bug with Safari and webGL, we turn DOM rendering on in Safari only
if (options.domRendering === true || isSafari) {
terminalOptions.rendererType = 'dom';
}

// Switch to dark theme if enabled
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
terminalOptions.theme = terminalTheme.dark;
Expand Down
20 changes: 0 additions & 20 deletions ui/tests/integration/components/render-terminal-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,4 @@ module('Integration | Component | render-terminal', function (hooks) {
}, 10);
await settled();
});

test('non-canvas rendering renders the proper html output', async function (assert) {
// Setup terminal externally, as expected by the component
let terminal = createTerminal({ inputDisabled: true, domRendering: true });
this.set('terminal', terminal);
// pass terminal and render
await render(hbs`<RenderTerminal @terminal={{this.terminal}}/>`);
// write line and see if it renders
terminal.writeln('Welcome to Waypoint!');
// We have to use the runloop as writeln isn't async
// Note that even the xterm.js rendering tests use polling to evaluate rendering
later(() => {
assert.dom(terminal?.element).includesText('Welcome to Waypoint!');
}, 50);
assert.dom('[data-test-xterm-pane]').exists('the xterm pane renders');
assert.dom('.xterm').exists('the xterm terminal renders');
// Clean up terminal
await settled();
await clearRender();
});
});

0 comments on commit 2506f66

Please sign in to comment.