Skip to content

Add "Don't Show Again" to env file notification#1393

Open
Copilot wants to merge 4 commits intomainfrom
copilot/fix-env-file-notification-bug
Open

Add "Don't Show Again" to env file notification#1393
Copilot wants to merge 4 commits intomainfrom
copilot/fix-env-file-notification-bug

Conversation

Copy link
Contributor

Copilot AI commented Mar 25, 2026

  • Add persistent state key and localized string for "Don't Show Again" button
  • Update terminalEnvVarInjector.ts to use showInformationMessage wrapper, check persistent state, and handle "Don't Show Again" button
  • Localize the notification message string via ActivationStrings.envFileInjectionDisabled
  • Add unit tests for the new "Don't Show Again" behavior (5 new tests, all passing)
  • Run pre-commit checks (lint, type check, unit tests all pass — 806 total, 0 failures)

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Copilot AI and others added 2 commits March 25, 2026 16:05
Adds a "Don't Show Again" button to the information notification that
appears when an environment file is configured but terminal environment
injection is disabled. The preference is persisted in global state so
it survives between sessions.

- Add `Common.dontShowAgain` localized string
- Add `ENV_FILE_NOTIFICATION_DONT_SHOW_KEY` persistent state key
- Use `showInformationMessage` wrapper instead of direct `window` API
- Extract notification logic to `showEnvFileNotification()` method
- Add 5 unit tests covering the new behavior

Fixes #419

Co-authored-by: eleanorjboyd <[email protected]>
Agent-Logs-Url: https://github.com/microsoft/vscode-python-environments/sessions/d9efb122-775e-4477-9005-10a94641311d
Copilot AI changed the title [WIP] Fix notification for env file saving issue Add "Don't Show Again" to env file notification Mar 25, 2026
Copilot AI requested a review from eleanorjboyd March 25, 2026 16:07
@eleanorjboyd eleanorjboyd marked this pull request as ready for review March 25, 2026 17:12
@eleanorjboyd eleanorjboyd enabled auto-merge (squash) March 25, 2026 17:12
@eleanorjboyd eleanorjboyd added the bug Issue identified by VS Code Team member as probable bug label Mar 25, 2026
@eleanorjboyd eleanorjboyd added this to the 1.114.0 milestone Mar 25, 2026
@eleanorjboyd eleanorjboyd force-pushed the copilot/fix-env-file-notification-bug branch from c1c1dbf to 39f7531 Compare March 25, 2026 18:23
}

const result = await showInformationMessage(
'An environment file is configured but terminal environment injection is disabled. Enable "python.terminal.useEnvFile" to use environment variables from .env files in terminals.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Should this be localized too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good catch. Moved the notification message to ActivationStrings.envFileInjectionDisabled in localize.ts using l10n.t() in f799d79.

Copy link
Contributor Author

Copilot AI commented Mar 26, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh gh issue list --state open --limit 5 --json number,title,labels (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from edvilme March 26, 2026 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue identified by VS Code Team member as probable bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Notification shown whenever I save an env file

3 participants