Files
oh-my-pi/packages/coding-agent/src/exec/non-interactive-env.ts
T
can1357 76a921f284 fix: apply non-interactive env to all bash execution paths
The non-interactive environment variables (pager, editor, and prompt
suppression) were only applied in the PTY (interactive) bash path.
The non-PTY executeBash path had no such defaults, so commands could
block on pagers or credential prompts.

- Extract NO_PAGER_ENV from bash-interactive.ts into shared
  non-interactive-env.ts module (renamed to NON_INTERACTIVE_ENV)
- Apply it in executeBash (non-PTY) with user overrides taking
  precedence
- Fix ordering in interactive PTY path so user env overrides
  the defaults (was reversed)
- Add test verifying defaults are applied alongside user env
2026-02-24 02:57:43 +01:00

44 lines
1.2 KiB
TypeScript

export const NON_INTERACTIVE_ENV: Readonly<Record<string, string>> = {
// Disable pagers so commands don't block on interactive views.
PAGER: "cat",
GIT_PAGER: "cat",
MANPAGER: "cat",
SYSTEMD_PAGER: "cat",
BAT_PAGER: "cat",
DELTA_PAGER: "cat",
GH_PAGER: "cat",
GLAB_PAGER: "cat",
PSQL_PAGER: "cat",
MYSQL_PAGER: "cat",
AWS_PAGER: "",
HOMEBREW_PAGER: "cat",
LESS: "FRX",
// Disable editor and terminal credential prompts.
GIT_EDITOR: "true",
VISUAL: "true",
EDITOR: "true",
GIT_TERMINAL_PROMPT: "0",
SSH_ASKPASS: "/usr/bin/false",
CI: "1",
// Package manager defaults for unattended execution.
npm_config_yes: "true",
npm_config_update_notifier: "false",
npm_config_fund: "false",
npm_config_audit: "false",
npm_config_progress: "false",
PNPM_DISABLE_SELF_UPDATE_CHECK: "true",
PNPM_UPDATE_NOTIFIER: "false",
YARN_ENABLE_TELEMETRY: "0",
YARN_ENABLE_PROGRESS_BARS: "0",
// Cross-language/tooling non-interactive defaults.
CARGO_TERM_PROGRESS_WHEN: "never",
DEBIAN_FRONTEND: "noninteractive",
PIP_NO_INPUT: "1",
PIP_DISABLE_PIP_VERSION_CHECK: "1",
TF_INPUT: "0",
TF_IN_AUTOMATION: "1",
GH_PROMPT_DISABLED: "1",
COMPOSER_NO_INTERACTION: "1",
CLOUDSDK_CORE_DISABLE_PROMPTS: "1",
};