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) }