Fix SelectList crash on narrow terminal and thinking level restoration

SelectList fixes:
- Use hardcoded visual width for arrow prefix instead of string length
  which includes ANSI codes
- Truncate scroll indicator text to prevent exceeding terminal width
- Fixes crash when terminal is resized narrow and arrow keys are pressed

Thinking level fix:
- Restore thinking level even if it's "off" (removed !== "off" check)
- This ensures the thinking level selector shows the correct state on continue
This commit is contained in:
Mario Zechner 2025-11-11 23:47:59 +01:00
parent cef526ce4d
commit a3b3849188
3 changed files with 274 additions and 6 deletions

View file

@ -230,7 +230,7 @@ export async function main(args: string[]) {
// Load and restore thinking level
const thinkingLevel = sessionManager.loadThinkingLevel() as ThinkingLevel;
if (thinkingLevel && thinkingLevel !== "off") {
if (thinkingLevel) {
agent.setThinkingLevel(thinkingLevel);
console.log(chalk.dim(`Restored thinking level: ${thinkingLevel}`));
}