Skip to content

Handle all shells’ de/activation - #137

Merged
Karthik Nadig (karthiknadig) merged 4 commits into
microsoft:mainfrom
flying-sheep:pa/all-shells
Jan 27, 2025
Merged

Karthik Nadig (karthiknadig) merged 4 commits into
microsoft:mainfrom
flying-sheep:pa/all-shells

Conversation

@flying-sheep

@flying-sheep Philipp A. (flying-sheep) commented Jan 24, 2025 •

Copy link
Copy Markdown
Contributor

Fixes #138

This adds shell activation for

  • gitbash
  • wsl
  • ksh
  • tcshell
  • xonsh
  • nushell

and fixes shell activation for C shell.

it also makes sure that it’s impossible to add a terminal to the enum without also adding shell activation/deactivation commands by using a Record type that needs to be exhaustive.

Comment thread src/managers/builtin/venvUtils.ts
Comment thread src/managers/builtin/venvUtils.ts Outdated
@karthiknadig

Copy link
Copy Markdown
Member

Thanks for the PR! Love the new shell command handling.

@anthonykim1

Anthony Kim (anthonykim1) commented Jan 27, 2025 •

Copy link
Copy Markdown
Contributor

Thanks for doing this Philipp A. (@flying-sheep)
I mentioned #116, we should eventually start using shell type API.

The list on https://github.com/microsoft/vscode/blob/e8346324cfb8b5d680ad657bb67153eb838aebc5/src/vscode-dts/vscode.proposed.terminalShellType.d.ts are subject to change, so feel free to let me know if anyone thinks more shell types could be added to make the workload easier on the extension side. As we want to make sure to cover extensive list of shell types for their specific activation.

@vs-code-engineering vs-code-engineering Bot added this to the January 2025 milestone Jan 27, 2025
@karthiknadig
Karthik Nadig (karthiknadig) merged commit 6a69637 into microsoft:main Jan 27, 2025
@flying-sheep
Philipp A. (flying-sheep) deleted the pa/all-shells branch January 27, 2025 21:59
NgCuong (NguyenCuong1989) referenced this pull request in NguyenCuong1989/vscode-python-environments Oct 23, 2025
Fixes #138

This adds shell activation for

- gitbash
- wsl
- ksh
- tcshell
- xonsh
- nushell

and fixes shell activation for C shell.

it also makes sure that it’s impossible to add a terminal to the enum
without also adding shell activation/deactivation commands by using a
`Record` type that needs to be exhaustive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Venv activation/deactivation is missing for many shell types and broken for one of the existing ones

3 participants