microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.61k stars 29.42k forks source link

Terminal suggest: Make sure `cd -` completions play nice in pwsh #234382

Open Tyriar opened 18 hours ago

Tyriar commented 18 hours ago

I see this coming in https://github.com/microsoft/vscode/pull/234363:

            {
                name: '-',
                description: 'Switch to the last used folder',
                hidden: true,
            }

In pwsh it's actually - as in -/+ and they navigate a history stack, not just toggle between the last directory ($OLDPWD in bash). We could improve the wording for pwsh and add cd + as well (especially if hidden does what I think it does and doesn't show it unless typed), similar to the pwsh support from the script:

Image

When I looked into it this history stack is internal so we can't resolve the folder and stick it on the right for pwsh unfortunately, we might be able to do it on shells that use $OLDPWD.