]> prime8.dev >> repos - ttyd.git/commitdiff
add trzszDragInitTimeout option (#1238)
authorLonny Wong <lonnywong@qq.com>
Fri, 10 Nov 2023 03:04:00 +0000 (11:04 +0800)
committerGitHub <noreply@github.com>
Fri, 10 Nov 2023 03:04:00 +0000 (11:04 +0800)
html/package.json
html/src/components/terminal/xterm/addons/zmodem.ts
html/src/components/terminal/xterm/index.ts
html/yarn.lock

index fe743e9331edea597106ad6ce3fe3f7ae4b685c1..9b9b25dfc4dbd0568d9613aa2e9562b1eb972a18 100644 (file)
@@ -55,7 +55,7 @@
     "decko": "^1.2.0",
     "file-saver": "^2.0.5",
     "preact": "^10.18.1",
-    "trzsz": "^1.1.3",
+    "trzsz": "^1.1.4",
     "whatwg-fetch": "^3.6.19",
     "xterm": "^5.3.0",
     "xterm-addon-canvas": "^0.5.0",
index 8571f6899bc0bb3db872c16417902540e0381c1c..7873836e953165711ad296c6dd8e530c1a9ca89a 100644 (file)
@@ -8,6 +8,7 @@ export interface ZmodeOptions {
     zmodem: boolean;
     trzsz: boolean;
     windows: boolean;
+    trzszDragInitTimeout: number;
     onSend: () => void;
     sender: (data: string | Uint8Array) => void;
     writer: (data: string | Uint8Array) => void;
@@ -75,6 +76,7 @@ export class ZmodemAddon implements ITerminalAddon {
             sendToServer: data => sender(data),
             terminalColumns: terminal.cols,
             isWindowsShell: this.options.windows,
+            dragInitTimeout: this.options.trzszDragInitTimeout,
         });
         const element = terminal.element as EventTarget;
         this.addDisposableListener(element, 'dragover', event => event.preventDefault());
index 06d97eebbcb359ffc3dfce1acd5608b49feb9332..4610c37dcfb2fe8a1a40eea7b1b3425c40160617 100644 (file)
@@ -45,6 +45,7 @@ export interface ClientOptions {
     enableSixel: boolean;
     titleFixed?: string;
     isWindows: boolean;
+    trzszDragInitTimeout: number;
 }
 
 export interface FlowControl {
@@ -328,6 +329,7 @@ export class Xterm {
                 zmodem: prefs.enableZmodem,
                 trzsz: prefs.enableTrzsz,
                 windows: prefs.isWindows,
+                trzszDragInitTimeout: prefs.trzszDragInitTimeout,
                 onSend: this.sendCb,
                 sender: this.sendData,
                 writer: this.writeData,
@@ -366,6 +368,9 @@ export class Xterm {
                 case 'enableTrzsz':
                     if (value) console.log('[ttyd] trzsz enabled');
                     break;
+                case 'trzszDragInitTimeout':
+                    if (value) console.log(`[ttyd] trzsz drag init timeout: ${value}`);
+                    break;
                 case 'enableSixel':
                     if (value) {
                         terminal.loadAddon(register(new ImageAddon()));
index de113b33c516566fe1fdd10ebf3ba6f1eeaac3b9..b8281f4184760dece65d248a8b88bc073637f506 100644 (file)
@@ -9925,13 +9925,13 @@ __metadata:
   languageName: node
   linkType: hard
 
-"trzsz@npm:^1.1.3":
-  version: 1.1.3
-  resolution: "trzsz@npm:1.1.3"
+"trzsz@npm:^1.1.4":
+  version: 1.1.4
+  resolution: "trzsz@npm:1.1.4"
   bin:
     trz: bin/trz.js
     tsz: bin/tsz.js
-  checksum: 6bdb718a744d6983ebbe57237e54c580cb39ecb5adcf135c65c99a9fd1a3139f52279b9992b6dc28a8d84ca569d7a01e49981d9d2080dd17867ac05c756b15dd
+  checksum: d84fe4f2e2784f0c3beb4063647738f6a32eb07ee0f5de0d8fe5ea9b5a5817e327454e80c2bfa9515090739a5e63e6775340d9d1b06742243e7f1a9b63449ddf
   languageName: node
   linkType: hard
 
@@ -10021,7 +10021,7 @@ __metadata:
     style-loader: ^3.3.3
     terser-webpack-plugin: ^5.3.9
     through2: ^4.0.2
-    trzsz: ^1.1.3
+    trzsz: ^1.1.4
     ts-loader: ^9.5.0
     typescript: ^5.2.2
     util: ^0.12.5