Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions Added to bin/activate in the Virtual Environment Are Not Working #24550

Closed
recsater opened this issue Dec 6, 2024 · 2 comments
Closed
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@recsater
Copy link

recsater commented Dec 6, 2024

Type: Bug

Behaviour

The functions added to the activate script in the virtual environment are not functioning properly. While environment variables set via export can be verified in the terminal, the functions cannot be found.

Steps to reproduce:

  1. Open the /bin/activate script.
  2. Add the following lines at the end of the file:
export test=1
qwe () { 
command echo qwe 
}
  1. Verify the result by running the following commands:
echo $test  # prints 'test'
qwe         # qwe: command not found
  1. Manually sourcing the script works as expected.
source <venv>/bin/activate
qwe # prints 'qwe'

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

Extension version: 2024.20.0
VS Code version: Code 1.95.3 (f1a4fb101478ce6ec82fe9627c43efbf9e98c813, 2024-11-13T14:50:04.152Z)
OS version: Linux x64 6.8.0-49-generic
Modes:
Remote OS version: Linux x64 6.8.0-49-generic

System Info
Item Value
CPUs Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz (16 x 4599)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
webnn: disabled_off
Load (avg) 1, 1, 1
Memory (System) 62.73GB (32.49GB free)
Process Argv --crash-reporter-id 3b34a8a1-42be-48ca-bf66-b7198c02f9c8
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11
Item Value
Remote Container xeye0324/ros:atd-34-plan_linux_amd64 (atd-34-plan_linux_amd64)
OS Linux x64 6.8.0-49-generic
CPUs Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz (16 x 4599)
Memory (System) 62.73GB (32.49GB free)
VM 0%
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Dec 6, 2024
@recsater
Copy link
Author

recsater commented Dec 6, 2024

Adding the following code to .vscode/settings.json resolves the issue:

"python.experiments.optOutFrom": [
    "pythonTerminalEnvVarActivation"
]

@karthiknadig
Copy link
Member

@recsater For now that is the work around. We are actually going to drop that experimental feature as it seems to break scenario like yours.

@karthiknadig karthiknadig closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants