finch-shell-go 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -22757,9 +22757,26 @@ function createTerminalController({ onData, scrollback, withWebgl = false, onRes
|
|
|
22757
22757
|
});
|
|
22758
22758
|
term.loadAddon(webgl);
|
|
22759
22759
|
} catch {}
|
|
22760
|
+
node.addEventListener("keydown", onInterruptKey, true);
|
|
22761
|
+
document.addEventListener("copy", onCopyWithoutSelection, true);
|
|
22760
22762
|
syncSize();
|
|
22761
22763
|
return term;
|
|
22762
22764
|
}
|
|
22765
|
+
/** Ctrl+C → ETX;阻止继续传递,避免 xterm 再发一次。 */
|
|
22766
|
+
function onInterruptKey(event) {
|
|
22767
|
+
if (!event.ctrlKey || event.altKey || event.metaKey) return;
|
|
22768
|
+
if (String(event.key).toLowerCase() !== "c") return;
|
|
22769
|
+
event.preventDefault();
|
|
22770
|
+
event.stopPropagation();
|
|
22771
|
+
onData("");
|
|
22772
|
+
}
|
|
22773
|
+
/** 没有选区时的「复制」请求其实是 Ctrl+C:当成中断处理,别让它清空剪贴板。 */
|
|
22774
|
+
function onCopyWithoutSelection(event) {
|
|
22775
|
+
if (term.hasSelection()) return;
|
|
22776
|
+
if (!container?.contains(document.activeElement)) return;
|
|
22777
|
+
event.preventDefault();
|
|
22778
|
+
onData("");
|
|
22779
|
+
}
|
|
22763
22780
|
term.onData((data) => onData(data));
|
|
22764
22781
|
return {
|
|
22765
22782
|
term,
|
|
@@ -22789,6 +22806,8 @@ function createTerminalController({ onData, scrollback, withWebgl = false, onRes
|
|
|
22789
22806
|
} catch {}
|
|
22790
22807
|
},
|
|
22791
22808
|
dispose: () => {
|
|
22809
|
+
container?.removeEventListener("keydown", onInterruptKey, true);
|
|
22810
|
+
document.removeEventListener("copy", onCopyWithoutSelection, true);
|
|
22792
22811
|
try {
|
|
22793
22812
|
webgl?.dispose();
|
|
22794
22813
|
} catch {}
|
package/dist/ui/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>小终端</title>
|
|
7
|
-
<script type="module" crossorigin src="./assets/index-
|
|
7
|
+
<script type="module" crossorigin src="./assets/index-cCJjKX-M.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="./assets/index-Zw5vGntZ.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|