Skip to content

multi-root workspaces - integrated console should launch to root of launcher #2616

@petervandivier

Description

@petervandivier

Issue Description

The PowerShell Integrated Console is not my default terminal. In a multi-root project, when opening a .ps1 file, the integrated console launches automatically. This is useful since often I'll want to F5 / F8 bits of that file. Sadly however, the working directory of the integrated console is not set to the root folder of the file that induced the launch. If the .ps1 file I'm using is using resources at a relative location and doesn't otherwise handle for the different working directory, this becomes inconvenient. Surely though, it is better to launch the console to the working directory of the file that caused the launch.

Repro

mkdir foo bar baz
touch foo/foo.sh bar/bar.ps1 baz/baz.c
echo '{"folders":[{"path":"baz"},{"path":"foo"},{"path":"bar"}],"settings":{}}' > foobar.code-workspace
code foobar.code-workspace

When clicking on the file bar.ps1 to open it, you will note that opens to the "baz" working directory.

image

Environment Information

Visual Studio Code

Name Version
Operating System Darwin x64 19.4.0
VSCode 1.43.2
PowerShell Extension Version 2020.3.0

PowerShell Information

Name Value
PSVersion 7.0.0
PSEdition Core
GitCommitId 7.0.0
OS Darwin 19.4.0 Darwin Kernel Version 19.4.0: Wed Mar 4 22:28:40 PST 2020, root:xnu-6153.101.6~15/RELEASE_X86_64
Platform Unix
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.10032.0 6.0.0 6.1.0 6.2.0 7.0.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
ansys-apdl-syntax smhrjn 0.0.11
autoconf maelvalais 0.1.0
azure-account ms-vscode 0.8.9
azure-pipelines ms-azure-devops 1.165.1
better-toml bungcip 0.3.2
cmake twxs 0.0.17
cpptools ms-vscode 0.27.0
csharp ms-dotnettools 1.21.16
hosts tommasov 1.1.1
markdown-preview-enhanced shd101wyy 0.5.2
powershell ms-vscode 2020.3.0
python ms-python 2020.3.71659
rainbow-csv mechatroner 1.6.0
restructuredtext lextudio 125.0.0
ruby rebornix 0.27.0
vagrant bbenoist 0.5.0
vscode-docker ms-azuretools 1.0.0
vscode-raml blzjns 3.0.1
vscode-ruby wingrunr21 0.27.0
vscode-svg-previewer vitaliymaz 0.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions