Browse Source

fixed X11 display spec parsing - fixes #5073, fixes #4978

Eugene Pankov 3 years ago
parent
commit
b2b91f0cfd
2 changed files with 2 additions and 2 deletions
  1. 1 1
      tabby-ssh/src/session/ssh.ts
  2. 1 1
      tabby-ssh/src/session/x11.ts

+ 1 - 1
tabby-ssh/src/session/ssh.ts

@@ -371,7 +371,7 @@ export class SSHSession extends BaseSession {
 
         this.ssh.on('x11', async (details, accept, reject) => {
             this.logger.info(`Incoming X11 connection from ${details.srcIP}:${details.srcPort}`)
-            const displaySpec = process.env.DISPLAY ?? 'localhost:0'
+            const displaySpec = (this.config.store.ssh.x11Display || process.env.DISPLAY) ?? 'localhost:0'
             this.logger.debug(`Trying display ${displaySpec}`)
 
             const socket = new X11Socket()

+ 1 - 1
tabby-ssh/src/session/x11.ts

@@ -7,7 +7,7 @@ export class X11Socket {
 
     static resolveDisplaySpec (spec?: string|null): SocketConnectOpts {
         // eslint-disable-next-line prefer-const
-        let [xHost, xDisplay] = /^(.+):(\d+)(?:.(\d+))$/.exec(spec ?? process.env.DISPLAY ?? 'localhost:0') ?? []
+        let [_, xHost, xDisplay] = /^(.+):(\d+)(?:.(\d+))$/.exec(spec ?? process.env.DISPLAY ?? 'localhost:0') ?? []
         if (process.platform === 'win32') {
             xHost ??= 'localhost'
         } else {