fix(coding-agent): configure inline tool image width

closes #3508
This commit is contained in:
Mario Zechner
2026-04-22 00:56:01 +02:00
parent 780d536727
commit 97a38bf652
6 changed files with 57 additions and 3 deletions

View File

@@ -25,6 +25,7 @@ export interface RetrySettings {
export interface TerminalSettings {
showImages?: boolean; // default: true (only relevant if terminal supports images)
imageWidthCells?: number; // default: 60 (preferred inline image width in terminal cells)
clearOnShrink?: boolean; // default: false (clear empty rows when content shrinks)
}
@@ -870,6 +871,23 @@ export class SettingsManager {
this.save();
}
getImageWidthCells(): number {
const width = this.settings.terminal?.imageWidthCells;
if (typeof width !== "number" || !Number.isFinite(width)) {
return 60;
}
return Math.max(1, Math.floor(width));
}
setImageWidthCells(width: number): void {
if (!this.globalSettings.terminal) {
this.globalSettings.terminal = {};
}
this.globalSettings.terminal.imageWidthCells = Math.max(1, Math.floor(width));
this.markModified("terminal", "imageWidthCells");
this.save();
}
getClearOnShrink(): boolean {
// Settings takes precedence, then env var, then default false
if (this.settings.terminal?.clearOnShrink !== undefined) {