fix(accessibility) allow line wrapper in screen reader mode (#11317)

This commit is contained in:
Jacob Richman
2025-10-16 20:38:49 -07:00
committed by GitHub
parent 406f0baaf2
commit d42da87161
2 changed files with 51 additions and 6 deletions
+8 -6
View File
@@ -145,7 +145,7 @@ export async function startInteractiveUI(
workspaceRoot: string = process.cwd(),
initializationResult: InitializationResult,
) {
// Disable line wrapping.
// When not in screen reader mode, disable line wrapping.
// We rely on Ink to manage all line wrapping by forcing all content to be
// narrower than the terminal width so there is no need for the terminal to
// also attempt line wrapping.
@@ -154,12 +154,14 @@ export async function startInteractiveUI(
// such as Ghostty. Some terminals such as Iterm2 only respect line wrapping
// when using the alternate buffer, which Gemini CLI does not use because we
// do not yet have support for scrolling in that mode.
process.stdout.write('\x1b[?7l');
if (!config.getScreenReader()) {
process.stdout.write('\x1b[?7l');
registerCleanup(() => {
// Re-enable line wrapping on exit.
process.stdout.write('\x1b[?7h');
});
registerCleanup(() => {
// Re-enable line wrapping on exit.
process.stdout.write('\x1b[?7h');
});
}
const version = await getCliVersion();
setWindowTitle(basename(workspaceRoot), settings);