From fa9ee756d20a77b7fd6beaf1c7c708cf71488007 Mon Sep 17 00:00:00 2001 From: Vadhvis Date: Tue, 9 Jul 2024 11:21:35 +0300 Subject: [PATCH] SSH Lag Fix --- tabby-ssh/src/polyfills.ts | 8 ++++++++ tabby-ssh/src/session/ssh.ts | 2 ++ 2 files changed, 10 insertions(+) diff --git a/tabby-ssh/src/polyfills.ts b/tabby-ssh/src/polyfills.ts index 0893d22e24..8872290de9 100644 --- a/tabby-ssh/src/polyfills.ts +++ b/tabby-ssh/src/polyfills.ts @@ -1,4 +1,12 @@ +import 'ssh2'; const nodeCrypto = require('crypto') const browserDH = require('diffie-hellman/browser') nodeCrypto.createDiffieHellmanGroup = browserDH.createDiffieHellmanGroup nodeCrypto.createDiffieHellman = browserDH.createDiffieHellman + +// Declare function missing from @types +declare module 'ssh2' { + interface Client { + setNoDelay(enable?: boolean): this; + } +} \ No newline at end of file diff --git a/tabby-ssh/src/session/ssh.ts b/tabby-ssh/src/session/ssh.ts index 6bc354ef97..bb1de94d75 100644 --- a/tabby-ssh/src/session/ssh.ts +++ b/tabby-ssh/src/session/ssh.ts @@ -218,6 +218,8 @@ export class SSHSession { const resultPromise: Promise = new Promise(async (resolve, reject) => { ssh.on('ready', () => { connected = true + // Fix SSH Lagging + ssh.setNoDelay(true); if (this.savedPassword) { this.passwordStorage.savePassword(this.profile, this.savedPassword) }