revert: remove unnecessary themeOverride params from theme functions

The optional theme parameter was added as a workaround for tsx dev mode,
but that's a dev-only issue. Users running the built package don't need it.
This commit is contained in:
Mario Zechner 2026-01-04 20:27:46 +01:00
parent 7302fe5063
commit 00fa8b71c8
3 changed files with 13 additions and 30 deletions

View file

@ -1132,21 +1132,6 @@ import { getPackageDir, getThemeDir } from "./paths.js";
Never use `__dirname` directly for package assets.
### Module Resolution with tsx
When running from source via `npx tsx src/cli.ts`, hooks loaded via jiti may get separate module instances from the main app. This can cause issues with global state (like the theme object).
**Workaround**: Functions like `getSettingsListTheme()` accept an optional theme parameter. In hooks, pass the theme from `ctx.ui.custom()`:
```typescript
await ctx.ui.custom((tui, theme, done) => {
const settingsTheme = getSettingsListTheme(theme);
// ...
});
```
When running the built version (`node dist/cli.js` or installed via npm), this is not an issue.
### Debug Command
`/debug` (hidden) writes rendered lines with ANSI codes to `~/.pi/agent/pi-debug.log` for TUI debugging, as well as the last set of messages that were sent to the LLM.