@staff0rd/assist 0.1112.4 → 0.1112.5
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/built-version +1 -1
- package/dist/commands/sessions/web/bundle.js +349 -348
- package/dist/index.js +24 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.1112.
|
|
9
|
+
version: "0.1112.5",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -56886,6 +56886,25 @@ function startSessionTitleGeneration(session, notify2) {
|
|
|
56886
56886
|
// src/commands/sessions/daemon/createScreenMirror.ts
|
|
56887
56887
|
import serialize from "@xterm/addon-serialize";
|
|
56888
56888
|
import headless from "@xterm/headless";
|
|
56889
|
+
|
|
56890
|
+
// src/commands/sessions/daemon/trackSgrMouseMode.ts
|
|
56891
|
+
var SGR_MOUSE_MODE = 1006;
|
|
56892
|
+
function trackSgrMouseMode(term) {
|
|
56893
|
+
let sgr = false;
|
|
56894
|
+
const watch4 = (final, on2) => term.parser.registerCsiHandler({ prefix: "?", final }, (params) => {
|
|
56895
|
+
if (params.includes(SGR_MOUSE_MODE)) sgr = on2;
|
|
56896
|
+
return false;
|
|
56897
|
+
});
|
|
56898
|
+
watch4("h", true);
|
|
56899
|
+
watch4("l", false);
|
|
56900
|
+
term.parser.registerEscHandler({ final: "c" }, () => {
|
|
56901
|
+
sgr = false;
|
|
56902
|
+
return false;
|
|
56903
|
+
});
|
|
56904
|
+
return () => sgr;
|
|
56905
|
+
}
|
|
56906
|
+
|
|
56907
|
+
// src/commands/sessions/daemon/createScreenMirror.ts
|
|
56889
56908
|
var { SerializeAddon } = serialize;
|
|
56890
56909
|
var { Terminal } = headless;
|
|
56891
56910
|
var SCROLLBACK_LINES = 5e3;
|
|
@@ -56898,6 +56917,7 @@ function createScreenMirror(cols, rows) {
|
|
|
56898
56917
|
});
|
|
56899
56918
|
const serializer = new SerializeAddon();
|
|
56900
56919
|
term.loadAddon(serializer);
|
|
56920
|
+
const sgrMouse = trackSgrMouseMode(term);
|
|
56901
56921
|
let notYetParsed = "";
|
|
56902
56922
|
return {
|
|
56903
56923
|
write: (data) => {
|
|
@@ -56909,7 +56929,9 @@ function createScreenMirror(cols, rows) {
|
|
|
56909
56929
|
resize: (c, r) => {
|
|
56910
56930
|
if (c > 0 && r > 0) term.resize(c, r);
|
|
56911
56931
|
},
|
|
56912
|
-
|
|
56932
|
+
/* why: the serializer restores the mouse tracking mode but not its encoding,
|
|
56933
|
+
so a replayed terminal would report the wheel in X10 to an app expecting SGR. */
|
|
56934
|
+
snapshot: () => serializer.serialize({ scrollback: SCROLLBACK_LINES }) + (sgrMouse() ? "\x1B[?1006h" : "") + notYetParsed
|
|
56913
56935
|
};
|
|
56914
56936
|
}
|
|
56915
56937
|
|