feat(cli): Add setting to show status(or Gemini 's thoughts) in terminal title and taskbar icon (#4386)

Co-authored-by: Jacob Richman <jacob314@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Fridayxiao
2025-09-28 03:48:24 +08:00
committed by GitHub
parent 0b2d79a2ea
commit 331e2ce45d
8 changed files with 536 additions and 35 deletions

View File

@@ -0,0 +1,22 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* Computes the window title for the Gemini CLI application.
*
* @param folderName - The name of the current folder/workspace to display in the title
* @returns The computed window title, either from CLI_TITLE environment variable or the default Gemini title
*/
export function computeWindowTitle(folderName: string): string {
const title = process.env['CLI_TITLE'] || `Gemini - ${folderName}`;
// Remove control characters that could cause issues in terminal titles
return title.replace(
// eslint-disable-next-line no-control-regex
/[\x00-\x1F\x7F]/g,
'',
);
}