Skip to content

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

@recsater

Description

@recsater

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%

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage-neededNeeds assignment to the proper sub-team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions