@heyhuynhgiabuu/pi-pretty 0.9.0 → 0.10.1
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/CHANGELOG.md +35 -0
- package/README.md +3 -0
- package/dist/claude-style.d.ts +2 -0
- package/dist/claude-style.d.ts.map +1 -1
- package/dist/claude-style.js +162 -22
- package/dist/claude-style.js.map +1 -1
- package/dist/config.d.ts +8 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +11 -0
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/prompt-editor.d.ts.map +1 -1
- package/dist/prompt-editor.js +2 -1
- package/dist/prompt-editor.js.map +1 -1
- package/dist/render.d.ts +3 -2
- package/dist/render.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/claude-style.ts +185 -20
- package/src/config.ts +17 -0
- package/src/index.ts +4 -0
- package/src/prompt-editor.ts +2 -1
- package/dist/collapsed-hint.d.ts +0 -7
- package/dist/collapsed-hint.d.ts.map +0 -1
- package/dist/collapsed-hint.js +0 -17
- package/dist/collapsed-hint.js.map +0 -1
- package/dist/expand.d.ts +0 -7
- package/dist/expand.d.ts.map +0 -1
- package/dist/expand.js +0 -11
- package/dist/expand.js.map +0 -1
- package/dist/image.d.ts +0 -24
- package/dist/image.d.ts.map +0 -1
- package/dist/image.js +0 -144
- package/dist/image.js.map +0 -1
package/src/claude-style.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { highlightCode, keyText } from "@earendil-works/pi-coding-agent";
|
|
16
|
-
import { Container, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
16
|
+
import { Container, Text, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
17
17
|
import { BG_BASE, BG_ERROR, resolveBaseBackground } from "./config.js";
|
|
18
18
|
import { ELAPSED_KEY, shortPath } from "./helpers.js";
|
|
19
19
|
import { fillToolBackground, preserveBoxBackground } from "./render.js";
|
|
@@ -23,6 +23,30 @@ type AnyFn = (...args: any[]) => any;
|
|
|
23
23
|
type AnyComponent = { render(width: number): string[]; invalidate?(): void; [key: string]: any };
|
|
24
24
|
|
|
25
25
|
const ANSI_RE = new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*m`, "g");
|
|
26
|
+
// Escape-sequence stripping, ported from the host's `utils/ansi.js` (via ansi-regex / strip-ansi,
|
|
27
|
+
// MIT). Not importable: that package exports only "." and "./rpc-entry". pi-tui's
|
|
28
|
+
// `stripTerminalSequences` is not a substitute — it scans to the first m/G/K/H/J, so on
|
|
29
|
+
// "keep ESC[?25l me" it eats the text between, and it misses C1 (\u009b) entirely. A private
|
|
30
|
+
// prefix (<, =, >) is accepted only right after a real CSI introducer, so ESC[<35;59;1M strips
|
|
31
|
+
// whole while ESC = does not swallow the digits that follow.
|
|
32
|
+
const ANSI_ST = `(?:${String.fromCharCode(7)}|\\u001B\\\\|\\u009C)`;
|
|
33
|
+
const ANSI_OSC_START = "\\u001B\\]";
|
|
34
|
+
const ANSI_CSI_START = "(?:(?:\\u001B\\[|\\u009B)[<=>]|[\\u001B\\u009B][[\\]()#;?]*)(?:\\d{1,4}(?:[;:]\\d{0,4})*)?";
|
|
35
|
+
const ANSI_CSI_FINAL = "[\\dA-PR-TZcf-nq-uy=><~]";
|
|
36
|
+
const ANSI_SEQUENCE_RE = new RegExp(
|
|
37
|
+
`(?:${ANSI_OSC_START}[\\s\\S]*?${ANSI_ST})|${ANSI_CSI_START}${ANSI_CSI_FINAL}`,
|
|
38
|
+
"g",
|
|
39
|
+
);
|
|
40
|
+
/** C0/C1 controls and the interlinear-annotation block, built from char codes because a literal
|
|
41
|
+
* control character in a regex is flagged by the linter. Tab and newline are absent: both are
|
|
42
|
+
* layout the host keeps, and `Text` turns each tab into three spaces. */
|
|
43
|
+
const CONTROL_CHARS_RE = new RegExp(
|
|
44
|
+
`[${String.fromCharCode(0)}-${String.fromCharCode(8)}${String.fromCharCode(11)}${String.fromCharCode(12)}` +
|
|
45
|
+
`${String.fromCharCode(14)}-${String.fromCharCode(31)}${String.fromCharCode(127)}-${String.fromCharCode(159)}` +
|
|
46
|
+
`${String.fromCharCode(0xfff9)}-${String.fromCharCode(0xfffb)}]`,
|
|
47
|
+
"g",
|
|
48
|
+
);
|
|
49
|
+
|
|
26
50
|
// Kitty (`ESC _G`) and iTerm2 (`ESC ]1337;File=`) inline-image payload lines.
|
|
27
51
|
const IMAGE_LINE_RE = new RegExp(`${String.fromCharCode(27)}(?:_G|\\]1337;File=)`);
|
|
28
52
|
const isImageLine = (line: string): boolean => IMAGE_LINE_RE.test(line);
|
|
@@ -173,6 +197,22 @@ function resultText(result: any): string {
|
|
|
173
197
|
.join("\n");
|
|
174
198
|
}
|
|
175
199
|
|
|
200
|
+
/** Sanitized body text for a tool with no renderer of its own.
|
|
201
|
+
*
|
|
202
|
+
* Per block, like the host: joining first lets an unterminated escape in one block swallow the
|
|
203
|
+
* text of the next. With blocks `["keep ESC]title", "visible BEL after"]` the join-first order
|
|
204
|
+
* loses "visible", because the unterminated OSC then runs on to the BEL. */
|
|
205
|
+
function sanitizedBodyText(result: any): string {
|
|
206
|
+
return ((result?.content ?? []) as Array<{ type?: string; text?: string }>)
|
|
207
|
+
.filter((block) => block.type === "text")
|
|
208
|
+
.map((block) =>
|
|
209
|
+
// Host order: strip ANSI, then binary controls, then CR. Removing CR first would let
|
|
210
|
+
// "a ESC CR [31m b" read as a complete SGR and lose "[31m" from the text.
|
|
211
|
+
(block.text ?? "").replace(ANSI_SEQUENCE_RE, "").replace(CONTROL_CHARS_RE, "").replace(/\r/g, ""),
|
|
212
|
+
)
|
|
213
|
+
.join("\n");
|
|
214
|
+
}
|
|
215
|
+
|
|
176
216
|
function countLines(text: string, skip?: RegExp): number {
|
|
177
217
|
return text.split("\n").filter((line) => line.trim() !== "" && !(skip && skip.test(line.trim()))).length;
|
|
178
218
|
}
|
|
@@ -321,6 +361,19 @@ function fitLine(line: string, width: number, theme: ThemeLike): string {
|
|
|
321
361
|
return visibleWidth(line) > width ? truncateToWidth(line, width, theme.fg("dim", "…")) : line;
|
|
322
362
|
}
|
|
323
363
|
|
|
364
|
+
/** Paint a delegated expanded body. The claudecode shell is "self", so the host draws no box: a
|
|
365
|
+
* tool whose original renderer emits plain or foreground-only rows would otherwise float on the
|
|
366
|
+
* terminal's own background. Tools that paint their own rows keep them untouched. */
|
|
367
|
+
function paintedBody(component: AnyComponent, bg: string): AnyComponent {
|
|
368
|
+
return {
|
|
369
|
+
render: (width: number) =>
|
|
370
|
+
(component.render(Math.max(1, width)) as string[]).map((line) =>
|
|
371
|
+
isImageLine(line) ? line : fillToolBackground(line, bg, width, ""),
|
|
372
|
+
),
|
|
373
|
+
invalidate: () => component.invalidate?.(),
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
|
|
324
377
|
function buildCallRow(
|
|
325
378
|
theme: ThemeLike,
|
|
326
379
|
ctx: RenderCtxLike,
|
|
@@ -338,12 +391,12 @@ function buildCallRow(
|
|
|
338
391
|
const body = detail ? ` ${theme.fg("dim", "(")}${theme.fg("muted", detail)}${theme.fg("dim", ")")}` : "";
|
|
339
392
|
const indent = `${indentOf(ctx)} `;
|
|
340
393
|
const title = fitLine(`${head}${body}${hint}`, width, theme);
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
];
|
|
394
|
+
// Fill after truncating: truncateToWidth counts background sequences as visible width.
|
|
395
|
+
// An empty indent pads the row to the render width, so the colour reaches the edge.
|
|
396
|
+
// The body is painted too: this shell is "self", so the host draws no box and every row it
|
|
397
|
+
// leaves unpainted shows the terminal's own background (a codemode script reads as a hole).
|
|
398
|
+
const painted = (line: string): string => fillToolBackground(line, bg, width, "");
|
|
399
|
+
return [painted(title), ...bodyLines.map((line) => painted(fitLine(`${indent}${line}`, width, theme)))];
|
|
347
400
|
});
|
|
348
401
|
}
|
|
349
402
|
|
|
@@ -369,8 +422,14 @@ type CallBody = (args: Record<string, unknown>) => string[];
|
|
|
369
422
|
const codemodeSource: CallBody = (args) =>
|
|
370
423
|
highlightCode(firstString(args, ["code"]).replace(/\r/g, "").replace(/\t/g, " ").trimEnd(), "javascript");
|
|
371
424
|
|
|
372
|
-
/**
|
|
373
|
-
|
|
425
|
+
/** Tools whose expanded body already carries its own background, so painting it would replace
|
|
426
|
+
* colour that is the information: pi-diff's green/red hunks. */
|
|
427
|
+
const SELF_PAINTED_BODY_TOOLS = new Set(["write", "edit", "apply_patch"]);
|
|
428
|
+
|
|
429
|
+
/** Renderer pair for one tool; `original` is the result renderer shown when expanded.
|
|
430
|
+
* `external` marks the installer path whose shell is "self": the host draws no box there, so the
|
|
431
|
+
* expanded body must be painted here. pi-pretty's own tools paint their own bodies already. */
|
|
432
|
+
function claudeRenderers(name: string, label: string, original?: AnyFn, expandedCallBody?: CallBody, external = false) {
|
|
374
433
|
return {
|
|
375
434
|
renderCall(args: Record<string, unknown>, theme: ThemeLike, ctx: RenderCtxLike) {
|
|
376
435
|
const state: ToolState = ctx.isError
|
|
@@ -397,7 +456,32 @@ function claudeRenderers(name: string, label: string, original?: AnyFn, expanded
|
|
|
397
456
|
ctx: RenderCtxLike,
|
|
398
457
|
) {
|
|
399
458
|
if (options?.isPartial) return rowComponent(() => []);
|
|
400
|
-
|
|
459
|
+
// No renderer of its own (recall): the host would fall back to plain `toolOutput` text on
|
|
460
|
+
// this "self" shell, which has no box, so the body would float unpainted. Build it here.
|
|
461
|
+
if (ctx.expanded && !original && external) {
|
|
462
|
+
// The host fallback stripped ANSI and binary controls, dropped carriage returns, then
|
|
463
|
+
// rendered through a Text component. Skipping any of that would let a raw escape reach the
|
|
464
|
+
// terminal or misalign a tabbed row.
|
|
465
|
+
const text = sanitizedBodyText(result);
|
|
466
|
+
if (!text.trim()) return rowComponent(() => []);
|
|
467
|
+
resolveBaseBackground(theme);
|
|
468
|
+
const bg = ctx.isError ? BG_ERROR : BG_BASE;
|
|
469
|
+
// Drawn through the host's own Text: it wraps (so a long entry is not cut), turns tabs into
|
|
470
|
+
// three spaces, and pads each row to the render width before the background is applied.
|
|
471
|
+
const body = new Text(theme.fg("toolOutput", text), 0, 0, (line: string) =>
|
|
472
|
+
fillToolBackground(line, bg, undefined, ""),
|
|
473
|
+
);
|
|
474
|
+
return {
|
|
475
|
+
render: (width: number) => body.render(Math.max(1, width)),
|
|
476
|
+
invalidate: () => body.invalidate(),
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
if (ctx.expanded && original) {
|
|
480
|
+
const body = original(result, options, theme, ctx);
|
|
481
|
+
if (!external || !body || SELF_PAINTED_BODY_TOOLS.has(name)) return body;
|
|
482
|
+
resolveBaseBackground(theme);
|
|
483
|
+
return paintedBody(body, ctx.isError ? BG_ERROR : BG_BASE);
|
|
484
|
+
}
|
|
401
485
|
if (ctx.isError) {
|
|
402
486
|
const message = oneLine(
|
|
403
487
|
resultText(result)
|
|
@@ -495,9 +579,7 @@ export function installClaudeExternalToolRenderers(toolExecutionComponent: unkno
|
|
|
495
579
|
proto.getResultRenderer = function (this: any) {
|
|
496
580
|
const original = originals.getResultRenderer.call(this);
|
|
497
581
|
if (!isExternalTool(this)) return original;
|
|
498
|
-
|
|
499
|
-
if (!original && this.expanded) return undefined;
|
|
500
|
-
return claudeRenderers(this.toolName, labelOf(this), isolateDelegate(original)).renderResult;
|
|
582
|
+
return claudeRenderers(this.toolName, labelOf(this), isolateDelegate(original), undefined, true).renderResult;
|
|
501
583
|
};
|
|
502
584
|
// The shell is fixed when the component is built, and the style draws its own rows without a box.
|
|
503
585
|
proto.getRenderShell = function (this: any) {
|
|
@@ -521,6 +603,38 @@ export function withClaudeToolStyleApi<P extends { registerTool: AnyFn }>(pi: P)
|
|
|
521
603
|
// ---------------------------------------------------------------------------
|
|
522
604
|
|
|
523
605
|
const MIN_GROUPED_TOOLS = 2;
|
|
606
|
+
/**
|
|
607
|
+
* Tools whose expanded body stays inside the group instead of breaking it apart.
|
|
608
|
+
*
|
|
609
|
+
* A file-tool body is a diff: a few dozen lines at most, and the reason you expand the row is to
|
|
610
|
+
* read it next to the call it belongs to. `read`, `bash`, `codemode` and friends are the opposite —
|
|
611
|
+
* hundreds of lines, an async highlight pass, or an image payload that a tree row cannot carry — so
|
|
612
|
+
* they keep the old behaviour of leaving the group when expanded.
|
|
613
|
+
*/
|
|
614
|
+
const GROUP_INLINE_BODY_TOOLS = new Set(["write", "edit", "apply_patch"]);
|
|
615
|
+
|
|
616
|
+
/** `claudeStyle.expandFileTools`: open a file tool's diff by default instead of one `+N -N` row. */
|
|
617
|
+
let expandFileTools = false;
|
|
618
|
+
|
|
619
|
+
export function setClaudeStyleExpandFileTools(enabled: boolean): void {
|
|
620
|
+
expandFileTools = enabled;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
/** `claudeStyle.groupInlineTools`: extra names added to `GROUP_INLINE_BODY_TOOLS`. */
|
|
624
|
+
let extraInlineTools = new Set<string>();
|
|
625
|
+
|
|
626
|
+
export function setClaudeStyleGroupInlineTools(names: readonly string[] | undefined): void {
|
|
627
|
+
extraInlineTools = new Set(names ?? []);
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
/** A tool result carrying an image block: the host renders those itself, outside a tree row. */
|
|
631
|
+
function hasImageBlock(result: any): boolean {
|
|
632
|
+
return (Array.isArray(result?.content) ? result.content : []).some((block: any) => block?.type === "image");
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
/** Built-in inline body tools plus whatever the config adds. */
|
|
636
|
+
const inlinesBody = (toolName: string | undefined): boolean =>
|
|
637
|
+
GROUP_INLINE_BODY_TOOLS.has(toolName ?? "") || extraInlineTools.has(toolName ?? "");
|
|
524
638
|
|
|
525
639
|
const fg = (color: string, text: string): string => groupTheme.fg(color, text);
|
|
526
640
|
const bold = (text: string): string => groupTheme.bold(text);
|
|
@@ -563,6 +677,11 @@ let agentActive = false;
|
|
|
563
677
|
* transcript (same toolCallIds, fresh components) starts without stale marks. */
|
|
564
678
|
let interruptedTools = new WeakSet<object>();
|
|
565
679
|
|
|
680
|
+
/** File tools this session has already opened once on the user's behalf. Keyed by component, so a
|
|
681
|
+
* rebuilt transcript starts fresh. Opening only once is what keeps Ctrl+O and a click able to
|
|
682
|
+
* collapse a file tool afterwards: re-opening on every frame would silently undo them. */
|
|
683
|
+
let autoOpenedFileTools = new WeakSet<object>();
|
|
684
|
+
|
|
566
685
|
export function setClaudeStyleAgentActive(active: boolean): void {
|
|
567
686
|
agentActive = active;
|
|
568
687
|
}
|
|
@@ -572,6 +691,7 @@ export function setClaudeStyleAgentActive(active: boolean): void {
|
|
|
572
691
|
export function resetClaudeStyleSessionState(): void {
|
|
573
692
|
agentActive = false;
|
|
574
693
|
interruptedTools = new WeakSet<object>();
|
|
694
|
+
autoOpenedFileTools = new WeakSet<object>();
|
|
575
695
|
}
|
|
576
696
|
|
|
577
697
|
/** A call whose result will never arrive: marked while idle, or never resolved at all. */
|
|
@@ -607,11 +727,20 @@ function summaryRow(members: any[], width: number): string[] {
|
|
|
607
727
|
function treeRows(members: any[], width: number): { lines: string[]; owners: any[] } {
|
|
608
728
|
// Text-less assistant turns only contribute to the summary's thought count; their
|
|
609
729
|
// own rows (a hidden-thinking label) would read as noise between the tool rows.
|
|
730
|
+
/** A row that carries a diff line, which keeps its own background and blank spacing. */
|
|
731
|
+
const isBodyRow = (member: any, lineIndex: number): boolean =>
|
|
732
|
+
lineIndex > 0 &&
|
|
733
|
+
Boolean(member.expanded) &&
|
|
734
|
+
!member.result?.isError &&
|
|
735
|
+
GROUP_INLINE_BODY_TOOLS.has(member.toolName ?? "");
|
|
610
736
|
const blocks = members
|
|
611
737
|
.filter(isToolComponent)
|
|
612
738
|
.map((member) => ({
|
|
613
739
|
member,
|
|
614
|
-
rows
|
|
740
|
+
// Blank rows inside an inlined diff are hunks separated for readability, so they survive.
|
|
741
|
+
rows: (member.render(width) as string[]).filter(
|
|
742
|
+
(line, i) => !isImageLine(line) && (isBodyRow(member, i) || stripAnsi(line).trim() !== ""),
|
|
743
|
+
),
|
|
615
744
|
}))
|
|
616
745
|
.filter((block) => block.rows.length > 0);
|
|
617
746
|
const lines: string[] = [];
|
|
@@ -626,9 +755,13 @@ function treeRows(members: any[], width: number): { lines: string[]; owners: any
|
|
|
626
755
|
if (lineIndex === 0 && stripAnsi(line).trimStart().startsWith(ICON_SUCCESS))
|
|
627
756
|
content = line.replace(ICON_SUCCESS, "•");
|
|
628
757
|
if (lineIndex === 0 && isInterrupted(member)) content = markInterruptedRow(content);
|
|
629
|
-
// A group row is the tool's row inside a tree, so it
|
|
630
|
-
//
|
|
631
|
-
|
|
758
|
+
// A group row is the tool's row inside a tree, so it drops the tool-row background: a bar
|
|
759
|
+
// starting at the guide column would stripe the whole group. A diff line is the exception —
|
|
760
|
+
// its green/red background IS the information, so an inlined body row keeps it.
|
|
761
|
+
const body = isBodyRow(member, lineIndex)
|
|
762
|
+
? content.replace(LEADING_SPACE_RE, "$1")
|
|
763
|
+
: preserveBoxBackground(content).replace(LEADING_SPACE_RE, "$1");
|
|
764
|
+
const row = ` ${fg("dim", guide)}${body}`;
|
|
632
765
|
lines.push(visibleWidth(row) > width ? truncateToWidth(row, width, "") : row);
|
|
633
766
|
owners.push(member);
|
|
634
767
|
});
|
|
@@ -736,8 +869,10 @@ function renderGrouped(container: any, width: number): string[] {
|
|
|
736
869
|
state.width = width;
|
|
737
870
|
const lines: string[] = [];
|
|
738
871
|
const layout: Array<{ component: AnyComponent; height: number }> = [];
|
|
872
|
+
const parts: string[][] = [];
|
|
739
873
|
const push = (component: AnyComponent, rendered: string[]): void => {
|
|
740
874
|
layout.push({ component, height: rendered.length });
|
|
875
|
+
parts.push(rendered);
|
|
741
876
|
for (const line of rendered) lines.push(line);
|
|
742
877
|
};
|
|
743
878
|
let index = 0;
|
|
@@ -751,11 +886,33 @@ function renderGrouped(container: any, width: number): string[] {
|
|
|
751
886
|
}
|
|
752
887
|
const members = children.slice(index, end);
|
|
753
888
|
const tools = members.filter(isToolComponent);
|
|
889
|
+
// A file tool opens by default, but only once: it needs a result to show, and re-opening it
|
|
890
|
+
// every frame would undo the collapse a click or Ctrl+O just asked for. `setExpanded` always
|
|
891
|
+
// rebuilds the component, so this stays out of the steady state.
|
|
892
|
+
// Deliberately the built-in file tools only: `expandFileTools` is about diffs, and opening
|
|
893
|
+
// every tool a config adds to `groupInlineTools` would surprise the user with a body they
|
|
894
|
+
// never asked to see.
|
|
895
|
+
if (expandFileTools) {
|
|
896
|
+
for (const tool of tools) {
|
|
897
|
+
if (autoOpenedFileTools.has(tool)) continue;
|
|
898
|
+
if (!tool.result || !GROUP_INLINE_BODY_TOOLS.has(tool.toolName ?? "")) continue;
|
|
899
|
+
autoOpenedFileTools.add(tool);
|
|
900
|
+
if (!tool.expanded) tool.setExpanded?.(true);
|
|
901
|
+
}
|
|
902
|
+
}
|
|
754
903
|
// While idle, any result-less styled tool is a restored dangling call — mark it once.
|
|
755
904
|
if (!agentActive) {
|
|
756
905
|
for (const tool of tools) if (!tool.result) interruptedTools.add(tool);
|
|
757
906
|
}
|
|
758
|
-
|
|
907
|
+
// An image-bearing result cannot ride a tree row: `treeRows` drops image payload lines, so
|
|
908
|
+
// keeping such a tool inline would hide the image behind its fallback note.
|
|
909
|
+
// Independently of expansion: the host adds its image components whenever a result carries an
|
|
910
|
+
// image, and `treeRows` filters image payload lines out, so a grouped image result — collapsed
|
|
911
|
+
// or expanded — shows the fallback note instead of the image.
|
|
912
|
+
const leavesGroup =
|
|
913
|
+
tools.some((tool) => hasImageBlock(tool.result)) ||
|
|
914
|
+
tools.some((tool) => tool.expanded && !inlinesBody(tool.toolName));
|
|
915
|
+
if (tools.length < MIN_GROUPED_TOOLS || leavesGroup) {
|
|
759
916
|
for (const member of members) {
|
|
760
917
|
const rendered = member.render(width);
|
|
761
918
|
// A group has no summary to say "interrupted", so the lone row says it itself.
|
|
@@ -769,8 +926,13 @@ function renderGrouped(container: any, width: number): string[] {
|
|
|
769
926
|
}
|
|
770
927
|
} else {
|
|
771
928
|
const running = tools.some((tool) => isRunning(tool));
|
|
929
|
+
// A delegated renderer can repaint after its first render — pi-diff starts a placeholder
|
|
930
|
+
// and calls invalidate when the async diff lands — and that repaint changes none of the
|
|
931
|
+
// cache's identity inputs. So a group holding an expanded member is never served from the
|
|
932
|
+
// cache; it re-renders each frame, like a running one.
|
|
933
|
+
const live = running || tools.some((tool) => Boolean(tool.expanded));
|
|
772
934
|
const key = groupCacheKey(members);
|
|
773
|
-
const cached =
|
|
935
|
+
const cached = live ? undefined : state.store.get(key);
|
|
774
936
|
if (cached && isSameGroup(cached, members, tools)) {
|
|
775
937
|
push(cached.component, cached.rendered);
|
|
776
938
|
} else {
|
|
@@ -780,7 +942,7 @@ function renderGrouped(container: any, width: number): string[] {
|
|
|
780
942
|
const component = groupComponent(owners);
|
|
781
943
|
const rendered = [...summary, ...tree.lines];
|
|
782
944
|
push(component, rendered);
|
|
783
|
-
if (!
|
|
945
|
+
if (!live && state.store.size < GROUP_RENDER_CACHE_MAX) {
|
|
784
946
|
state.store.set(key, {
|
|
785
947
|
component,
|
|
786
948
|
members: [...members],
|
|
@@ -794,6 +956,9 @@ function renderGrouped(container: any, width: number): string[] {
|
|
|
794
956
|
index = end;
|
|
795
957
|
}
|
|
796
958
|
container.mouseLayout = { width, children: layout };
|
|
959
|
+
// pi-tui 1.6 routes mouse events through `childLines`; without it the host maps clicks onto the
|
|
960
|
+
// ungrouped children and re-renders them to rebuild that layout.
|
|
961
|
+
container.childLines = { width, children: layout.map((entry) => entry.component), parts, lines };
|
|
797
962
|
return lines;
|
|
798
963
|
}
|
|
799
964
|
|
package/src/config.ts
CHANGED
|
@@ -123,6 +123,14 @@ export interface PrettyConfig {
|
|
|
123
123
|
thinkingIndicator?: ThinkingIndicatorConfig;
|
|
124
124
|
/** "claudecode" renders collapsed tools as `✓ Name (args)` rows with grouping. */
|
|
125
125
|
toolStyle?: "default" | "claudecode";
|
|
126
|
+
/** `claudecode` only: show `write`/`edit`/`apply_patch` diffs by default instead of one
|
|
127
|
+
* collapsed `+N -N` row. Ctrl+O still toggles them with everything else. */
|
|
128
|
+
claudeStyle?: {
|
|
129
|
+
expandFileTools?: boolean;
|
|
130
|
+
/** Extra tools whose expanded body stays inside the group instead of breaking it apart,
|
|
131
|
+
* added to `write`/`edit`/`apply_patch`. Only sensible for tools with a short body. */
|
|
132
|
+
groupInlineTools?: string[];
|
|
133
|
+
};
|
|
126
134
|
fff?: FffConfig;
|
|
127
135
|
}
|
|
128
136
|
|
|
@@ -162,6 +170,15 @@ export function loadConfig(agentDir = getConfigDir()): PrettyConfig {
|
|
|
162
170
|
}
|
|
163
171
|
if (typeof parsed.theme === "string" && parsed.theme.trim() !== "") config.theme = parsed.theme;
|
|
164
172
|
if (parsed.toolStyle === "default" || parsed.toolStyle === "claudecode") config.toolStyle = parsed.toolStyle;
|
|
173
|
+
// Built member by member: assigning `config.claudeStyle` wholesale would make each key
|
|
174
|
+
// silently drop the others when a config sets more than one.
|
|
175
|
+
const expandFileTools = parsed.claudeStyle?.expandFileTools;
|
|
176
|
+
const groupInlineTools = normalizeToolList(parsed.claudeStyle?.groupInlineTools);
|
|
177
|
+
if (typeof expandFileTools === "boolean" || groupInlineTools.length) {
|
|
178
|
+
config.claudeStyle = {};
|
|
179
|
+
if (typeof expandFileTools === "boolean") config.claudeStyle.expandFileTools = expandFileTools;
|
|
180
|
+
if (groupInlineTools.length) config.claudeStyle.groupInlineTools = groupInlineTools;
|
|
181
|
+
}
|
|
165
182
|
if (typeof parsed.userRail === "string" && /^#[0-9a-fA-F]{6}$/.test(parsed.userRail))
|
|
166
183
|
config.userRail = parsed.userRail;
|
|
167
184
|
if (typeof parsed.icons === "string") config.icons = parsed.icons;
|
package/src/index.ts
CHANGED
|
@@ -26,6 +26,8 @@ import {
|
|
|
26
26
|
installClaudeExternalToolRenderers,
|
|
27
27
|
resetClaudeStyleSessionState,
|
|
28
28
|
setClaudeStyleAgentActive,
|
|
29
|
+
setClaudeStyleExpandFileTools,
|
|
30
|
+
setClaudeStyleGroupInlineTools,
|
|
29
31
|
setClaudeStyleTheme,
|
|
30
32
|
withClaudeToolStyleApi,
|
|
31
33
|
} from "./claude-style.js";
|
|
@@ -87,6 +89,8 @@ export default async function piPrettyExtension(pi: ExtensionAPI, deps?: PiPrett
|
|
|
87
89
|
const config = loadConfig();
|
|
88
90
|
applyConfig(config);
|
|
89
91
|
const claudeStyle = config.toolStyle === "claudecode";
|
|
92
|
+
setClaudeStyleExpandFileTools(claudeStyle && Boolean(config.claudeStyle?.expandFileTools));
|
|
93
|
+
setClaudeStyleGroupInlineTools(claudeStyle ? config.claudeStyle?.groupInlineTools : undefined);
|
|
90
94
|
setClaudeThinkingLabels(claudeStyle);
|
|
91
95
|
// claudecode style keeps user messages plain; the default style prefixes them with a prompt icon.
|
|
92
96
|
if (!claudeStyle) {
|
package/src/prompt-editor.ts
CHANGED
|
@@ -82,7 +82,8 @@ export function createPromptEditorClass(
|
|
|
82
82
|
|
|
83
83
|
override render(width: number): string[] {
|
|
84
84
|
this.bottomBorderLine = "";
|
|
85
|
-
|
|
85
|
+
// Copy: pi-tui 1.6 lets components return a cached render array, so patching it in place could repeat the patch next frame.
|
|
86
|
+
const lines = [...super.render(width)];
|
|
86
87
|
if (lines.length < 2) return lines;
|
|
87
88
|
|
|
88
89
|
if (!this.isScrolled) {
|
package/dist/collapsed-hint.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/** Shown in collapsed tool results; Pi keybinding is still `app.tools.expand` (Ctrl+O). */
|
|
2
|
-
export declare const COLLAPSED_EXPAND_LABEL = "ctrl+o to expand";
|
|
3
|
-
/** Collapsed hint line (no extra blank lines above/below). */
|
|
4
|
-
export declare function collapsedExpandBlock(countLabel: string): string;
|
|
5
|
-
/** When line count / metrics already appear on the header line (bash). */
|
|
6
|
-
export declare function collapsedExpandFooter(): string;
|
|
7
|
-
//# sourceMappingURL=collapsed-hint.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"collapsed-hint.d.ts","sourceRoot":"","sources":["../src/collapsed-hint.ts"],"names":[],"mappings":"AAEA,2FAA2F;AAC3F,eAAO,MAAM,sBAAsB,qBAAqB,CAAC;AAEzD,8DAA8D;AAC9D,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,0EAA0E;AAC1E,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C"}
|
package/dist/collapsed-hint.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.COLLAPSED_EXPAND_LABEL = void 0;
|
|
4
|
-
exports.collapsedExpandBlock = collapsedExpandBlock;
|
|
5
|
-
exports.collapsedExpandFooter = collapsedExpandFooter;
|
|
6
|
-
const config_js_1 = require("./config.js");
|
|
7
|
-
/** Shown in collapsed tool results; Pi keybinding is still `app.tools.expand` (Ctrl+O). */
|
|
8
|
-
exports.COLLAPSED_EXPAND_LABEL = "ctrl+o to expand";
|
|
9
|
-
/** Collapsed hint line (no extra blank lines above/below). */
|
|
10
|
-
function collapsedExpandBlock(countLabel) {
|
|
11
|
-
return `${config_js_1.TOOL_RESULT_INDENT}${config_js_1.FG_DIM}${countLabel} — ${exports.COLLAPSED_EXPAND_LABEL}${config_js_1.RST}\n`;
|
|
12
|
-
}
|
|
13
|
-
/** When line count / metrics already appear on the header line (bash). */
|
|
14
|
-
function collapsedExpandFooter() {
|
|
15
|
-
return `${config_js_1.TOOL_RESULT_INDENT}${config_js_1.FG_DIM}${exports.COLLAPSED_EXPAND_LABEL}${config_js_1.RST}\n`;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=collapsed-hint.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"collapsed-hint.js","sourceRoot":"","sources":["../src/collapsed-hint.ts"],"names":[],"mappings":";;;AAMA,oDAEC;AAGD,sDAEC;AAbD,2CAA8D;AAE9D,2FAA2F;AAC9E,QAAA,sBAAsB,GAAG,kBAAkB,CAAC;AAEzD,8DAA8D;AAC9D,SAAgB,oBAAoB,CAAC,UAAkB;IACtD,OAAO,GAAG,8BAAkB,GAAG,kBAAM,GAAG,UAAU,MAAM,8BAAsB,GAAG,eAAG,IAAI,CAAC;AAC1F,CAAC;AAED,0EAA0E;AAC1E,SAAgB,qBAAqB;IACpC,OAAO,GAAG,8BAAkB,GAAG,kBAAM,GAAG,8BAAsB,GAAG,eAAG,IAAI,CAAC;AAC1E,CAAC"}
|
package/dist/expand.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/** Render context from pi tool UI (Ctrl+O toggles `expanded` per tool block). */
|
|
2
|
-
export type ToolRenderCtx = {
|
|
3
|
-
expanded?: boolean;
|
|
4
|
-
};
|
|
5
|
-
/** Lines to show in tool result body when collapsed vs expanded. */
|
|
6
|
-
export declare function previewLineCount(ctx: ToolRenderCtx, totalLines: number): number;
|
|
7
|
-
//# sourceMappingURL=expand.d.ts.map
|
package/dist/expand.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"expand.d.ts","sourceRoot":"","sources":["../src/expand.ts"],"names":[],"mappings":"AAEA,iFAAiF;AACjF,MAAM,MAAM,aAAa,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEnD,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAG/E"}
|
package/dist/expand.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.previewLineCount = previewLineCount;
|
|
4
|
-
const config_js_1 = require("./config.js");
|
|
5
|
-
/** Lines to show in tool result body when collapsed vs expanded. */
|
|
6
|
-
function previewLineCount(ctx, totalLines) {
|
|
7
|
-
if (ctx.expanded)
|
|
8
|
-
return totalLines;
|
|
9
|
-
return Math.min(totalLines, config_js_1.MAX_PREVIEW_LINES);
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=expand.js.map
|
package/dist/expand.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"expand.js","sourceRoot":"","sources":["../src/expand.ts"],"names":[],"mappings":";;AAMA,4CAGC;AATD,2CAAgD;AAKhD,oEAAoE;AACpE,SAAgB,gBAAgB,CAAC,GAAkB,EAAE,UAAkB;IACtE,IAAI,GAAG,CAAC,QAAQ;QAAE,OAAO,UAAU,CAAC;IACpC,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,6BAAiB,CAAC,CAAC;AAChD,CAAC"}
|
package/dist/image.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* pi-pretty: Terminal image rendering (iTerm2 / Kitty / Ghostty inline image protocols).
|
|
3
|
-
* Handles tmux passthrough for image protocols.
|
|
4
|
-
*/
|
|
5
|
-
type ImageProtocol = "iterm2" | "kitty" | "none";
|
|
6
|
-
declare function isTmuxSession(): boolean;
|
|
7
|
-
declare function getOuterTerminal(): string;
|
|
8
|
-
declare function detectImageProtocol(): ImageProtocol;
|
|
9
|
-
declare function tmuxAllowsPassthrough(): boolean | null;
|
|
10
|
-
declare function getTmuxPassthroughWarning(protocol: ImageProtocol): string | null;
|
|
11
|
-
declare function tmuxWrap(seq: string): string;
|
|
12
|
-
export declare const __imageInternals: {
|
|
13
|
-
isTmuxSession: typeof isTmuxSession;
|
|
14
|
-
getOuterTerminal: typeof getOuterTerminal;
|
|
15
|
-
detectImageProtocol: typeof detectImageProtocol;
|
|
16
|
-
tmuxWrap: typeof tmuxWrap;
|
|
17
|
-
tmuxAllowsPassthrough: typeof tmuxAllowsPassthrough;
|
|
18
|
-
getTmuxPassthroughWarning: typeof getTmuxPassthroughWarning;
|
|
19
|
-
setTmuxClientTermOverrideForTests: (value: string | null | undefined) => void;
|
|
20
|
-
setTmuxAllowPassthroughOverrideForTests: (value: boolean | null | undefined) => void;
|
|
21
|
-
resetCachesForTests: () => void;
|
|
22
|
-
};
|
|
23
|
-
export {};
|
|
24
|
-
//# sourceMappingURL=image.d.ts.map
|
package/dist/image.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,KAAK,aAAa,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAOjD,iBAAS,aAAa,IAAI,OAAO,CAEhC;AA+BD,iBAAS,gBAAgB,IAAI,MAAM,CAiBlC;AAED,iBAAS,mBAAmB,IAAI,aAAa,CAQ5C;AAED,iBAAS,qBAAqB,IAAI,OAAO,GAAG,IAAI,CAiB/C;AAED,iBAAS,yBAAyB,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI,CAMzE;AAED,iBAAS,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIrC;AAED,eAAO,MAAM,gBAAgB;;;;;;;+CAOe,MAAM,GAAG,IAAI,GAAG,SAAS;qDAGnB,OAAO,GAAG,IAAI,GAAG,SAAS;;CAS3E,CAAC"}
|
package/dist/image.js
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* pi-pretty: Terminal image rendering (iTerm2 / Kitty / Ghostty inline image protocols).
|
|
4
|
-
* Handles tmux passthrough for image protocols.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.__imageInternals = void 0;
|
|
8
|
-
const node_child_process_1 = require("node:child_process");
|
|
9
|
-
let _tmuxClientTermCache;
|
|
10
|
-
let _tmuxAllowPassthroughCache;
|
|
11
|
-
let _tmuxClientTermOverrideForTests;
|
|
12
|
-
let _tmuxAllowPassthroughOverrideForTests;
|
|
13
|
-
function isTmuxSession() {
|
|
14
|
-
return !!process.env.TMUX || /^(tmux|screen)/.test(process.env.TERM ?? "");
|
|
15
|
-
}
|
|
16
|
-
function normalizeTerminalName(term) {
|
|
17
|
-
const t = term.toLowerCase();
|
|
18
|
-
if (t.includes("kitty"))
|
|
19
|
-
return "kitty";
|
|
20
|
-
if (t.includes("ghostty"))
|
|
21
|
-
return "ghostty";
|
|
22
|
-
if (t.includes("wezterm"))
|
|
23
|
-
return "WezTerm";
|
|
24
|
-
if (t.includes("iterm"))
|
|
25
|
-
return "iTerm.app";
|
|
26
|
-
if (t.includes("mintty"))
|
|
27
|
-
return "mintty";
|
|
28
|
-
return term;
|
|
29
|
-
}
|
|
30
|
-
function readTmuxClientTerm() {
|
|
31
|
-
if (_tmuxClientTermOverrideForTests !== undefined) {
|
|
32
|
-
return _tmuxClientTermOverrideForTests ? normalizeTerminalName(_tmuxClientTermOverrideForTests) : null;
|
|
33
|
-
}
|
|
34
|
-
if (!isTmuxSession())
|
|
35
|
-
return null;
|
|
36
|
-
if (_tmuxClientTermCache !== undefined)
|
|
37
|
-
return _tmuxClientTermCache;
|
|
38
|
-
try {
|
|
39
|
-
const term = (0, node_child_process_1.execFileSync)("tmux", ["display-message", "-p", "#{client_termname}"], {
|
|
40
|
-
encoding: "utf8",
|
|
41
|
-
stdio: ["ignore", "pipe", "ignore"],
|
|
42
|
-
timeout: 200,
|
|
43
|
-
}).trim();
|
|
44
|
-
_tmuxClientTermCache = term ? normalizeTerminalName(term) : null;
|
|
45
|
-
}
|
|
46
|
-
catch {
|
|
47
|
-
_tmuxClientTermCache = null;
|
|
48
|
-
}
|
|
49
|
-
return _tmuxClientTermCache;
|
|
50
|
-
}
|
|
51
|
-
function getOuterTerminal() {
|
|
52
|
-
if (process.env.LC_TERMINAL === "iTerm2")
|
|
53
|
-
return "iTerm.app";
|
|
54
|
-
if (process.env.GHOSTTY_RESOURCES_DIR)
|
|
55
|
-
return "ghostty";
|
|
56
|
-
if (process.env.KITTY_WINDOW_ID || process.env.KITTY_PID)
|
|
57
|
-
return "kitty";
|
|
58
|
-
if (process.env.WEZTERM_EXECUTABLE || process.env.WEZTERM_CONFIG_DIR || process.env.WEZTERM_CONFIG_FILE) {
|
|
59
|
-
return "WezTerm";
|
|
60
|
-
}
|
|
61
|
-
const termProgram = process.env.TERM_PROGRAM ?? "";
|
|
62
|
-
if (termProgram && termProgram !== "tmux" && termProgram !== "screen") {
|
|
63
|
-
return normalizeTerminalName(termProgram);
|
|
64
|
-
}
|
|
65
|
-
const tmuxClientTerm = readTmuxClientTerm();
|
|
66
|
-
if (tmuxClientTerm)
|
|
67
|
-
return tmuxClientTerm;
|
|
68
|
-
const term = process.env.TERM ?? "";
|
|
69
|
-
if (term)
|
|
70
|
-
return normalizeTerminalName(term);
|
|
71
|
-
if (process.env.COLORTERM === "truecolor" || process.env.COLORTERM === "24bit")
|
|
72
|
-
return "unknown-modern";
|
|
73
|
-
return termProgram;
|
|
74
|
-
}
|
|
75
|
-
function detectImageProtocol() {
|
|
76
|
-
const forced = (process.env.PRETTY_IMAGE_PROTOCOL ?? "").toLowerCase();
|
|
77
|
-
if (forced === "kitty" || forced === "iterm2" || forced === "none")
|
|
78
|
-
return forced;
|
|
79
|
-
const term = getOuterTerminal();
|
|
80
|
-
if (term === "ghostty" || term === "kitty")
|
|
81
|
-
return "kitty";
|
|
82
|
-
if (["iTerm.app", "WezTerm", "mintty"].includes(term))
|
|
83
|
-
return "iterm2";
|
|
84
|
-
if (process.env.LC_TERMINAL === "iTerm2")
|
|
85
|
-
return "iterm2";
|
|
86
|
-
return "none";
|
|
87
|
-
}
|
|
88
|
-
function tmuxAllowsPassthrough() {
|
|
89
|
-
if (_tmuxAllowPassthroughOverrideForTests !== undefined)
|
|
90
|
-
return _tmuxAllowPassthroughOverrideForTests;
|
|
91
|
-
if (!isTmuxSession())
|
|
92
|
-
return null;
|
|
93
|
-
if (_tmuxAllowPassthroughCache !== undefined)
|
|
94
|
-
return _tmuxAllowPassthroughCache;
|
|
95
|
-
try {
|
|
96
|
-
const value = (0, node_child_process_1.execFileSync)("tmux", ["show-options", "-gv", "allow-passthrough"], {
|
|
97
|
-
encoding: "utf8",
|
|
98
|
-
stdio: ["ignore", "pipe", "ignore"],
|
|
99
|
-
timeout: 200,
|
|
100
|
-
})
|
|
101
|
-
.trim()
|
|
102
|
-
.toLowerCase();
|
|
103
|
-
_tmuxAllowPassthroughCache = value === "on" || value === "all";
|
|
104
|
-
}
|
|
105
|
-
catch {
|
|
106
|
-
_tmuxAllowPassthroughCache = null;
|
|
107
|
-
}
|
|
108
|
-
return _tmuxAllowPassthroughCache;
|
|
109
|
-
}
|
|
110
|
-
function getTmuxPassthroughWarning(protocol) {
|
|
111
|
-
if (!isTmuxSession() || protocol === "none")
|
|
112
|
-
return null;
|
|
113
|
-
if (tmuxAllowsPassthrough() === false) {
|
|
114
|
-
return "tmux allow-passthrough is off. Run: tmux set -g allow-passthrough on";
|
|
115
|
-
}
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
function tmuxWrap(seq) {
|
|
119
|
-
if (!isTmuxSession())
|
|
120
|
-
return seq;
|
|
121
|
-
const escaped = seq.split("\x1b").join("\x1b\x1b");
|
|
122
|
-
return `\x1bPtmux;${escaped}\x1b\\`;
|
|
123
|
-
}
|
|
124
|
-
exports.__imageInternals = {
|
|
125
|
-
isTmuxSession,
|
|
126
|
-
getOuterTerminal,
|
|
127
|
-
detectImageProtocol,
|
|
128
|
-
tmuxWrap,
|
|
129
|
-
tmuxAllowsPassthrough,
|
|
130
|
-
getTmuxPassthroughWarning,
|
|
131
|
-
setTmuxClientTermOverrideForTests: (value) => {
|
|
132
|
-
_tmuxClientTermOverrideForTests = value;
|
|
133
|
-
},
|
|
134
|
-
setTmuxAllowPassthroughOverrideForTests: (value) => {
|
|
135
|
-
_tmuxAllowPassthroughOverrideForTests = value;
|
|
136
|
-
},
|
|
137
|
-
resetCachesForTests: () => {
|
|
138
|
-
_tmuxClientTermCache = undefined;
|
|
139
|
-
_tmuxAllowPassthroughCache = undefined;
|
|
140
|
-
_tmuxClientTermOverrideForTests = undefined;
|
|
141
|
-
_tmuxAllowPassthroughOverrideForTests = undefined;
|
|
142
|
-
},
|
|
143
|
-
};
|
|
144
|
-
//# sourceMappingURL=image.js.map
|
package/dist/image.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAkD;AAIlD,IAAI,oBAA+C,CAAC;AACpD,IAAI,0BAAsD,CAAC;AAC3D,IAAI,+BAA0D,CAAC;AAC/D,IAAI,qCAAiE,CAAC;AAEtE,SAAS,aAAa;IACrB,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;AAC5E,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY;IAC1C,MAAM,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAC7B,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC;IACxC,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC;QAAE,OAAO,SAAS,CAAC;IAC5C,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC;QAAE,OAAO,SAAS,CAAC;IAC5C,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,WAAW,CAAC;IAC5C,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,QAAQ,CAAC;IAC1C,OAAO,IAAI,CAAC;AACb,CAAC;AAED,SAAS,kB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