@aiwayds/dsh-tui-pi 0.8.2 → 0.8.3
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/lib/canvas-terminal.d.ts +17 -11
- package/lib/canvas-terminal.js +62 -24
- package/lib/canvas-terminal.js.map +1 -1
- package/lib/tui.js +15 -6
- package/lib/tui.js.map +1 -1
- package/package.json +1 -1
package/lib/canvas-terminal.d.ts
CHANGED
|
@@ -2,33 +2,39 @@
|
|
|
2
2
|
* Terminal write-stream decorator painting the canvas via BCE.
|
|
3
3
|
*
|
|
4
4
|
* pi-tui renders rows as `\x1b[{row};1H\x1b[2K{line}` and full redraws as
|
|
5
|
-
* `\x1b[2J` — no background of their own.
|
|
6
|
-
*
|
|
5
|
+
* `\x1b[2J` — no background of their own. Injections make the whole screen
|
|
6
|
+
* carry the theme colors without touching pi-tui:
|
|
7
7
|
*
|
|
8
8
|
* 1. Before every erase sequence (`\x1b[2K`/`\x1b[2J`): terminals with BCE
|
|
9
9
|
* (back color erase) fill the erased region with the current SGR
|
|
10
10
|
* background, painting row tails the erase never reaches.
|
|
11
|
-
* 2. After every
|
|
12
|
-
* `\x1b[0;…m`, `\x1b[49m`): content following a reset would
|
|
13
|
-
* print with the terminal default
|
|
14
|
-
* canvas
|
|
15
|
-
*
|
|
16
|
-
*
|
|
11
|
+
* 2. After every color-clearing SGR reset (`\x1b[0m`, `\x1b[m`,
|
|
12
|
+
* `\x1b[0;…m`, `\x1b[39m`, `\x1b[49m`): content following a reset would
|
|
13
|
+
* otherwise print with the terminal default colors, punching holes into
|
|
14
|
+
* the canvas — most visibly the editor input and unselected picker rows
|
|
15
|
+
* falling back to the terminal's default FOREGROUND, which is dark text
|
|
16
|
+
* when the host terminal is light-themed (pi itself never paints a
|
|
17
|
+
* canvas, so its unstyled text always matches; we paint, so we must own
|
|
18
|
+
* both channels). Re-injecting restores the canvas; spans that set their
|
|
19
|
+
* own colors still override it.
|
|
17
20
|
*
|
|
18
|
-
* Rows the diff renderer skips keep the
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
+
* Rows the diff renderer skips keep the colors of their last paint, which
|
|
22
|
+
* is correct until the canvas changes — the caller must then force a full
|
|
23
|
+
* redraw (requestRender(true)).
|
|
21
24
|
*/
|
|
22
25
|
import type { Terminal } from '@earendil-works/pi-tui';
|
|
23
26
|
export declare class CanvasTerminal implements Terminal {
|
|
24
27
|
/** '' = transparent passthrough (DSH_TUI_TRANSPARENT). */
|
|
25
28
|
private background;
|
|
29
|
+
private foreground;
|
|
26
30
|
/** False once the alt-screen exit sequence is seen — the main-screen document dump that follows stays unpainted. */
|
|
27
31
|
private active;
|
|
28
32
|
private readonly inner;
|
|
29
33
|
constructor(inner: Terminal);
|
|
30
34
|
/** Set the canvas background SGR; undefined reverts to transparent. */
|
|
31
35
|
setCanvasBackground(bg: string | undefined): void;
|
|
36
|
+
/** Set the canvas foreground SGR (the app's default text color); undefined disables. */
|
|
37
|
+
setCanvasForeground(fg: string | undefined): void;
|
|
32
38
|
write(data: string): void;
|
|
33
39
|
start(onInput: (data: string) => void, onResize: () => void): void;
|
|
34
40
|
stop(): void;
|
package/lib/canvas-terminal.js
CHANGED
|
@@ -2,41 +2,71 @@
|
|
|
2
2
|
* Terminal write-stream decorator painting the canvas via BCE.
|
|
3
3
|
*
|
|
4
4
|
* pi-tui renders rows as `\x1b[{row};1H\x1b[2K{line}` and full redraws as
|
|
5
|
-
* `\x1b[2J` — no background of their own.
|
|
6
|
-
*
|
|
5
|
+
* `\x1b[2J` — no background of their own. Injections make the whole screen
|
|
6
|
+
* carry the theme colors without touching pi-tui:
|
|
7
7
|
*
|
|
8
8
|
* 1. Before every erase sequence (`\x1b[2K`/`\x1b[2J`): terminals with BCE
|
|
9
9
|
* (back color erase) fill the erased region with the current SGR
|
|
10
10
|
* background, painting row tails the erase never reaches.
|
|
11
|
-
* 2. After every
|
|
12
|
-
* `\x1b[0;…m`, `\x1b[49m`): content following a reset would
|
|
13
|
-
* print with the terminal default
|
|
14
|
-
* canvas
|
|
15
|
-
*
|
|
16
|
-
*
|
|
11
|
+
* 2. After every color-clearing SGR reset (`\x1b[0m`, `\x1b[m`,
|
|
12
|
+
* `\x1b[0;…m`, `\x1b[39m`, `\x1b[49m`): content following a reset would
|
|
13
|
+
* otherwise print with the terminal default colors, punching holes into
|
|
14
|
+
* the canvas — most visibly the editor input and unselected picker rows
|
|
15
|
+
* falling back to the terminal's default FOREGROUND, which is dark text
|
|
16
|
+
* when the host terminal is light-themed (pi itself never paints a
|
|
17
|
+
* canvas, so its unstyled text always matches; we paint, so we must own
|
|
18
|
+
* both channels). Re-injecting restores the canvas; spans that set their
|
|
19
|
+
* own colors still override it.
|
|
17
20
|
*
|
|
18
|
-
* Rows the diff renderer skips keep the
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
+
* Rows the diff renderer skips keep the colors of their last paint, which
|
|
22
|
+
* is correct until the canvas changes — the caller must then force a full
|
|
23
|
+
* redraw (requestRender(true)).
|
|
21
24
|
*/
|
|
22
25
|
const ENTER_ALT_SCREEN = '\x1b[?1049h';
|
|
23
26
|
const EXIT_ALT_SCREEN = '\x1b[?1049l';
|
|
24
27
|
const SGR = /\x1b\[([0-9;]*)m/g;
|
|
25
28
|
/**
|
|
26
|
-
*
|
|
27
|
-
* (`\x1b[0m`, `\x1b[m`, `\x1b[0;…m`
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
29
|
+
* Which color channels an SGR parameter list resets to the terminal
|
|
30
|
+
* default: full resets (`\x1b[0m`, `\x1b[m`, `\x1b[0;…m`) clear both,
|
|
31
|
+
* `\x1b[39m`/`\x1b[49m` clear one each. Color-set parameters are skipped
|
|
32
|
+
* so a 0 channel (`\x1b[48;2;0;121;107m`, `\x1b[38;5;0m`) never reads as
|
|
33
|
+
* a reset — treating those as clears would paint over intentional
|
|
34
|
+
* surfaces.
|
|
31
35
|
*/
|
|
32
|
-
function
|
|
33
|
-
if (params === ''
|
|
34
|
-
return true;
|
|
35
|
-
|
|
36
|
+
function sgrClears(params) {
|
|
37
|
+
if (params === '')
|
|
38
|
+
return { bg: true, fg: true };
|
|
39
|
+
const p = params.split(';');
|
|
40
|
+
let bg = false;
|
|
41
|
+
let fg = false;
|
|
42
|
+
for (let i = 0; i < p.length; i++) {
|
|
43
|
+
const token = p[i];
|
|
44
|
+
if (token === '0' || token === '') {
|
|
45
|
+
bg = true;
|
|
46
|
+
fg = true;
|
|
47
|
+
}
|
|
48
|
+
else if (token === '39') {
|
|
49
|
+
fg = true;
|
|
50
|
+
}
|
|
51
|
+
else if (token === '49') {
|
|
52
|
+
bg = true;
|
|
53
|
+
}
|
|
54
|
+
else if (token === '38' || token === '48') {
|
|
55
|
+
// Skip the color spec (5;n or 2;r;g;b, plus legacy 3;/4; forms).
|
|
56
|
+
if (p[i + 1] === '5')
|
|
57
|
+
i += 2;
|
|
58
|
+
else if (p[i + 1] === '2')
|
|
59
|
+
i += 4;
|
|
60
|
+
else if (p[i + 1] === '3' || p[i + 1] === '4')
|
|
61
|
+
i += 1;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return { bg, fg };
|
|
36
65
|
}
|
|
37
66
|
export class CanvasTerminal {
|
|
38
67
|
/** '' = transparent passthrough (DSH_TUI_TRANSPARENT). */
|
|
39
68
|
background = '';
|
|
69
|
+
foreground = '';
|
|
40
70
|
/** False once the alt-screen exit sequence is seen — the main-screen document dump that follows stays unpainted. */
|
|
41
71
|
active = true;
|
|
42
72
|
inner;
|
|
@@ -47,6 +77,10 @@ export class CanvasTerminal {
|
|
|
47
77
|
setCanvasBackground(bg) {
|
|
48
78
|
this.background = bg ?? '';
|
|
49
79
|
}
|
|
80
|
+
/** Set the canvas foreground SGR (the app's default text color); undefined disables. */
|
|
81
|
+
setCanvasForeground(fg) {
|
|
82
|
+
this.foreground = fg ?? '';
|
|
83
|
+
}
|
|
50
84
|
write(data) {
|
|
51
85
|
if (data.includes(EXIT_ALT_SCREEN)) {
|
|
52
86
|
// The exit buffer starts with EXIT_ALT_SCREEN; write it (and anything
|
|
@@ -58,18 +92,22 @@ export class CanvasTerminal {
|
|
|
58
92
|
}
|
|
59
93
|
if (data.includes(ENTER_ALT_SCREEN))
|
|
60
94
|
this.active = true;
|
|
61
|
-
if (this.background === '' || !this.active) {
|
|
95
|
+
if ((this.background === '' && this.foreground === '') || !this.active) {
|
|
62
96
|
this.inner.write(data);
|
|
63
97
|
return;
|
|
64
98
|
}
|
|
65
99
|
// Injection happens only at erase-sequence boundaries and after
|
|
66
|
-
//
|
|
67
|
-
//
|
|
100
|
+
// color-clearing resets; kitty image payloads are APC base64/hex and
|
|
101
|
+
// never contain ESC bytes.
|
|
68
102
|
const bg = this.background;
|
|
103
|
+
const fg = this.foreground;
|
|
69
104
|
this.inner.write(data
|
|
70
105
|
.replaceAll('\x1b[2K', `${bg}\x1b[2K`)
|
|
71
106
|
.replaceAll('\x1b[2J', `${bg}\x1b[2J`)
|
|
72
|
-
.replace(SGR, (seq, params) =>
|
|
107
|
+
.replace(SGR, (seq, params) => {
|
|
108
|
+
const clears = sgrClears(params);
|
|
109
|
+
return seq + (clears.bg ? bg : '') + (clears.fg ? fg : '');
|
|
110
|
+
}));
|
|
73
111
|
}
|
|
74
112
|
start(onInput, onResize) {
|
|
75
113
|
this.inner.start(onInput, onResize);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas-terminal.js","sourceRoot":"","sources":["../src/canvas-terminal.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"canvas-terminal.js","sourceRoot":"","sources":["../src/canvas-terminal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,MAAM,gBAAgB,GAAG,aAAa,CAAA;AACtC,MAAM,eAAe,GAAG,aAAa,CAAA;AACrC,MAAM,GAAG,GAAG,mBAAmB,CAAA;AAE/B;;;;;;;GAOG;AACH,SAAS,SAAS,CAAC,MAA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S,EAAE,CAAA;IACxB,CAAC;IAED,eAAe;QACb,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAA;IAC9B,CAAC;IAED,WAAW;QACT,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAA;IAC1B,CAAC;IAED,QAAQ,CAAC,KAAa;QACpB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC5B,CAAC;IAED,WAAW,CAAC,MAAe;QACzB,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;IAChC,CAAC;CACF"}
|
package/lib/tui.js
CHANGED
|
@@ -30,17 +30,24 @@ export function startTui(options = {}) {
|
|
|
30
30
|
// getter, baked closures below) observes the new bundle on the next call.
|
|
31
31
|
let themeRef = resolveTheme(process.env, options.themePreference ?? 'auto');
|
|
32
32
|
// App-owned canvas: the write-stream decorator injects the palette's
|
|
33
|
-
// canvas
|
|
34
|
-
// canvas-terminal.ts), so a theme switch
|
|
35
|
-
// only the surfaces that paint their own
|
|
36
|
-
//
|
|
33
|
+
// canvas colors around every erase sequence and after every color reset
|
|
34
|
+
// (BCE + re-injection — see canvas-terminal.ts), so a theme switch
|
|
35
|
+
// recolors the WHOLE screen, not only the surfaces that paint their own
|
|
36
|
+
// colors. The foreground matters as much as the background: unstyled
|
|
37
|
+
// content (editor input, unselected picker rows) would otherwise fall
|
|
38
|
+
// back to the terminal's default foreground — dark text when the host
|
|
39
|
+
// terminal is light-themed (pi never paints a canvas so its unstyled
|
|
40
|
+
// text always matches; we paint, so we own both channels). Without the
|
|
41
|
+
// canvas the terminal default background shows through and "freezes" on
|
|
37
42
|
// switch — most visible inside cmux/gostty, where the pane background
|
|
38
43
|
// belongs to the multiplexer. DSH_TUI_TRANSPARENT=1 opts back into the
|
|
39
44
|
// old see-through canvas for users who want their terminal theme to stay
|
|
40
45
|
// visible.
|
|
41
46
|
const paintCanvas = process.env.DSH_TUI_TRANSPARENT !== '1';
|
|
42
|
-
if (paintCanvas)
|
|
47
|
+
if (paintCanvas) {
|
|
43
48
|
terminal.setCanvasBackground(ansiBg(themeRef.palette.canvas));
|
|
49
|
+
terminal.setCanvasForeground(ansiFg(themeRef.palette.fgDefault));
|
|
50
|
+
}
|
|
44
51
|
// ------------------------------------------------------------- component tree --
|
|
45
52
|
// Live Todos widget, pinned ABOVE the chat input: a plain Container with
|
|
46
53
|
// auto height — it renders zero rows while empty and grows to its
|
|
@@ -172,8 +179,10 @@ export function startTui(options = {}) {
|
|
|
172
179
|
if (theme === themeRef)
|
|
173
180
|
return;
|
|
174
181
|
themeRef = theme;
|
|
175
|
-
if (paintCanvas)
|
|
182
|
+
if (paintCanvas) {
|
|
176
183
|
terminal.setCanvasBackground(ansiBg(theme.palette.canvas));
|
|
184
|
+
terminal.setCanvasForeground(ansiFg(theme.palette.fgDefault));
|
|
185
|
+
}
|
|
177
186
|
rebuildEditor();
|
|
178
187
|
// Forced full redraw: the diff renderer skips content-unchanged rows
|
|
179
188
|
// (blank fillers render as '' under both themes), which would leave
|
package/lib/tui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tui.js","sourceRoot":"","sources":["../src/tui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,SAAS,EACT,UAAU,EACV,eAAe,EACf,UAAU,EACV,MAAM,EACN,IAAI,EACJ,YAAY,EACZ,MAAM,GAGP,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAoC,MAAM,aAAa,CAAA;AAClG,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAuC,MAAM,kBAAkB,CAAA;AAqE3G,MAAM,UAAU,QAAQ,CAAC,UAA2B,EAAE;IACpD,M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