From a52383d7f793a393d0b1a3b45ed3cd6cece09ff9 Mon Sep 17 00:00:00 2001 From: Andrew Baldwin Date: Sat, 25 Oct 2025 21:26:27 +0200 Subject: [PATCH] Rename env variable --- docs/FAQ.md | 2 +- src/node/cli.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/FAQ.md b/docs/FAQ.md index 5f87a7c6d..a695cc64a 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -323,7 +323,7 @@ As long as there is an active browser connection, code-server touches If you want to shutdown code-server if there hasn't been an active connection after a predetermined amount of time, you can use the --idle-timeout-seconds flag -or set an `IDLE_TIMEOUT_SECONDS` environment variable. +or set an `CODE_SERVER_IDLE_TIMEOUT_SECONDS` environment variable. ## How do I change the password? diff --git a/src/node/cli.ts b/src/node/cli.ts index 80e21556d..0fce9cfbf 100644 --- a/src/node/cli.ts +++ b/src/node/cli.ts @@ -620,14 +620,14 @@ export async function setDefaults(cliArgs: UserProvidedArgs, configArgs?: Config args["github-auth"] = process.env.GITHUB_TOKEN } - if (process.env.IDLE_TIMEOUT_SECONDS) { - if (isNaN(Number(process.env.IDLE_TIMEOUT_SECONDS))) { - logger.info("IDLE_TIMEOUT_SECONDS must be a number") + if (process.env.CODE_SERVER_IDLE_TIMEOUT_SECONDS) { + if (isNaN(Number(process.env.CODE_SERVER_IDLE_TIMEOUT_SECONDS))) { + logger.info("CODE_SERVER_IDLE_TIMEOUT_SECONDS must be a number") } - if (Number(process.env.IDLE_TIMEOUT_SECONDS)) { + if (Number(process.env.CODE_SERVER_IDLE_TIMEOUT_SECONDS) <= 60) { throw new Error("--idle-timeout-seconds must be greater than 60 seconds.") } - args["idle-timeout-seconds"] = Number(process.env.IDLE_TIMEOUT_SECONDS) + args["idle-timeout-seconds"] = Number(process.env.CODE_SERVER_IDLE_TIMEOUT_SECONDS) } // Ensure they're not readable by child processes.