pi-startup-redraw-fix 0.1.8 → 0.1.10
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 +53 -55
- package/package.json +64 -64
- package/src/index.ts +18 -18
- package/src/terminal-clear-patch.ts +44 -44
package/CHANGELOG.md
CHANGED
|
@@ -1,55 +1,53 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
## [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
- Standardized repository structure with `src/` layout and root shim entrypoint.
|
|
55
|
-
- Kept terminal clear-sequence patch behavior unchanged.
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.10] - 2026-05-22
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- Aligned Pi peer dependency metadata with the `@earendil-works` Pi v0.75.4 extension runtime packages.
|
|
7
|
+
|
|
8
|
+
## [0.1.9] - 2026-04-25
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- Clarified the global extension path and `PI_CODING_AGENT_DIR` override behavior in README installation and configuration guidance
|
|
12
|
+
- Updated `@mariozechner/pi-coding-agent` and `@mariozechner/pi-tui` peer dependencies to ^0.70.2
|
|
13
|
+
|
|
14
|
+
## [0.1.7] - 2026-04-01
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- Updated npm keywords and package metadata for improved discoverability
|
|
18
|
+
|
|
19
|
+
## [0.1.6] - 2026-04-01
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
- Updated `@mariozechner/pi-coding-agent` and `@mariozechner/pi-tui` peer dependencies to ^0.64.0
|
|
23
|
+
|
|
24
|
+
## [0.1.5] - 2026-03-23
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
- Updated `@mariozechner/pi-coding-agent` and `@mariozechner/pi-tui` peer dependencies to ^0.62.0
|
|
28
|
+
|
|
29
|
+
## [0.1.4] - 2026-03-12
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
- Updated AWS SDK and related dependencies
|
|
33
|
+
|
|
34
|
+
## [0.1.3] - 2026-03-04
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
- Use absolute GitHub raw URL for README image to fix npm display
|
|
38
|
+
|
|
39
|
+
## [0.1.2] - 2026-03-04
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
- Rewrote README.md with professional documentation standards
|
|
43
|
+
- Added comprehensive feature documentation, configuration reference, and usage examples
|
|
44
|
+
|
|
45
|
+
## 0.1.1
|
|
46
|
+
|
|
47
|
+
- Added `asset/` to the npm `files` whitelist so README image assets are included in package tarballs.
|
|
48
|
+
- Bumped patch version for republish.
|
|
49
|
+
|
|
50
|
+
## 0.1.0
|
|
51
|
+
|
|
52
|
+
- Standardized repository structure with `src/` layout and root shim entrypoint.
|
|
53
|
+
- Kept terminal clear-sequence patch behavior unchanged.
|
package/package.json
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "pi-startup-redraw-fix",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Pi extension that patches terminal full-clear ordering to avoid startup redraw glitches.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./index.ts",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": "./index.ts"
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"index.ts",
|
|
12
|
-
"src",
|
|
13
|
-
"asset",
|
|
14
|
-
"config/config.example.json",
|
|
15
|
-
"README.md",
|
|
16
|
-
"CHANGELOG.md",
|
|
17
|
-
"LICENSE"
|
|
18
|
-
],
|
|
19
|
-
"scripts": {
|
|
20
|
-
"build": "npx --yes -p typescript@5.7.3 tsc -p tsconfig.json --noCheck",
|
|
21
|
-
"lint": "npm run build",
|
|
22
|
-
"test": "
|
|
23
|
-
"check": "npm run lint && npm run test"
|
|
24
|
-
},
|
|
25
|
-
"keywords": [
|
|
26
|
-
"pi-package",
|
|
27
|
-
"pi",
|
|
28
|
-
"pi-extension",
|
|
29
|
-
"pi-coding-agent",
|
|
30
|
-
"pi-tui",
|
|
31
|
-
"coding-agent",
|
|
32
|
-
"terminal",
|
|
33
|
-
"terminal-emulator",
|
|
34
|
-
"startup",
|
|
35
|
-
"startup-fix",
|
|
36
|
-
"redraw",
|
|
37
|
-
"bugfix"
|
|
38
|
-
],
|
|
39
|
-
"author": "MasuRii",
|
|
40
|
-
"license": "MIT",
|
|
41
|
-
"repository": {
|
|
42
|
-
"type": "git",
|
|
43
|
-
"url": "git+https://github.com/MasuRii/pi-startup-redraw-fix.git"
|
|
44
|
-
},
|
|
45
|
-
"bugs": {
|
|
46
|
-
"url": "https://github.com/MasuRii/pi-startup-redraw-fix/issues"
|
|
47
|
-
},
|
|
48
|
-
"homepage": "https://github.com/MasuRii/pi-startup-redraw-fix#readme",
|
|
49
|
-
"engines": {
|
|
50
|
-
"node": ">=20"
|
|
51
|
-
},
|
|
52
|
-
"publishConfig": {
|
|
53
|
-
"access": "public"
|
|
54
|
-
},
|
|
55
|
-
"pi": {
|
|
56
|
-
"extensions": [
|
|
57
|
-
"./index.ts"
|
|
58
|
-
]
|
|
59
|
-
},
|
|
60
|
-
"peerDependencies": {
|
|
61
|
-
"@
|
|
62
|
-
"@
|
|
63
|
-
}
|
|
64
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "pi-startup-redraw-fix",
|
|
3
|
+
"version": "0.1.10",
|
|
4
|
+
"description": "Pi extension that patches terminal full-clear ordering to avoid startup redraw glitches.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./index.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./index.ts"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"index.ts",
|
|
12
|
+
"src",
|
|
13
|
+
"asset",
|
|
14
|
+
"config/config.example.json",
|
|
15
|
+
"README.md",
|
|
16
|
+
"CHANGELOG.md",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "npx --yes -p typescript@5.7.3 tsc -p tsconfig.json --noCheck",
|
|
21
|
+
"lint": "npm run build",
|
|
22
|
+
"test": "npx --yes tsx --test normalize-clear-sequence.test.mjs",
|
|
23
|
+
"check": "npm run lint && npm run test"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"pi-package",
|
|
27
|
+
"pi",
|
|
28
|
+
"pi-extension",
|
|
29
|
+
"pi-coding-agent",
|
|
30
|
+
"pi-tui",
|
|
31
|
+
"coding-agent",
|
|
32
|
+
"terminal",
|
|
33
|
+
"terminal-emulator",
|
|
34
|
+
"startup",
|
|
35
|
+
"startup-fix",
|
|
36
|
+
"redraw",
|
|
37
|
+
"bugfix"
|
|
38
|
+
],
|
|
39
|
+
"author": "MasuRii",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git+https://github.com/MasuRii/pi-startup-redraw-fix.git"
|
|
44
|
+
},
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/MasuRii/pi-startup-redraw-fix/issues"
|
|
47
|
+
},
|
|
48
|
+
"homepage": "https://github.com/MasuRii/pi-startup-redraw-fix#readme",
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=20"
|
|
51
|
+
},
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public"
|
|
54
|
+
},
|
|
55
|
+
"pi": {
|
|
56
|
+
"extensions": [
|
|
57
|
+
"./index.ts"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"@earendil-works/pi-coding-agent": "^0.75.4",
|
|
62
|
+
"@earendil-works/pi-tui": "^0.75.4"
|
|
63
|
+
}
|
|
64
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@
|
|
2
|
-
|
|
3
|
-
import { applyTerminalClearSequencePatch } from "./terminal-clear-patch.js";
|
|
4
|
-
|
|
5
|
-
export default function startupRedrawFixExtension(pi: ExtensionAPI): void {
|
|
6
|
-
const patchResult = applyTerminalClearSequencePatch();
|
|
7
|
-
|
|
8
|
-
pi.on("session_start", async (_event, ctx) => {
|
|
9
|
-
if (!ctx.hasUI) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (!patchResult.patched && !patchResult.alreadyPatched) {
|
|
14
|
-
const reason = patchResult.error ?? "unknown error";
|
|
15
|
-
ctx.ui.notify(`startup-redraw-fix: failed to patch terminal clear sequence (${reason})`, "warning");
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
|
|
3
|
+
import { applyTerminalClearSequencePatch } from "./terminal-clear-patch.js";
|
|
4
|
+
|
|
5
|
+
export default function startupRedrawFixExtension(pi: ExtensionAPI): void {
|
|
6
|
+
const patchResult = applyTerminalClearSequencePatch();
|
|
7
|
+
|
|
8
|
+
pi.on("session_start", async (_event, ctx) => {
|
|
9
|
+
if (!ctx.hasUI) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (!patchResult.patched && !patchResult.alreadyPatched) {
|
|
14
|
+
const reason = patchResult.error ?? "unknown error";
|
|
15
|
+
ctx.ui.notify(`startup-redraw-fix: failed to patch terminal clear sequence (${reason})`, "warning");
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { ProcessTerminal } from "@
|
|
2
|
-
|
|
3
|
-
import { normalizeTerminalClearSequence } from "./normalize-clear-sequence.js";
|
|
4
|
-
|
|
5
|
-
const PATCH_FLAG_KEY = "__piStartupRedrawFixPatched__" as const;
|
|
6
|
-
|
|
7
|
-
type ProcessTerminalPrototype = typeof ProcessTerminal.prototype & {
|
|
8
|
-
[PATCH_FLAG_KEY]?: boolean;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export interface PatchResult {
|
|
12
|
-
patched: boolean;
|
|
13
|
-
alreadyPatched: boolean;
|
|
14
|
-
error?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function applyTerminalClearSequencePatch(): PatchResult {
|
|
18
|
-
const prototype = ProcessTerminal.prototype as ProcessTerminalPrototype;
|
|
19
|
-
|
|
20
|
-
if (prototype[PATCH_FLAG_KEY]) {
|
|
21
|
-
return { patched: false, alreadyPatched: true };
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const originalWrite = prototype.write;
|
|
25
|
-
if (typeof originalWrite !== "function") {
|
|
26
|
-
return {
|
|
27
|
-
patched: false,
|
|
28
|
-
alreadyPatched: false,
|
|
29
|
-
error: "ProcessTerminal.write is unavailable",
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
prototype.write = function patchedProcessTerminalWrite(data: string): void {
|
|
34
|
-
const normalized = typeof data === "string"
|
|
35
|
-
? normalizeTerminalClearSequence(data)
|
|
36
|
-
: data;
|
|
37
|
-
|
|
38
|
-
originalWrite.call(this, normalized);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
prototype[PATCH_FLAG_KEY] = true;
|
|
42
|
-
|
|
43
|
-
return { patched: true, alreadyPatched: false };
|
|
44
|
-
}
|
|
1
|
+
import { ProcessTerminal } from "@earendil-works/pi-tui";
|
|
2
|
+
|
|
3
|
+
import { normalizeTerminalClearSequence } from "./normalize-clear-sequence.js";
|
|
4
|
+
|
|
5
|
+
const PATCH_FLAG_KEY = "__piStartupRedrawFixPatched__" as const;
|
|
6
|
+
|
|
7
|
+
type ProcessTerminalPrototype = typeof ProcessTerminal.prototype & {
|
|
8
|
+
[PATCH_FLAG_KEY]?: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export interface PatchResult {
|
|
12
|
+
patched: boolean;
|
|
13
|
+
alreadyPatched: boolean;
|
|
14
|
+
error?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function applyTerminalClearSequencePatch(): PatchResult {
|
|
18
|
+
const prototype = ProcessTerminal.prototype as ProcessTerminalPrototype;
|
|
19
|
+
|
|
20
|
+
if (prototype[PATCH_FLAG_KEY]) {
|
|
21
|
+
return { patched: false, alreadyPatched: true };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const originalWrite = prototype.write;
|
|
25
|
+
if (typeof originalWrite !== "function") {
|
|
26
|
+
return {
|
|
27
|
+
patched: false,
|
|
28
|
+
alreadyPatched: false,
|
|
29
|
+
error: "ProcessTerminal.write is unavailable",
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
prototype.write = function patchedProcessTerminalWrite(data: string): void {
|
|
34
|
+
const normalized = typeof data === "string"
|
|
35
|
+
? normalizeTerminalClearSequence(data)
|
|
36
|
+
: data;
|
|
37
|
+
|
|
38
|
+
originalWrite.call(this, normalized);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
prototype[PATCH_FLAG_KEY] = true;
|
|
42
|
+
|
|
43
|
+
return { patched: true, alreadyPatched: false };
|
|
44
|
+
}
|