mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-15 14:23:02 -07:00
Switch to alternate buffer mode before rendering Ink. (#12833)
This commit is contained in:
Generated
+5
-4
@@ -11,6 +11,7 @@
|
||||
"packages/*"
|
||||
],
|
||||
"dependencies": {
|
||||
"ink": "npm:@jrichman/ink@6.4.2",
|
||||
"latest-version": "^9.0.0",
|
||||
"simple-git": "^3.28.0"
|
||||
},
|
||||
@@ -9885,9 +9886,9 @@
|
||||
},
|
||||
"node_modules/ink": {
|
||||
"name": "@jrichman/ink",
|
||||
"version": "6.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@jrichman/ink/-/ink-6.4.1.tgz",
|
||||
"integrity": "sha512-YeNdpjFjq7Qbu9FQDQiCNmw4QehoBWi9pMEr52ZM4xLwQkYNtzyi/J5169NPLQCX2kl1WepngoUrzWvuFmjeSA==",
|
||||
"version": "6.4.2",
|
||||
"resolved": "https://registry.npmjs.org/@jrichman/ink/-/ink-6.4.2.tgz",
|
||||
"integrity": "sha512-jfne1I/8+kVhzY/aoIWUKS0adPNRUhnN/wEsdBtSheyAp0b3c94zVsWWyDxnfXKL3RqOd40/H1FFaPLTUwjLXQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@alcalzone/ansi-tokenize": "^0.2.1",
|
||||
@@ -17265,7 +17266,7 @@
|
||||
"fzf": "^0.5.2",
|
||||
"glob": "^10.4.5",
|
||||
"highlight.js": "^11.11.1",
|
||||
"ink": "npm:@jrichman/ink@6.4.1",
|
||||
"ink": "npm:@jrichman/ink@6.4.2",
|
||||
"ink-gradient": "^3.0.0",
|
||||
"ink-spinner": "^5.0.0",
|
||||
"latest-version": "^9.0.0",
|
||||
|
||||
+2
-1
@@ -61,7 +61,7 @@
|
||||
"pre-commit": "node scripts/pre-commit.js"
|
||||
},
|
||||
"overrides": {
|
||||
"ink": "npm:@jrichman/ink@6.4.1",
|
||||
"ink": "npm:@jrichman/ink@6.4.2",
|
||||
"wrap-ansi": "9.0.2",
|
||||
"cliui": {
|
||||
"wrap-ansi": "7.0.0"
|
||||
@@ -118,6 +118,7 @@
|
||||
"yargs": "^17.7.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"ink": "npm:@jrichman/ink@6.4.2",
|
||||
"latest-version": "^9.0.0",
|
||||
"simple-git": "^3.28.0"
|
||||
},
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
"fzf": "^0.5.2",
|
||||
"glob": "^10.4.5",
|
||||
"highlight.js": "^11.11.1",
|
||||
"ink": "npm:@jrichman/ink@6.4.1",
|
||||
"ink": "npm:@jrichman/ink@6.4.2",
|
||||
"ink-gradient": "^3.0.0",
|
||||
"ink-spinner": "^5.0.0",
|
||||
"latest-version": "^9.0.0",
|
||||
|
||||
@@ -73,6 +73,7 @@ import { createPolicyUpdater } from './config/policy.js';
|
||||
import { requestConsentNonInteractive } from './config/extensions/consent.js';
|
||||
import { disableMouseEvents, enableMouseEvents } from './ui/utils/mouse.js';
|
||||
import { ScrollProvider } from './ui/contexts/ScrollProvider.js';
|
||||
import ansiEscapes from 'ansi-escapes';
|
||||
|
||||
const SLOW_RENDER_MS = 200;
|
||||
|
||||
@@ -233,6 +234,7 @@ export async function startInteractiveUI(
|
||||
}
|
||||
},
|
||||
alternateBuffer: settings.merged.ui?.useAlternateBuffer,
|
||||
alternateBufferAlreadyActive: settings.merged.ui?.useAlternateBuffer,
|
||||
},
|
||||
);
|
||||
|
||||
@@ -420,6 +422,12 @@ export async function main() {
|
||||
// input showing up in the output.
|
||||
process.stdin.setRawMode(true);
|
||||
|
||||
if (settings.merged.ui?.useAlternateBuffer) {
|
||||
process.stdout.write(ansiEscapes.enterAlternativeScreen);
|
||||
|
||||
// Ink will cleanup so there is no need for us to manually cleanup.
|
||||
}
|
||||
|
||||
// This cleanup isn't strictly needed but may help in certain situations.
|
||||
process.on('SIGTERM', () => {
|
||||
process.stdin.setRawMode(wasRaw);
|
||||
|
||||
Reference in New Issue
Block a user