mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
fix: Honor DEBUG and CLI_TITLE environment variables (#3560)
This commit is contained in:
committed by
GitHub
parent
c0940a194e
commit
2ed1b378cb
@@ -186,7 +186,11 @@ export async function loadCliConfig(
|
|||||||
sessionId: string,
|
sessionId: string,
|
||||||
): Promise<Config> {
|
): Promise<Config> {
|
||||||
const argv = await parseArguments();
|
const argv = await parseArguments();
|
||||||
const debugMode = argv.debug || false;
|
const debugMode =
|
||||||
|
argv.debug ||
|
||||||
|
[process.env.DEBUG, process.env.DEBUG_MODE].some(
|
||||||
|
(v) => v === 'true' || v === '1',
|
||||||
|
);
|
||||||
|
|
||||||
const activeExtensions = filterActiveExtensions(
|
const activeExtensions = filterActiveExtensions(
|
||||||
extensions,
|
extensions,
|
||||||
|
|||||||
@@ -222,7 +222,12 @@ export async function main() {
|
|||||||
|
|
||||||
function setWindowTitle(title: string, settings: LoadedSettings) {
|
function setWindowTitle(title: string, settings: LoadedSettings) {
|
||||||
if (!settings.merged.hideWindowTitle) {
|
if (!settings.merged.hideWindowTitle) {
|
||||||
process.stdout.write(`\x1b]2; Gemini - ${title} \x07`);
|
const windowTitle = (process.env.CLI_TITLE || `Gemini - ${title}`).replace(
|
||||||
|
// eslint-disable-next-line no-control-regex
|
||||||
|
/[\x00-\x1F\x7F]/g,
|
||||||
|
'',
|
||||||
|
);
|
||||||
|
process.stdout.write(`\x1b]2;${windowTitle}\x07`);
|
||||||
|
|
||||||
process.on('exit', () => {
|
process.on('exit', () => {
|
||||||
process.stdout.write(`\x1b]2;\x07`);
|
process.stdout.write(`\x1b]2;\x07`);
|
||||||
|
|||||||
Reference in New Issue
Block a user