microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.24k stars 8.27k forks source link

Path variable from the environment is not respected #18026

Open 0xEDApps opened 1 day ago

0xEDApps commented 1 day ago

Windows Terminal version

1.22.240926002-preview

Windows build number

10.0.22621.819

Other Software

No response

Steps to reproduce

run: cmd.exe type: set path=c:\tweet;%path% type your path to terminal: "C:\Users\Admino\AppData\Local\Temp\WindowsTerminal\x64\WindowsTerminal.exe" open a cmd window in terminal and type: path

WindowsTerminal.exe shows the right path "c:\tweet;...." OpenConsole.exe also shows the right path "c:\tweet;...." but then cmd.exe has a different path

Expected Behavior

to see the active environment to see "c:\tweet"

Actual Behavior

shows the wrong path probably the environment is retrieved from the registry instead of the environment

0xEDApps commented 1 day ago

Checked with ProcessHacker to see the environment of individual executables

WindowsTerminal.exe shows the right path "c:\tweet;...." OpenConsole.exe also shows the right path "c:\tweet;...." cmd.exe has a different path

lhecker commented 1 day ago

Windows Terminal treats each tab and pane like a "container" of sorts. Each one gets its own fresh environment variables. You can disable that behavior here:

Image

0xEDApps commented 1 day ago

i see, indeed that works for new tabs but not for the one that is there when launched.

i also use these settings default profile: Command Prompt when terminal starts: open tab with default profile

0xEDApps commented 1 day ago

Also it does not show the correct path wen a tab is created with a new instance.

i have this setting new instance behavior: attach to the most recently used window