@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user