From 2f7dcf3339bbfacd13990c41d5571149d6c13aa0 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Fri, 3 Jan 2020 16:04:30 +0100 Subject: [PATCH] made x11 forwarding configurable (fixes #1950, fixes #1954) --- terminus-ssh/src/api.ts | 12 ++---------- .../src/components/editConnectionModal.component.pug | 5 +++++ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/terminus-ssh/src/api.ts b/terminus-ssh/src/api.ts index 23e0737a..b859c181 100644 --- a/terminus-ssh/src/api.ts +++ b/terminus-ssh/src/api.ts @@ -31,6 +31,7 @@ export interface SSHConnection { keepaliveCountMax?: number readyTimeout?: number color?: string + x11?: boolean algorithms?: {[t: string]: string[]} } @@ -89,16 +90,7 @@ export class SSHSession extends BaseSession { this.open = true try { - try { - this.shell = await this.openShellChannel({ x11: true }) - } catch (e) { - if (e.toString().includes('Unable to request X11')) { - this.logger.debug('X11 forwarding rejected, trying without') - this.shell = await this.openShellChannel({}) - } else { - throw e - } - } + this.shell = await this.openShellChannel({ x11: this.connection.x11 }) } catch (err) { this.emitServiceMessage(`Remote rejected opening a shell channel: ${err}`) } diff --git a/terminus-ssh/src/components/editConnectionModal.component.pug b/terminus-ssh/src/components/editConnectionModal.component.pug index 1d847077..9bc264b5 100644 --- a/terminus-ssh/src/components/editConnectionModal.component.pug +++ b/terminus-ssh/src/components/editConnectionModal.component.pug @@ -81,6 +81,11 @@ ngb-tab(id='advanced') ng-template(ngbTabTitle) Advanced ng-template(ngbTabContent) + .form-line + .header + .title X11 forwarding + toggle([(ngModel)]='connection.x11') + .form-group label Keep Alive Interval (Milliseconds) input.form-control(