@simon_he/vue-tui 1.1.1 → 1.1.2
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/README.md +68 -28
- package/dist/{TMermaidText-CXm_L969.js → TMermaidText-frVr8Ysb.js} +1 -1
- package/dist/{TSelect-CiyMvwl-.js → TSelect-tJ87rKPM.js} +6 -168
- package/dist/{TTree-DKGiuIcM.js → TTree-CGdE-CYu.js} +12 -13
- package/dist/agent.cjs +9 -5
- package/dist/agent.js +15 -1197
- package/dist/{block-source-5CQp4tF8.js → block-source-CrlmaBM5.js} +7 -601
- package/dist/cli/input.d.ts +8 -0
- package/dist/cli/video/ffmpeg-frame-source.d.ts +10 -0
- package/dist/cli/video/png-frame-parser.d.ts +4 -0
- package/dist/cli/video/raw-frame-parser.d.ts +1 -0
- package/dist/cli/video/yt-dlp-frame-source.d.ts +11 -0
- package/dist/cli.cjs +142 -33
- package/dist/cli.d.cts +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +167 -37
- package/dist/core.js +5 -6
- package/dist/create-terminal-app.d.ts +24 -1
- package/dist/{debug-logger-ChY_PXVk.js → debug-logger-CmsGI4of.js} +1 -1
- package/dist/{dom-renderer-DNzmg2As.js → dom-renderer-DXx8fWzD.js} +2 -3
- package/dist/experimental/3d/bun/contributor-avatar-atlas.d.ts +12 -0
- package/dist/experimental/3d/bun/png.d.ts +1 -0
- package/dist/experimental/3d/bun/terminal-badge-scene.d.ts +11 -0
- package/dist/experimental/3d/bun/terminal-badge.wgsl.d.ts +1 -0
- package/dist/experimental/3d/bun/webgpu-renderer.d.ts +26 -0
- package/dist/experimental/3d/bun.cjs +7271 -0
- package/dist/experimental/3d/bun.d.cts +4 -0
- package/dist/experimental/3d/bun.d.ts +4 -0
- package/dist/experimental/3d/bun.js +7390 -0
- package/dist/experimental/video/node.cjs +497 -0
- package/dist/experimental/video/node.d.cts +4 -0
- package/dist/experimental/video/node.d.ts +4 -0
- package/dist/experimental/video/node.js +610 -0
- package/dist/experimental.cjs +3064 -567
- package/dist/experimental.d.cts +5 -0
- package/dist/experimental.d.ts +5 -0
- package/dist/experimental.js +1524 -9
- package/dist/{create-terminal-DXuZ2fci.js → hyperlink-_1FAj7Wq.js} +403 -2
- package/dist/index.js +15 -16
- package/dist/{linkify-CuuquMQT.js → linkify-D68T7rdW.js} +164 -3
- package/dist/markdown.js +8 -8
- package/dist/{mermaid-CWto52Wk.js → mermaid-BNhM1jAZ.js} +1 -1
- package/dist/mermaid.js +3 -3
- package/dist/observability.js +2 -2
- package/dist/{path-suggest-fPzRsgPv.js → path-suggest-Dndu4dTi.js} +1 -1
- package/dist/renderer/terminal-graphics.d.ts +1 -0
- package/dist/renderer-dom.js +3 -4
- package/dist/runtime.js +2 -2
- package/dist/terminal-graphics-Bbe83wSr.js +597 -0
- package/dist/{tlog-theme-CopRt9SC.js → tlog-theme-Bul2Na3u.js} +1206 -12
- package/dist/{trace-CYHDKM1m.js → trace-Bh8WnoMo.js} +1 -1
- package/dist/vue/components/T3DViewport.d.ts +473 -0
- package/dist/vue/components/TAgentTerminalGraphic.d.ts +13 -0
- package/dist/vue/components/TVideo.d.ts +291 -0
- package/dist/vue/video/types.d.ts +39 -0
- package/dist/vue.js +17 -18
- package/package.json +38 -1
- package/dist/hyperlink-B35-O-cW.js +0 -403
- /package/dist/{ansi-palette-CNXqFciC.js → ansi-palette-CH6jc2Z7.js} +0 -0
- /package/dist/{env-DNCzvX8b.js → env-Cl8qmNFN.js} +0 -0
- /package/dist/{frame-perf-BBhE-iuS.js → frame-perf-CHpWhbC4.js} +0 -0
- /package/dist/{path-BI9W15Zt.js → path-mnSgEpCm.js} +0 -0
- /package/dist/{rect-Ng-3eKzF.js → rect-DUpeDfBg.js} +0 -0
- /package/dist/{runtime-D77C03RM.js → runtime-Byf8XXOT.js} +0 -0
- /package/dist/{terminal-selection-CQYr--26.js → terminal-selection-4W1SJj4c.js} +0 -0
- /package/dist/{wheel-scroll-CQ22Hcyj.js → wheel-scroll-DASkEZr-.js} +0 -0
package/dist/cli.cjs
CHANGED
|
@@ -2041,7 +2041,7 @@ function createStdinDriver(options) {
|
|
|
2041
2041
|
}
|
|
2042
2042
|
if (stdin.isTTY && stdin.setRawMode(!!wasRaw), stdout.isTTY) {
|
|
2043
2043
|
let restore = "\x1B[?2004l\x1B[?1004l";
|
|
2044
|
-
keyboardProtocolSequences && (restore += keyboardProtocolSequences.disable),
|
|
2044
|
+
keyboardProtocolSequences && (restore += keyboardProtocolSequences.disable), restore += "\x1B[?1007l", restore += enableMouseMotion ? "\x1B[?1000l\x1B[?1003l\x1B[?1006l" : "\x1B[?1000l\x1B[?1002l\x1B[?1006l", writeTTYSyncOrStream(stdout, restore);
|
|
2045
2045
|
}
|
|
2046
2046
|
}
|
|
2047
2047
|
}, autoCleanup = options.autoCleanup ?? !1;
|
|
@@ -2052,7 +2052,11 @@ function createStdinDriver(options) {
|
|
|
2052
2052
|
signalPolicy: typeof autoCleanup == "object" ? cleanupOptions.signalPolicy ?? "reraise" : "reraise"
|
|
2053
2053
|
});
|
|
2054
2054
|
}
|
|
2055
|
-
return { dispose
|
|
2055
|
+
return { dispose, setMouseCapture: (enabled) => {
|
|
2056
|
+
disposed || !stdout.isTTY || (enabled ? (stdout.write("\x1B[?1007h"), enableMouseMotion ? stdout.write("\x1B[?1000h\x1B[?1003h\x1B[?1006h") : stdout.write("\x1B[?1000h\x1B[?1002h\x1B[?1006h")) : (stdout.write("\x1B[?1007l"), stdout.write(
|
|
2057
|
+
enableMouseMotion ? "\x1B[?1000l\x1B[?1003l\x1B[?1006l" : "\x1B[?1000l\x1B[?1002l\x1B[?1006l"
|
|
2058
|
+
)));
|
|
2059
|
+
} };
|
|
2056
2060
|
}
|
|
2057
2061
|
|
|
2058
2062
|
// src/cli/path-provider.ts
|
|
@@ -6605,7 +6609,7 @@ function createTerminalApp(options) {
|
|
|
6605
6609
|
originX: 0,
|
|
6606
6610
|
originY: 0,
|
|
6607
6611
|
clipRect: { x: 0, y: 0, w: options.cols, h: options.rows }
|
|
6608
|
-
}), selectionTextProviders = /* @__PURE__ */ new Map(), selectionCopyHandlers = /* @__PURE__ */ new Set(), selectionContext = {
|
|
6612
|
+
}), selectionTextProviders = /* @__PURE__ */ new Map(), selectionCopyHandlers = /* @__PURE__ */ new Set(), selectionConfig = (0, import_vue7.shallowRef)(options.selection ?? !1), selectionContext = {
|
|
6609
6613
|
registerTextProvider(provider) {
|
|
6610
6614
|
return selectionTextProviders.set(provider.id, provider), () => {
|
|
6611
6615
|
selectionTextProviders.get(provider.id) === provider && (selectionTextProviders.delete(provider.id), selection.clearProvider(provider.id));
|
|
@@ -6619,6 +6623,9 @@ function createTerminalApp(options) {
|
|
|
6619
6623
|
},
|
|
6620
6624
|
clear() {
|
|
6621
6625
|
selection.clear();
|
|
6626
|
+
},
|
|
6627
|
+
setConfig(config) {
|
|
6628
|
+
selectionConfig.value = config, selection.refresh();
|
|
6622
6629
|
}
|
|
6623
6630
|
}, selectionOverlay = getPlaneTerminal(terminal, "overlay"), selectionReadPlanes = ["default", "transcript", "chrome"], selectionRenderNodeId = null, selectionRenderRect = () => null, selection = createTerminalSelectionController({
|
|
6624
6631
|
terminal,
|
|
@@ -6627,7 +6634,7 @@ function createTerminalApp(options) {
|
|
|
6627
6634
|
getRow: (y) => readTerminalRowForPlanes(terminal, y, selectionReadPlanes),
|
|
6628
6635
|
getTextProviders: () => Array.from(selectionTextProviders.values()),
|
|
6629
6636
|
getOptions: () => {
|
|
6630
|
-
let config = resolveSelectionConfig(
|
|
6637
|
+
let config = resolveSelectionConfig(selectionConfig.value);
|
|
6631
6638
|
return {
|
|
6632
6639
|
autoCopy: config.autoCopy,
|
|
6633
6640
|
copyOnMouseUp: config.copyOnMouseUp,
|
|
@@ -6790,6 +6797,8 @@ function createTerminalApp(options) {
|
|
|
6790
6797
|
events,
|
|
6791
6798
|
scheduler: ctx.scheduler,
|
|
6792
6799
|
defaultStyle: ctx.defaultStyle,
|
|
6800
|
+
clipboard,
|
|
6801
|
+
selection: selectionContext,
|
|
6793
6802
|
getImeAnchor() {
|
|
6794
6803
|
return imeAnchor.value;
|
|
6795
6804
|
},
|
|
@@ -7970,7 +7979,7 @@ function createStdoutRenderer(terminal, options) {
|
|
|
7970
7979
|
return "multi-span";
|
|
7971
7980
|
}
|
|
7972
7981
|
}
|
|
7973
|
-
let effectiveDirtyRowPatchMode = resolveEffectiveDirtyRowPatchMode(), shouldUseDirtySpans = () => effectiveDirtyRowPatchMode !== "row", shouldUseMultiDirtySpans = () => effectiveDirtyRowPatchMode === "multi-span", enableOsc8Links = outputAllowsOsc8Links && !isVscodeTerminal, renderedHref = (value) => enableOsc8Links ? normalizeHref(value) : null, disposed = !1, lastFrameTime = 0, pendingRender = !1, renderTimer = null, rowsOnlyResizeRepaintTimer = null, writeEmaMs = 0, lastCursorX = null, lastCursorY = null, accumulatedAllRows = !1, accumulatedDirtyBits = null, accumulatedDirtyCount = 0, accumulatedDirtyMin = Number.POSITIVE_INFINITY, accumulatedDirtyMax = -1, accumulatedDirtyRowsRequireRepaint = !1, accumulatedScrollOperations = null, allowNextGraphicsOnlyRenderWithoutBaseline = !1, preserveNextRowsOnlyResizeBaseline = !1, deferGraphicsFlushUntilResizeCommit = !1, graphicsCapabilities = resolveTerminalGraphicsCapabilities(options, env, outputIsTTY), pendingGraphics = /* @__PURE__ */ new Map(), pendingGraphicClears = /* @__PURE__ */ new Set(), activeGraphics = /* @__PURE__ */ new Map(), pendingGraphicSignatures = /* @__PURE__ */ new Map(), activeGraphicSignatures = /* @__PURE__ */ new Map(), retainedGraphics = /* @__PURE__ */ new Map(), terminalResizeDirtyGraphics = /* @__PURE__ */ new Set(), nextGraphicsOrder = 0, terminalGraphicsFlushTimer = null, hasPendingTerminalGraphics = () => pendingGraphics.size > 0 || pendingGraphicClears.size > 0;
|
|
7982
|
+
let effectiveDirtyRowPatchMode = resolveEffectiveDirtyRowPatchMode(), shouldUseDirtySpans = () => effectiveDirtyRowPatchMode !== "row", shouldUseMultiDirtySpans = () => effectiveDirtyRowPatchMode === "multi-span", enableOsc8Links = outputAllowsOsc8Links && !isVscodeTerminal, renderedHref = (value) => enableOsc8Links ? normalizeHref(value) : null, disposed = !1, lastFrameTime = 0, pendingRender = !1, renderTimer = null, rowsOnlyResizeRepaintTimer = null, writeEmaMs = 0, lastCursorX = null, lastCursorY = null, accumulatedAllRows = !1, accumulatedDirtyBits = null, accumulatedDirtyCount = 0, accumulatedDirtyMin = Number.POSITIVE_INFINITY, accumulatedDirtyMax = -1, accumulatedDirtyRowsRequireRepaint = !1, accumulatedScrollOperations = null, allowNextGraphicsOnlyRenderWithoutBaseline = !1, preserveNextRowsOnlyResizeBaseline = !1, deferGraphicsFlushUntilResizeCommit = !1, graphicsCapabilities = resolveTerminalGraphicsCapabilities(options, env, outputIsTTY), pendingGraphics = /* @__PURE__ */ new Map(), pendingGraphicClears = /* @__PURE__ */ new Set(), activeGraphics = /* @__PURE__ */ new Map(), pendingGraphicSignatures = /* @__PURE__ */ new Map(), activeGraphicSignatures = /* @__PURE__ */ new Map(), retainedGraphics = /* @__PURE__ */ new Map(), knownKittyImageIds = /* @__PURE__ */ new Set(), terminalResizeDirtyGraphics = /* @__PURE__ */ new Set(), nextGraphicsOrder = 0, terminalGraphicsFlushTimer = null, hasPendingTerminalGraphics = () => pendingGraphics.size > 0 || pendingGraphicClears.size > 0;
|
|
7974
7983
|
function canUseTerminalGraphicsProtocol(protocol, capabilities) {
|
|
7975
7984
|
return capabilities.supported && isTerminalGraphicsProtocol(protocol) && protocol === capabilities.preferredProtocol;
|
|
7976
7985
|
}
|
|
@@ -7999,7 +8008,8 @@ function createStdoutRenderer(terminal, options) {
|
|
|
7999
8008
|
payload.h ?? "",
|
|
8000
8009
|
hashTerminalGraphicsString(payload.sequence),
|
|
8001
8010
|
hashTerminalGraphicsString(payload.resizeSequence ?? ""),
|
|
8002
|
-
hashTerminalGraphicsString(payload.clearSequence ?? "")
|
|
8011
|
+
hashTerminalGraphicsString(payload.clearSequence ?? ""),
|
|
8012
|
+
payload.allowTextOverlay ? "1" : "0"
|
|
8003
8013
|
].join(":");
|
|
8004
8014
|
}
|
|
8005
8015
|
function kittyClearSequenceKeepsImageData(sequence) {
|
|
@@ -8046,6 +8056,24 @@ function createStdoutRenderer(terminal, options) {
|
|
|
8046
8056
|
let imageId = controls.get("i"), placementId = controls.get("p");
|
|
8047
8057
|
return controls.get("a") !== "p" || !imageId || !placementId || imageId === "0" || placementId === "0" ? null : `${imageId}:${placementId}`;
|
|
8048
8058
|
}
|
|
8059
|
+
function kittyImageId(sequence) {
|
|
8060
|
+
if (!sequence)
|
|
8061
|
+
return null;
|
|
8062
|
+
let start = sequence.indexOf("\x1B_G");
|
|
8063
|
+
if (start < 0)
|
|
8064
|
+
return null;
|
|
8065
|
+
let end = sequence.indexOf("\x1B\\", start + 3);
|
|
8066
|
+
if (end < 0)
|
|
8067
|
+
return null;
|
|
8068
|
+
let body = sequence.slice(start + 3, end), controlsRaw = body.slice(0, body.indexOf(";") < 0 ? body.length : body.indexOf(";"));
|
|
8069
|
+
for (let part of controlsRaw.split(",")) {
|
|
8070
|
+
if (!part.startsWith("i="))
|
|
8071
|
+
continue;
|
|
8072
|
+
let imageId = Number(part.slice(2));
|
|
8073
|
+
return Number.isInteger(imageId) && imageId > 0 ? imageId : null;
|
|
8074
|
+
}
|
|
8075
|
+
return null;
|
|
8076
|
+
}
|
|
8049
8077
|
function canReplaceKittyPlacementWithoutClear(previous, payload) {
|
|
8050
8078
|
if (payload.terminalResizeRedraw || !payload.resizeRedraw || previous.protocol !== "kitty" || payload.protocol !== "kitty")
|
|
8051
8079
|
return !1;
|
|
@@ -8057,14 +8085,14 @@ function createStdoutRenderer(terminal, options) {
|
|
|
8057
8085
|
h: payload.h ?? previous.h
|
|
8058
8086
|
})) : !1;
|
|
8059
8087
|
}
|
|
8060
|
-
function queueTerminalGraphicClear(id) {
|
|
8088
|
+
function queueTerminalGraphicClear(id, options2 = {}) {
|
|
8061
8089
|
if (disposed)
|
|
8062
8090
|
return !1;
|
|
8063
8091
|
let removedPendingDraw = pendingGraphics.delete(`${id}:draw`);
|
|
8064
8092
|
pendingGraphicSignatures.delete(id), terminalResizeDirtyGraphics.delete(id);
|
|
8065
8093
|
let active = activeGraphics.get(id);
|
|
8066
8094
|
if (!active)
|
|
8067
|
-
return retainedGraphics.delete(id), removedPendingDraw;
|
|
8095
|
+
return options2.retainOnClear || retainedGraphics.delete(id), removedPendingDraw;
|
|
8068
8096
|
if (active.clearSequence) {
|
|
8069
8097
|
let payload = {
|
|
8070
8098
|
id,
|
|
@@ -8074,6 +8102,7 @@ function createStdoutRenderer(terminal, options) {
|
|
|
8074
8102
|
h: active.h,
|
|
8075
8103
|
protocol: active.protocol,
|
|
8076
8104
|
sequence: active.clearSequence,
|
|
8105
|
+
retainOnClear: options2.retainOnClear,
|
|
8077
8106
|
op: "clear",
|
|
8078
8107
|
order: nextGraphicsOrder++
|
|
8079
8108
|
};
|
|
@@ -8082,6 +8111,60 @@ function createStdoutRenderer(terminal, options) {
|
|
|
8082
8111
|
}
|
|
8083
8112
|
return pendingGraphicClears.add(id), recordTerminalGraphicTrace({ type: "clear", id }), requestTerminalGraphicsFlush(), !0;
|
|
8084
8113
|
}
|
|
8114
|
+
function clearAllTerminalGraphics() {
|
|
8115
|
+
if (disposed || graphicsCapabilities.preferredProtocol !== "kitty")
|
|
8116
|
+
return !1;
|
|
8117
|
+
let imageIds = new Set(knownKittyImageIds), needsVisibleFallback = !1, rememberImageId = (...sequences) => {
|
|
8118
|
+
for (let sequence of sequences) {
|
|
8119
|
+
let imageId = kittyImageId(sequence);
|
|
8120
|
+
if (imageId != null) {
|
|
8121
|
+
imageIds.add(imageId);
|
|
8122
|
+
return;
|
|
8123
|
+
}
|
|
8124
|
+
}
|
|
8125
|
+
needsVisibleFallback = !0;
|
|
8126
|
+
};
|
|
8127
|
+
for (let active of activeGraphics.values())
|
|
8128
|
+
rememberImageId(active.sequence, active.resizeSequence, active.clearSequence);
|
|
8129
|
+
for (let retained of retainedGraphics.values())
|
|
8130
|
+
rememberImageId(
|
|
8131
|
+
retained.active.sequence,
|
|
8132
|
+
retained.active.resizeSequence,
|
|
8133
|
+
retained.active.clearSequence
|
|
8134
|
+
);
|
|
8135
|
+
for (let payload of pendingGraphics.values())
|
|
8136
|
+
rememberImageId(payload.sequence, payload.resizeSequence, payload.clearSequence);
|
|
8137
|
+
pendingGraphics.clear(), pendingGraphicClears.clear(), activeGraphics.clear(), pendingGraphicSignatures.clear(), activeGraphicSignatures.clear(), retainedGraphics.clear(), knownKittyImageIds.clear(), terminalResizeDirtyGraphics.clear();
|
|
8138
|
+
for (let imageId of imageIds) {
|
|
8139
|
+
let payload = {
|
|
8140
|
+
id: `__terminal_graphics_clear_image_${imageId}__`,
|
|
8141
|
+
x: 0,
|
|
8142
|
+
y: 0,
|
|
8143
|
+
w: 1,
|
|
8144
|
+
h: 1,
|
|
8145
|
+
protocol: "kitty",
|
|
8146
|
+
sequence: createKittyDeleteGraphicsSequence({ imageId, freeImageData: !0 }),
|
|
8147
|
+
op: "clear",
|
|
8148
|
+
order: nextGraphicsOrder++
|
|
8149
|
+
};
|
|
8150
|
+
validateTerminalGraphicsPayload(payload, graphicsCapabilities) && pendingGraphics.set(`${payload.id}:clear`, payload);
|
|
8151
|
+
}
|
|
8152
|
+
if (needsVisibleFallback) {
|
|
8153
|
+
let payload = {
|
|
8154
|
+
id: "__terminal_graphics_clear_visible__",
|
|
8155
|
+
x: 0,
|
|
8156
|
+
y: 0,
|
|
8157
|
+
w: 1,
|
|
8158
|
+
h: 1,
|
|
8159
|
+
protocol: "kitty",
|
|
8160
|
+
sequence: createKittyDeleteGraphicsSequence({ allVisible: !0, freeImageData: !0 }),
|
|
8161
|
+
op: "clear",
|
|
8162
|
+
order: nextGraphicsOrder++
|
|
8163
|
+
};
|
|
8164
|
+
validateTerminalGraphicsPayload(payload, graphicsCapabilities) && pendingGraphics.set(`${payload.id}:clear`, payload);
|
|
8165
|
+
}
|
|
8166
|
+
return pendingGraphics.size === 0 ? !1 : (requestTerminalGraphicsFlush(), !0);
|
|
8167
|
+
}
|
|
8085
8168
|
function queueTerminalGraphicsForResizeRedraw(size) {
|
|
8086
8169
|
isDebugEnabled() && getDebugLog().render(
|
|
8087
8170
|
`graphics resize redraw queue: size=${size.cols}x${size.rows}, activeGraphics=${activeGraphics.size}, pendingGraphics=${pendingGraphics.size}, pendingClears=${pendingGraphicClears.size}`
|
|
@@ -8095,7 +8178,7 @@ function createStdoutRenderer(terminal, options) {
|
|
|
8095
8178
|
);
|
|
8096
8179
|
continue;
|
|
8097
8180
|
}
|
|
8098
|
-
let signature = activeGraphicSignatures.get(id), sequence = active.
|
|
8181
|
+
let signature = activeGraphicSignatures.get(id), sequence = active.sequence;
|
|
8099
8182
|
pendingGraphics.set(`${id}:draw`, {
|
|
8100
8183
|
id,
|
|
8101
8184
|
x: active.x,
|
|
@@ -8106,6 +8189,7 @@ function createStdoutRenderer(terminal, options) {
|
|
|
8106
8189
|
sequence,
|
|
8107
8190
|
resizeSequence: active.resizeSequence,
|
|
8108
8191
|
clearSequence: active.clearSequence,
|
|
8192
|
+
allowTextOverlay: active.allowTextOverlay,
|
|
8109
8193
|
op: "draw",
|
|
8110
8194
|
order: nextGraphicsOrder++,
|
|
8111
8195
|
resizeRedraw: !0,
|
|
@@ -8125,9 +8209,10 @@ function createStdoutRenderer(terminal, options) {
|
|
|
8125
8209
|
w: active.w,
|
|
8126
8210
|
h: active.h,
|
|
8127
8211
|
protocol: active.protocol,
|
|
8128
|
-
sequence: active.
|
|
8212
|
+
sequence: active.sequence,
|
|
8129
8213
|
resizeSequence: active.resizeSequence,
|
|
8130
8214
|
clearSequence: active.clearSequence,
|
|
8215
|
+
allowTextOverlay: active.allowTextOverlay,
|
|
8131
8216
|
op: "draw",
|
|
8132
8217
|
order: nextGraphicsOrder++,
|
|
8133
8218
|
resizeRedraw: !0,
|
|
@@ -8167,7 +8252,8 @@ function createStdoutRenderer(terminal, options) {
|
|
|
8167
8252
|
});
|
|
8168
8253
|
if (!frame)
|
|
8169
8254
|
return !1;
|
|
8170
|
-
|
|
8255
|
+
let imageId = kittyImageId(frame.sequence) ?? kittyImageId(normalized.resizeSequence);
|
|
8256
|
+
if (imageId != null && knownKittyImageIds.add(imageId), isDebugEnabled()) {
|
|
8171
8257
|
let size = terminal.size();
|
|
8172
8258
|
getDebugLog().render(
|
|
8173
8259
|
`terminal graphic queue draw request: id=${frame.id}, x=${normalized.x}, y=${normalized.y}, w=${frame.width}, h=${frame.height}, viewport=${size.cols}x${size.rows}`
|
|
@@ -8183,7 +8269,7 @@ function createStdoutRenderer(terminal, options) {
|
|
|
8183
8269
|
`terminal graphic queue draw rejected offscreen: id=${frame.id}, x=${normalized.x}, y=${normalized.y}, w=${frame.width}, h=${frame.height}, viewport=${size.cols}x${size.rows}`
|
|
8184
8270
|
);
|
|
8185
8271
|
}
|
|
8186
|
-
return queueTerminalGraphicClear(frame.id), !1;
|
|
8272
|
+
return queueTerminalGraphicClear(frame.id, { retainOnClear: normalized.retainOnClear }), !1;
|
|
8187
8273
|
}
|
|
8188
8274
|
let clearSequence = normalized.clearSequence && isSafeTerminalGraphicsSequence(normalized.clearSequence, normalized.protocol, "clear") ? normalized.clearSequence : void 0, resizeSequence = normalized.resizeSequence && isSafeTerminalGraphicsSequence(normalized.resizeSequence, normalized.protocol, "draw") ? normalized.resizeSequence : void 0, signature = terminalGraphicsPayloadSignature({
|
|
8189
8275
|
...normalized,
|
|
@@ -8210,7 +8296,7 @@ function createStdoutRenderer(terminal, options) {
|
|
|
8210
8296
|
}), isDebugEnabled() && getDebugLog().render(
|
|
8211
8297
|
`terminal graphic queue draw canceled clear: id=${frame.id}, x=${normalized.x}, y=${normalized.y}, w=${frame.width}, h=${frame.height}`
|
|
8212
8298
|
), !0;
|
|
8213
|
-
let
|
|
8299
|
+
let active = activeGraphics.get(frame.id), activeCanReplacePlacement = active && active.sequence === frame.sequence && resizeSequence && canReplaceKittyPlacementWithoutClear(active, {
|
|
8214
8300
|
...normalized,
|
|
8215
8301
|
id: frame.id,
|
|
8216
8302
|
w: frame.width,
|
|
@@ -8222,7 +8308,25 @@ function createStdoutRenderer(terminal, options) {
|
|
|
8222
8308
|
resizeRedraw: !0,
|
|
8223
8309
|
placementMoveWithoutClear: !0
|
|
8224
8310
|
});
|
|
8225
|
-
|
|
8311
|
+
if (!forceTerminalResizeRedraw && !normalized.forceDraw && !normalized.resizeRedraw && activeCanReplacePlacement && resizeSequence)
|
|
8312
|
+
return pendingGraphics.set(`${frame.id}:draw`, {
|
|
8313
|
+
...normalized,
|
|
8314
|
+
id: frame.id,
|
|
8315
|
+
w: frame.width,
|
|
8316
|
+
h: frame.height,
|
|
8317
|
+
sequence: resizeSequence,
|
|
8318
|
+
resizeSequence,
|
|
8319
|
+
clearSequence,
|
|
8320
|
+
fallbackText: frame.fallbackText,
|
|
8321
|
+
resizeRedraw: !0,
|
|
8322
|
+
placementMoveWithoutClear: !1
|
|
8323
|
+
}), pendingGraphicSignatures.set(frame.id, signature), recordTerminalGraphicTrace({
|
|
8324
|
+
type: "queue",
|
|
8325
|
+
id: frame.id,
|
|
8326
|
+
protocol: normalized.protocol,
|
|
8327
|
+
bytes: resizeSequence.length
|
|
8328
|
+
}), requestTerminalGraphicsFlush(!!normalized.deferFlush), !0;
|
|
8329
|
+
let retained = retainedGraphics.get(frame.id), retainedCanReplacePlacement = retained && retained.active.sequence === frame.sequence && resizeSequence && canReplaceKittyPlacementWithoutClear(retained.active, {
|
|
8226
8330
|
...normalized,
|
|
8227
8331
|
id: frame.id,
|
|
8228
8332
|
w: frame.width,
|
|
@@ -8232,7 +8336,19 @@ function createStdoutRenderer(terminal, options) {
|
|
|
8232
8336
|
clearSequence,
|
|
8233
8337
|
fallbackText: frame.fallbackText,
|
|
8234
8338
|
resizeRedraw: !0,
|
|
8235
|
-
placementMoveWithoutClear: !0
|
|
8339
|
+
placementMoveWithoutClear: !0
|
|
8340
|
+
});
|
|
8341
|
+
return !canceledPendingClear && retained && resizeSequence && (retained.signature === signature || retainedCanReplacePlacement) ? (activeGraphics.set(frame.id, retained.active), activeGraphicSignatures.set(frame.id, retained.signature), retainedGraphics.delete(frame.id), pendingGraphics.set(`${frame.id}:draw`, {
|
|
8342
|
+
...normalized,
|
|
8343
|
+
id: frame.id,
|
|
8344
|
+
w: frame.width,
|
|
8345
|
+
h: frame.height,
|
|
8346
|
+
sequence: forceTerminalResizeRedraw ? frame.sequence : resizeSequence,
|
|
8347
|
+
resizeSequence,
|
|
8348
|
+
clearSequence,
|
|
8349
|
+
fallbackText: frame.fallbackText,
|
|
8350
|
+
resizeRedraw: !0,
|
|
8351
|
+
placementMoveWithoutClear: !1,
|
|
8236
8352
|
terminalResizeRedraw: forceTerminalResizeRedraw
|
|
8237
8353
|
}), pendingGraphicSignatures.set(frame.id, signature), isDebugEnabled() && getDebugLog().render(
|
|
8238
8354
|
`terminal graphic retained resize redraw: id=${frame.id}, x=${retained.active.x}, y=${retained.active.y}, w=${retained.active.w}, h=${retained.active.h}, bytes=${resizeSequence.length}`
|
|
@@ -8274,6 +8390,9 @@ function createStdoutRenderer(terminal, options) {
|
|
|
8274
8390
|
},
|
|
8275
8391
|
clear(id) {
|
|
8276
8392
|
return queueTerminalGraphicClear(id);
|
|
8393
|
+
},
|
|
8394
|
+
clearAll() {
|
|
8395
|
+
return clearAllTerminalGraphics();
|
|
8277
8396
|
}
|
|
8278
8397
|
}), MIN_FRAME_MS = outputIsTTY ? 16 : 0, ROWS_ONLY_RESIZE_REPAINT_DELAY_MS = 500;
|
|
8279
8398
|
function clampCellToViewport(cell, size) {
|
|
@@ -9057,12 +9176,13 @@ function createStdoutRenderer(terminal, options) {
|
|
|
9057
9176
|
sequence: active.sequence,
|
|
9058
9177
|
resizeSequence: active.resizeSequence,
|
|
9059
9178
|
clearSequence: active.clearSequence,
|
|
9179
|
+
allowTextOverlay: active.allowTextOverlay,
|
|
9060
9180
|
op: "draw",
|
|
9061
9181
|
order: nextGraphicsOrder++
|
|
9062
9182
|
}), signature && pendingGraphicSignatures.set(id, signature), pendingGraphicIds.add(id);
|
|
9063
9183
|
}
|
|
9064
9184
|
for (let [id, active] of activeGraphics)
|
|
9065
|
-
explicitGraphicClears.has(id) || pendingGraphicIds.has(id) || intersectsScrollOperations(active) || addTerminalGraphicTextPreserveSpans(active);
|
|
9185
|
+
explicitGraphicClears.has(id) || pendingGraphicIds.has(id) || intersectsScrollOperations(active) || active.allowTextOverlay || addTerminalGraphicTextPreserveSpans(active);
|
|
9066
9186
|
if (normalizedScrollOperations != null && normalizedScrollOperations.length && activeGraphics.size > 0)
|
|
9067
9187
|
for (let active of activeGraphics.values())
|
|
9068
9188
|
intersectsScrollOperations(active) && (terminalGraphicsBlockScrollRegions = !0, addTerminalGraphicRows(active));
|
|
@@ -9571,17 +9691,6 @@ function createStdoutRenderer(terminal, options) {
|
|
|
9571
9691
|
(!rowsToRender || rowWasPaintedByTextRenderer(y)) && !preservedGraphicSpan || (out2 += `\x1B[${y + 1};${rect.x + 1}H${clearStyle}${erase}${SGR_RESET}`);
|
|
9572
9692
|
}
|
|
9573
9693
|
return out2;
|
|
9574
|
-
}, clearGraphicRowBackgroundForRowsNotPainted = (rect) => {
|
|
9575
|
-
if (scrollHandled)
|
|
9576
|
-
return "";
|
|
9577
|
-
let clearStyle = bgSeq, out2 = "", leftW = Math.max(0, Math.min(size.cols, rect.x)), rightX = Math.max(0, Math.min(size.cols, rect.x + rect.w)), rightW = Math.max(0, size.cols - rightX);
|
|
9578
|
-
if (leftW <= 0 && rightW <= 0)
|
|
9579
|
-
return "";
|
|
9580
|
-
for (let row = 0; row < rect.h; row++) {
|
|
9581
|
-
let y = rect.y + row;
|
|
9582
|
-
!rowsToRender || rowWasPaintedByTextRenderer(y) || (leftW > 0 && (out2 += `\x1B[${y + 1};1H${clearStyle}\x1B[${leftW}X${SGR_RESET}`), rightW > 0 && (out2 += `\x1B[${y + 1};${rightX + 1}H${clearStyle}\x1B[${rightW}X${SGR_RESET}`));
|
|
9583
|
-
}
|
|
9584
|
-
return out2;
|
|
9585
9694
|
}, commitTerminalGraphicsState = null, restoreTerminalGraphicsAfterWriteFailure = null, terminalGraphicsMetrics = null;
|
|
9586
9695
|
if ((() => {
|
|
9587
9696
|
let seenEntries = new Set(graphicsEntriesToRender.map(([key]) => key)), changed = !1;
|
|
@@ -9684,7 +9793,7 @@ function createStdoutRenderer(terminal, options) {
|
|
|
9684
9793
|
terminalResizeDirtyGraphics.delete(payload.id), nextPendingGraphicSignatures.delete(payload.id);
|
|
9685
9794
|
continue;
|
|
9686
9795
|
}
|
|
9687
|
-
let previousSignature = previous ? nextActiveGraphicSignatures.get(payload.id) : void 0, nextSignature = nextPendingGraphicSignatures.get(payload.id) ?? terminalGraphicsPayloadSignature(payload), canReplacePlacement = previous != null && payload.resizeRedraw && canReplaceKittyPlacementWithoutClear(previous, payload), resizeRedrawNeedsClear = previous && (payload.resizeRedraw || payload.terminalResizeRedraw) && !!previous.clearSequence && !canReplacePlacement;
|
|
9796
|
+
let previousSignature = previous ? nextActiveGraphicSignatures.get(payload.id) : void 0, nextSignature = nextPendingGraphicSignatures.get(payload.id) ?? terminalGraphicsPayloadSignature(payload), canReplacePlacement = previous != null && payload.resizeRedraw && canReplaceKittyPlacementWithoutClear(previous, payload), terminalResizePlacementOnly = previous != null && payload.terminalResizeRedraw && payload.resizeSequence != null && previous.sequence === payload.sequence, resizeRedrawNeedsClear = previous && (payload.resizeRedraw || payload.terminalResizeRedraw) && !!previous.clearSequence && !canReplacePlacement;
|
|
9688
9797
|
if (previous && (!canReplacePlacement && (previousSignature !== nextSignature || !sameGraphicRect(previous, rect)) || resizeRedrawNeedsClear)) {
|
|
9689
9798
|
let visiblePrevious = clipGraphicRectToViewport(previous, size), wroteClear = !1;
|
|
9690
9799
|
if (visiblePrevious) {
|
|
@@ -9697,19 +9806,19 @@ function createStdoutRenderer(terminal, options) {
|
|
|
9697
9806
|
isDebugEnabled() && getDebugLog().render(
|
|
9698
9807
|
`terminal graphic render draw: id=${payload.id}, x=${rect.x}, y=${rect.y}, w=${rect.w}, h=${rect.h}, visible=${visibleRect ? `${visibleRect.x},${visibleRect.y},${visibleRect.w},${visibleRect.h}` : "none"}, resizeRedraw=${payload.resizeRedraw || payload.terminalResizeRedraw ? "true" : "false"}, previous=${previous ? `${previous.x},${previous.y},${previous.w},${previous.h}` : "none"}`
|
|
9699
9808
|
);
|
|
9700
|
-
let clearRect2 = visibleRect ? clearGraphicRectForRowsNotPainted(visibleRect) : "",
|
|
9809
|
+
let clearRect2 = visibleRect ? clearGraphicRectForRowsNotPainted(visibleRect) : "", cursor = `\x1B[${rect.y + 1};${rect.x + 1}H`, sequencePayload = (canReplacePlacement || terminalResizePlacementOnly) && payload.resizeSequence ? payload.resizeSequence : payload.sequence, sequence = maybeWrapTerminalGraphic(sequencePayload);
|
|
9701
9810
|
frameParts.push(
|
|
9702
9811
|
countGraphicsBytes(cursor),
|
|
9703
9812
|
countGraphicsBytes(sequence),
|
|
9704
9813
|
countGraphicsBytes(SGR_RESET),
|
|
9705
|
-
clearRowBackground ? countGraphicsBytes(clearRowBackground) : "",
|
|
9706
9814
|
clearRect2 ? countGraphicsBytes(clearRect2) : ""
|
|
9707
9815
|
), terminalGraphicsDraws++, nextActiveGraphics.set(payload.id, {
|
|
9708
9816
|
...rect,
|
|
9709
9817
|
protocol: payload.protocol,
|
|
9710
|
-
sequence: payload.sequence,
|
|
9818
|
+
sequence: previous && (canReplacePlacement || terminalResizePlacementOnly) ? previous.sequence : payload.sequence,
|
|
9711
9819
|
resizeSequence: payload.resizeSequence ?? (previous == null ? void 0 : previous.resizeSequence),
|
|
9712
|
-
clearSequence: payload.clearSequence
|
|
9820
|
+
clearSequence: payload.clearSequence,
|
|
9821
|
+
allowTextOverlay: payload.allowTextOverlay ?? (previous == null ? void 0 : previous.allowTextOverlay)
|
|
9713
9822
|
}), nextActiveGraphicSignatures.set(payload.id, nextSignature), nextPendingGraphicSignatures.delete(payload.id), terminalResizeDirtyGraphics.delete(payload.id);
|
|
9714
9823
|
}
|
|
9715
9824
|
allowGraphicsOnlyWithoutBaseline && frameParts.push(CURSOR_RESTORE), restoreTerminalGraphicsAfterWriteFailure = () => {
|
|
@@ -10126,7 +10235,7 @@ function createStdoutRenderer(terminal, options) {
|
|
|
10126
10235
|
return;
|
|
10127
10236
|
disposed = !0;
|
|
10128
10237
|
let disposeError = null;
|
|
10129
|
-
renderTimer && (clearTimeout(renderTimer), renderTimer = null), terminalGraphicsFlushTimer && (clearTimeout(terminalGraphicsFlushTimer), terminalGraphicsFlushTimer = null), clearRowsOnlyResizeRepaintTimer(), accumulatedAllRows = !1, accumulatedDirtyBits = null, accumulatedDirtyCount = 0, accumulatedDirtyMin = Number.POSITIVE_INFINITY, accumulatedDirtyMax = -1, accumulatedDirtyRowsRequireRepaint = !1, pendingGraphics.clear(), pendingGraphicClears.clear(), pendingGraphicSignatures.clear(), retainedGraphics.clear(), terminalResizeDirtyGraphics.clear();
|
|
10238
|
+
renderTimer && (clearTimeout(renderTimer), renderTimer = null), terminalGraphicsFlushTimer && (clearTimeout(terminalGraphicsFlushTimer), terminalGraphicsFlushTimer = null), clearRowsOnlyResizeRepaintTimer(), accumulatedAllRows = !1, accumulatedDirtyBits = null, accumulatedDirtyCount = 0, accumulatedDirtyMin = Number.POSITIVE_INFINITY, accumulatedDirtyMax = -1, accumulatedDirtyRowsRequireRepaint = !1, pendingGraphics.clear(), pendingGraphicClears.clear(), pendingGraphicSignatures.clear(), retainedGraphics.clear(), knownKittyImageIds.clear(), terminalResizeDirtyGraphics.clear();
|
|
10130
10239
|
try {
|
|
10131
10240
|
if (activeGraphics.size > 0) {
|
|
10132
10241
|
let size = terminal.size(), clearParts = [], terminalGraphicsClears = 0;
|
package/dist/cli.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ export type { FsDirEntry, FsEntryKind, FsStat, PathPickerProvider, } from "./cli
|
|
|
5
5
|
export { createNodePathPickerProvider } from "./cli/path-provider.js";
|
|
6
6
|
export { type PathPickMode, type PathSuggestion, resolveUserPath, suggestPaths, type SuggestPathsResult, } from "./cli/path-suggest.js";
|
|
7
7
|
export { readEventLog, writeEventLog, writeSnapshot } from "./cli/recording.js";
|
|
8
|
-
export type { CreateTerminalAppOptions, TerminalApp } from "./create-terminal-app.js";
|
|
8
|
+
export type { CreateTerminalAppOptions, TerminalApp, TerminalSelectionContext, } from "./create-terminal-app.js";
|
|
9
9
|
export { createTerminalApp } from "./create-terminal-app.js";
|
|
10
10
|
export type { CliEventManager } from "./events/manager/cli-event-manager.js";
|
|
11
11
|
export { createCliEventManager } from "./events/manager/cli-event-manager.js";
|
package/dist/cli.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type { FsDirEntry, FsEntryKind, FsStat, PathPickerProvider, } from "./cli
|
|
|
5
5
|
export { createNodePathPickerProvider } from "./cli/path-provider.js";
|
|
6
6
|
export { type PathPickMode, type PathSuggestion, resolveUserPath, suggestPaths, type SuggestPathsResult, } from "./cli/path-suggest.js";
|
|
7
7
|
export { readEventLog, writeEventLog, writeSnapshot } from "./cli/recording.js";
|
|
8
|
-
export type { CreateTerminalAppOptions, TerminalApp } from "./create-terminal-app.js";
|
|
8
|
+
export type { CreateTerminalAppOptions, TerminalApp, TerminalSelectionContext, } from "./create-terminal-app.js";
|
|
9
9
|
export { createTerminalApp } from "./create-terminal-app.js";
|
|
10
10
|
export type { CliEventManager } from "./events/manager/cli-event-manager.js";
|
|
11
11
|
export { createCliEventManager } from "./events/manager/cli-event-manager.js";
|