Use visibleWidth/truncateToWidth for footer path and stats truncation so wide Unicode text cannot overflow terminal width.
Add regression tests for wide session/model/provider names and document the fix in changelog.
closes#1833
The previous fix (83b57924) replaced require.resolve() with bare
specifier fallbacks to avoid ERR_PACKAGE_PATH_NOT_EXPORTED for ESM-only
packages like pi-ai. However, bare specifiers are not valid jiti alias
targets, breaking extension loading in global npm installs.
Use import.meta.resolve() as the fallback instead. It respects the
"import" exports condition and returns a real file path.
When enabled, /tree navigation skips the 'Summarize branch?' prompt and
defaults to no summary, reducing friction for users who never want branch
summaries.
Closes#1791
GNU screen does not support truecolor escape sequences. When pi emits
truecolor SGR sequences (e.g. \x1b[38;2;102;102;102m for the dim color
#666666), screen misparses the semicolon-separated parameters as
individual SGR codes. The RGB value 102;102;102 maps directly to
SGR 102 (bright green background), which then bleeds into every
subsequent \x1b[2K line-erase, producing a bright green background
on most info/status messages.
detectColorMode() now returns '256color' for any TERM value that is
'screen', starts with 'screen-' (e.g. screen-256color), or starts
with 'screen.' (e.g. screen.xterm-256color). The existing COLORTERM
check at the top of the function already handles the opt-in case for
users who have configured screen's truecolor passthrough.
Messages submitted while a branch summary was being generated were
processed immediately instead of being queued. This happened because
isCompacting only checked compaction abort controllers, not the branch
summary abort controller.
Include _branchSummaryAbortController in the isCompacting getter so all
existing guards (message queueing, reload blocking) also apply during
branch summarization.
The truncation logic and error handling added in e1d3c2b7 (Dec 4, 2025)
was lost when message handling was refactored from slack.ts to main.ts.
Changes:
- Add try/catch to all Slack message functions (respond, replaceMessage,
respondInThread, setTyping, setWorking)
- Truncate main messages at 35K chars (Slack limit 40K)
- Truncate thread messages at 20K chars
- Add helpful user-facing notes when truncation occurs
- Log Slack API errors as warnings instead of crashing
Fixes: msg_too_long API errors causing process crash
Co-authored-by: mom bot <mom-bot@living-bio.iam.gserviceaccount.com>
Koffi is only used on Windows for VT input support and fails to build
on Termux/Android and Linux systems without build tools. Moving it to
optionalDependencies allows installation to succeed on all platforms
while maintaining Windows functionality.
strip-ansi is imported in bash-executor.ts and two interactive mode
components but is not declared in package.json dependencies. This
causes ERR_MODULE_NOT_FOUND at runtime in strict package managers
like pnpm that do not hoist undeclared dependencies.
Co-authored-by: Graadient <graadient@users.noreply.github.com>