lunel-cli 0.1.20 → 0.1.21
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 +14 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -605,7 +605,7 @@ function ensurePtyProcess() {
|
|
|
605
605
|
mouseEncoding: event.mouseEncoding,
|
|
606
606
|
reverseVideo: event.reverseVideo,
|
|
607
607
|
title: event.title,
|
|
608
|
-
|
|
608
|
+
scrollbackLength: event.scrollbackLength,
|
|
609
609
|
},
|
|
610
610
|
};
|
|
611
611
|
dataChannel.send(JSON.stringify(msg));
|
|
@@ -689,6 +689,16 @@ function handleTerminalKill(payload) {
|
|
|
689
689
|
terminals.delete(terminalId);
|
|
690
690
|
return {};
|
|
691
691
|
}
|
|
692
|
+
function handleTerminalScroll(payload) {
|
|
693
|
+
const terminalId = payload.terminalId;
|
|
694
|
+
const offset = payload.offset || 0;
|
|
695
|
+
if (!terminalId)
|
|
696
|
+
throw Object.assign(new Error("terminalId is required"), { code: "EINVAL" });
|
|
697
|
+
if (!terminals.has(terminalId))
|
|
698
|
+
throw Object.assign(new Error("Terminal not found"), { code: "ENOTERM" });
|
|
699
|
+
sendToPty({ cmd: "scroll", id: terminalId, offset });
|
|
700
|
+
return {};
|
|
701
|
+
}
|
|
692
702
|
// ============================================================================
|
|
693
703
|
// System Handlers
|
|
694
704
|
// ============================================================================
|
|
@@ -1537,6 +1547,9 @@ async function processMessage(message) {
|
|
|
1537
1547
|
case "kill":
|
|
1538
1548
|
result = handleTerminalKill(payload);
|
|
1539
1549
|
break;
|
|
1550
|
+
case "scroll":
|
|
1551
|
+
result = handleTerminalScroll(payload);
|
|
1552
|
+
break;
|
|
1540
1553
|
default:
|
|
1541
1554
|
throw Object.assign(new Error(`Unknown action: ${ns}.${action}`), { code: "EINVAL" });
|
|
1542
1555
|
}
|