⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 12, 2026

The notification warning users when python.terminal.useEnvFile is false repeatedly appears on every .env file change, with no way to dismiss it permanently.

Changes

  • Localization: Added dontShowAgain string to Common namespace in src/common/localize.ts

  • Notification logic (src/features/terminal/terminalEnvVarInjector.ts):

    • Introduced showEnvFileNotification() method that checks global persistent state before displaying
    • Added "Don't Show Again" button to showInformationMessage call
    • Stores user preference in global state with key dontShowEnvFileNotification
    • Replaced direct window.showInformationMessage call with wrapped API (windowApis.showInformationMessage)
  • added button to open settings ui from popup

  • Tests: Created terminalEnvVarInjectorNotification.unit.test.ts with coverage for notification display, dismissal behavior, and state persistence

Original prompt

This section details on the original issue you should resolve

<issue_title>[Python Environments] Environment file pop-up</issue_title>
<issue_description>
Type: Feature Request

Every time a .env file is created/edited anywhere in the workspace, and python.terminal.useEnvFile is false, a pop-up comes up explaining that environment injection is disabled. It would be good if this prompt had a "Don't show again" button, as it can happen quite frequently.

Image
Environment Information
Extension Version: 1.16.0
Python Extension Version: 2026.0.0

Registered Environment Managers (3):
  - ms-python.python:system (Global)
  - ms-python.python:venv (venv)
  - ms-python.python:pipenv (Pipenv)

Total Available Environments: 4
Environment Details:
  1. Python 3.14.0 (3.14.0.final.0) - /usr/local/bin/python
  2. Python 3.13.5 (3.13.5.final.0) - /bin/python3
  3. Python 3.13.5 (3.13.5.final.0) - /usr/bin/python3
  4. my-project (3.14.0) (3.14.0.final.0) - /workspaces/my-project/.venv/bin/python

Python Projects (1):
  1. /workspaces/my-project
     Environment: my-project (3.14.0)

Extension Settings:
  Default Environment Manager: ms-python.python:venv
  Default Package Manager: ms-python.python:pip
Auto-activation is "shellStartup". Activation based on first 'py-env.terminal.autoActivationType' setting which is 'shellStartup' and 'python.terminal.activateEnvironment' if the first is undefined which is 'true'.

Extension version: 1.16.0
VS Code version: Code 1.108.0 (94e8ae2b28cb5cc932b86e1070569c4463565c37, 2026-01-08T13:53:10.781Z)
OS version: Windows_NT x64 10.0.26200
Modes:
Remote OS version: Linux x64 6.6.87.2-microsoft-standard-WSL2

Comments on the Issue (you are @copilot in this section)

@eleanorjboyd great point!

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits January 12, 2026 16:21
- Added localized string 'dontShowAgain' in Common namespace
- Modified TerminalEnvVarInjector to check persistent state before showing notification
- Added showEnvFileNotification method with "Don't Show Again" button
- Created comprehensive unit tests for the notification functionality

Co-authored-by: eleanorjboyd <[email protected]>
- Changed terminalEnvVarInjector to use windowApis.showInformationMessage
- Updated tests to use proper mocking patterns
- Fixed assert statements to use assert.ok()
- Simplified test setup

Tests are still being refined but implementation code is complete and working.

Co-authored-by: eleanorjboyd <[email protected]>
- Updated docstring to use "Don't Show Again" with proper capitalization
- Verified test uses correct state key matching implementation
- Code review and security checks passed

Co-authored-by: eleanorjboyd <[email protected]>
Copilot AI changed the title [WIP] Add 'Don't show again' button for env pop-up Add "Don't Show Again" option to environment file notification Jan 12, 2026
Copilot AI requested a review from eleanorjboyd January 12, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Python Environments] Environment file pop-up

2 participants