mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-18 17:20:38 -07:00
Fix multiple bugs with auth flow including using the implemented but unused restart support. (#13565)
This commit is contained in:
50
packages/core/src/utils/terminal.ts
Normal file
50
packages/core/src/utils/terminal.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { writeToStdout } from './stdio.js';
|
||||
|
||||
export function enableMouseEvents() {
|
||||
// Enable mouse tracking with SGR format
|
||||
// ?1002h = button event tracking (clicks + drags + scroll wheel)
|
||||
// ?1006h = SGR extended mouse mode (better coordinate handling)
|
||||
writeToStdout('\u001b[?1002h\u001b[?1006h');
|
||||
}
|
||||
|
||||
export function disableMouseEvents() {
|
||||
// Disable mouse tracking with SGR format
|
||||
writeToStdout('\u001b[?1006l\u001b[?1002l');
|
||||
}
|
||||
|
||||
export function enableKittyKeyboardProtocol() {
|
||||
writeToStdout('\x1b[>1u');
|
||||
}
|
||||
|
||||
export function disableKittyKeyboardProtocol() {
|
||||
writeToStdout('\x1b[<u');
|
||||
}
|
||||
|
||||
export function enableLineWrapping() {
|
||||
writeToStdout('\x1b[?7h');
|
||||
}
|
||||
|
||||
export function disableLineWrapping() {
|
||||
writeToStdout('\x1b[?7l');
|
||||
}
|
||||
|
||||
export function enterAlternateScreen() {
|
||||
writeToStdout('\x1b[?1049h');
|
||||
}
|
||||
|
||||
export function exitAlternateScreen() {
|
||||
writeToStdout('\x1b[?1049l');
|
||||
}
|
||||
|
||||
export function shouldEnterAlternateScreen(
|
||||
useAlternateBuffer: boolean,
|
||||
isScreenReader: boolean,
|
||||
): boolean {
|
||||
return useAlternateBuffer && !isScreenReader;
|
||||
}
|
||||
Reference in New Issue
Block a user