diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml
index cfcccd7dc..40ea5c3f8 100644
--- a/addons/core/translations/resources/en-us.yaml
+++ b/addons/core/translations/resources/en-us.yaml
@@ -309,6 +309,7 @@ session:
proxy-url:
address-port: Address & port
ssh: SSH
+ shell: Shell
org:
title: Org
title_plural: Orgs
diff --git a/ui/desktop/app/components/session/tabs/index.hbs b/ui/desktop/app/components/session/tabs/index.hbs
new file mode 100644
index 000000000..8b55303cb
--- /dev/null
+++ b/ui/desktop/app/components/session/tabs/index.hbs
@@ -0,0 +1,30 @@
+
+ {{t 'titles.details'}}
+
+ {{t 'resources.session.shell'}}
+
+
+ {{#if (and @model.proxy_address @model.proxy_port)}}
+
+ {{/if}}
+ {{#if @model.credentials}}
+
+ {{else}}
+
+
+
+
+ {{/if}}
+
+
+
+
\ No newline at end of file
diff --git a/ui/desktop/app/components/session/tabs/index.js b/ui/desktop/app/components/session/tabs/index.js
new file mode 100644
index 000000000..636de6f4a
--- /dev/null
+++ b/ui/desktop/app/components/session/tabs/index.js
@@ -0,0 +1,86 @@
+import Component from '@glimmer/component';
+import { action } from '@ember/object';
+import { Terminal } from 'xterm';
+import { FitAddon } from 'xterm-addon-fit';
+import { v4 as uuidv4 } from 'uuid';
+import debounce from 'lodash/debounce';
+
+const terminalOptions = {
+ cursorBlink: true,
+};
+
+export default class SessionTerminalTabsComponent extends Component {
+ // =attributes
+
+ id;
+ terminal;
+ removeListener;
+
+ // =actions
+
+ @action
+ openTerminal() {
+ // Don't re-initialize the terminal if it's already been opened
+ if (this.terminal) {
+ return;
+ }
+
+ const xterm = new Terminal(terminalOptions);
+ this.terminal = xterm;
+ const fitAddon = new FitAddon();
+ const termContainer = document.getElementById(`terminal-container`);
+
+ xterm.loadAddon(fitAddon);
+ xterm.open(termContainer);
+ fitAddon.fit();
+ xterm.focus();
+
+ // Generate a UUID to have the terminal handlers be unique
+ this.id = uuidv4();
+ this.#setupTerminal(fitAddon, xterm);
+
+ const { model } = this.args;
+ if (model.target?.isSSH) {
+ const { proxy_address, proxy_port } = model;
+
+ // Send an SSH command immediately
+ window.terminal.send(`ssh ${proxy_address} -p ${proxy_port}\r`, this.id);
+ }
+ }
+
+ willDestroy() {
+ super.willDestroy(...arguments);
+
+ // Kill terminal and clean up event listeners
+ if (this.terminal) {
+ this.terminal.dispose();
+ }
+ window.terminal?.remove(this.id);
+ window.onresize = null;
+ if (this.removeListener) {
+ this.removeListener();
+ }
+ }
+
+ #setupTerminal(fitAddon, xterm) {
+ // Terminal is exposed by contextBridge within the preload script
+ window.terminal.create({ id: this.id, cols: xterm.cols, rows: xterm.rows });
+ xterm.onData((data) => window.terminal.send(data, this.id));
+ this.removeListener = window.terminal.receive((event, value) => {
+ xterm.write(value);
+ }, this.id);
+
+ // Handle resizing terminal windows. We debounce the resizing as we
+ // don't want to resize xterm and the pty process before the previous
+ // one has finished
+ const debouncedFit = debounce(() => {
+ fitAddon.fit();
+ }, 150);
+ window.onresize = () => {
+ debouncedFit();
+ };
+ xterm.onResize((size) => {
+ window.terminal.resize(size, this.id);
+ });
+ }
+}
diff --git a/ui/desktop/app/styles/app.scss b/ui/desktop/app/styles/app.scss
index a27ff8c71..2e5be7251 100644
--- a/ui/desktop/app/styles/app.scss
+++ b/ui/desktop/app/styles/app.scss
@@ -516,6 +516,7 @@ $chevron-down: url("data:image/svg+xml;utf-8,
+
- {{#if (and @model.proxy_address @model.proxy_port)}}
-
- {{/if}}
+
- {{#if @model.credentials}}
-
- {{else}}
-
-
-
-
- {{/if}}
+