lunel-cli 0.1.19 → 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 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -605,6 +605,7 @@ function ensurePtyProcess() {
|
|
|
605
605
|
mouseEncoding: event.mouseEncoding,
|
|
606
606
|
reverseVideo: event.reverseVideo,
|
|
607
607
|
title: event.title,
|
|
608
|
+
scrollbackLength: event.scrollbackLength,
|
|
608
609
|
},
|
|
609
610
|
};
|
|
610
611
|
dataChannel.send(JSON.stringify(msg));
|
|
@@ -688,6 +689,16 @@ function handleTerminalKill(payload) {
|
|
|
688
689
|
terminals.delete(terminalId);
|
|
689
690
|
return {};
|
|
690
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
|
+
}
|
|
691
702
|
// ============================================================================
|
|
692
703
|
// System Handlers
|
|
693
704
|
// ============================================================================
|
|
@@ -1536,6 +1547,9 @@ async function processMessage(message) {
|
|
|
1536
1547
|
case "kill":
|
|
1537
1548
|
result = handleTerminalKill(payload);
|
|
1538
1549
|
break;
|
|
1550
|
+
case "scroll":
|
|
1551
|
+
result = handleTerminalScroll(payload);
|
|
1552
|
+
break;
|
|
1539
1553
|
default:
|
|
1540
1554
|
throw Object.assign(new Error(`Unknown action: ${ns}.${action}`), { code: "EINVAL" });
|
|
1541
1555
|
}
|