Fix footer overflow on narrow terminals, add /arminsayshi easter egg

This commit is contained in:
Mario Zechner 2025-12-19 21:35:09 +01:00
parent 5095b4eb02
commit ad9d68e488
4 changed files with 407 additions and 5 deletions

View file

@ -188,11 +188,15 @@ export class FooterComponent implements Component {
}
// Truncate path if too long to fit width
const maxPathLength = Math.max(20, width - 10); // Leave some margin
if (pwd.length > maxPathLength) {
const start = pwd.slice(0, Math.floor(maxPathLength / 2) - 2);
const end = pwd.slice(-(Math.floor(maxPathLength / 2) - 1));
pwd = `${start}...${end}`;
if (pwd.length > width) {
const half = Math.floor(width / 2) - 2;
if (half > 0) {
const start = pwd.slice(0, half);
const end = pwd.slice(-(half - 1));
pwd = `${start}...${end}`;
} else {
pwd = pwd.slice(0, Math.max(1, width));
}
}
// Build stats line