pi-sync-system-theme 0.2.4 → 0.2.5
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 +1 -0
- package/index.ts +16 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -118,6 +118,7 @@ export PI_SYSTEM_THEME_OSC11_ENABLED=0
|
|
|
118
118
|
- **SSH:** Works transparently — no special setup required
|
|
119
119
|
- **tmux:** Supported (including long-lived sessions where `SSH_*` env vars may be missing)
|
|
120
120
|
- **Ghostty `theme = auto`:** Fully supported. When Ghostty switches colors, the next poll detects it.
|
|
121
|
+
- **Session resume:** On `/resume`, the extension immediately re-checks appearance and reconciles the active theme.
|
|
121
122
|
|
|
122
123
|
## Migrating from pi-system-theme
|
|
123
124
|
|
package/index.ts
CHANGED
|
@@ -627,20 +627,34 @@ export default function systemThemeBridge(pi: ExtensionAPI): void {
|
|
|
627
627
|
|
|
628
628
|
// -- Lifecycle ------------------------------------------------------------
|
|
629
629
|
|
|
630
|
-
|
|
631
|
-
config = await loadConfig();
|
|
630
|
+
function resetOsc11State(): void {
|
|
632
631
|
osc11State.lastCheckedAt = 0;
|
|
633
632
|
osc11State.lastAppearance = null;
|
|
634
633
|
osc11State.failures = 0;
|
|
635
634
|
osc11State.disabledUntil = 0;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
async function applyOnSessionEnter(ctx: ExtensionContext): Promise<void> {
|
|
638
|
+
config = await loadConfig();
|
|
639
|
+
resetOsc11State();
|
|
636
640
|
|
|
637
641
|
if (!shouldAutoSync(ctx)) {
|
|
638
642
|
maybeWarnCustomTheme(ctx);
|
|
639
643
|
return;
|
|
640
644
|
}
|
|
641
645
|
|
|
646
|
+
// Force immediate theme reconciliation when entering a session
|
|
647
|
+
// (especially important after /resume from a differently-themed session).
|
|
642
648
|
await tick(ctx);
|
|
643
649
|
restartPolling(ctx);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
pi.on("session_start", async (_event, ctx) => {
|
|
653
|
+
await applyOnSessionEnter(ctx);
|
|
654
|
+
});
|
|
655
|
+
|
|
656
|
+
pi.on("session_switch", async (_event, ctx) => {
|
|
657
|
+
await applyOnSessionEnter(ctx);
|
|
644
658
|
});
|
|
645
659
|
|
|
646
660
|
pi.on("session_shutdown", () => {
|