fix(coding-agent): avoid crash of /settings with small width

This commit is contained in:
haoqixu 2026-02-04 15:17:22 +08:00
parent 6cc1676eae
commit ed4168bff4
2 changed files with 14 additions and 11 deletions

View file

@ -118,7 +118,7 @@ export class FooterComponent implements Component {
// Truncate path if too long to fit width
if (pwd.length > width) {
const half = Math.floor(width / 2) - 2;
if (half > 0) {
if (half > 1) {
const start = pwd.slice(0, half);
const end = pwd.slice(-(half - 1));
pwd = `${start}...${end}`;