fix(tui): restored compact editor border by default

- Restored the compact two-row `Editor` layout by default and gated the dedicated IME-safe bottom border behind `setImeSafeCursorLayout()`.
- Added `tui.imeSafeCursor` as an opt-in appearance setting and applied it to initial and replacement editors.
- Added regression coverage for compact default rendering while retaining terminal-local IME preedit protection.
- Updated the TUI changelog for the opt-in compatibility layout.
This commit is contained in:
can1357
2026-07-15 13:16:07 +02:00
parent 28d4e71b0a
commit f3aad14ee9
5 changed files with 38 additions and 9 deletions
@@ -982,6 +982,17 @@ export const SETTINGS_SCHEMA = {
},
},
"tui.imeSafeCursor": {
type: "boolean",
default: false,
ui: {
tab: "appearance",
group: "Display",
label: "IME-Safe Prompt Layout",
description: "Move the prompt's bottom border to a separate row so macOS IME preedit cannot displace it",
},
},
// ────────────────────────────────────────────────────────────────────────
// Model
// ────────────────────────────────────────────────────────────────────────
@@ -680,6 +680,7 @@ export class InteractiveMode implements InteractiveModeContext {
this.errorBannerContainer = new AnchoredLiveContainer();
this.modelCycleContainer = new AnchoredLiveContainer();
this.editor = new CustomEditor(getEditorTheme());
this.editor.setImeSafeCursorLayout(settings.get("tui.imeSafeCursor"));
this.editor.setUseTerminalCursor(this.ui.getShowHardwareCursor());
this.editor.setAutocompleteMaxVisible(settings.get("autocompleteMaxVisible"));
this.editor.onAutocompleteCancel = () => {
@@ -3669,6 +3670,7 @@ export class InteractiveMode implements InteractiveModeContext {
factory: ((tui: TUI, theme: EditorTheme, keybindings: KeybindingsManager) => CustomEditor) | undefined,
): void {
const previousEditor = this.editor;
nextEditor.setImeSafeCursorLayout(this.settings.get("tui.imeSafeCursor"));
const previousText = previousEditor.getText();
const nextEditor = factory
? factory(this.ui, getEditorTheme(), this.keybindings)