Detect shells ending in .exe (for Windows/Cygwin)#17431
Detect shells ending in .exe (for Windows/Cygwin)#17431karrtikr merged 3 commits intomicrosoft:mainfrom
Conversation
Strip `.exe` extension before detecting shells, so all detections work in Windows / Cygwin. Fixes part of microsoft#17426.
|
@edemaine thanks for the PR. Can you add a news item so that you get credits for this change in our changelogs? |
|
Added. Thanks for your help! |
karrtikr
left a comment
There was a problem hiding this comment.
Also, please update the tests here to include zsh shells ending in .exe:
|
Sorry for the delay. I pushed tests. (Thanks for the pointer!) I'm OK with #17426 being closed by this PR; in particular, it fixes the title of that issue, and solves my problem. And now that I understand how shell detection works, the rest of the behavior makes some sense. If I were to create a new issue, it would be one of the following feature requests:
But I'm not particularly sure whether any of these are the right decision / important. If you find any of them appealing, let me know, and I'll add them; otherwise, I'm happy to let #17426 end. |
|
I have described the actual problem here thanks to your diagnosis: #17426 (comment). We should simply rely on the shell path returned by VSCode API, so changing the terminal using any of your suggestions won't work unfortunately. All fallbacks should be removed with #16023 which should solve the issue. |
Strip
.exeextension before detecting shells, so all detections work in Windows / Cygwin. Fixes #17426 (specifically subissue 1).Side note: I feel like the regular expressions should start with
\bor something to ensure the shell names aren't suffixes. Currently,notzshwould be detected aszsh. But I haven't changed that; as far as I know, no shell name is a prefix of another, so it's probably fine as is. Well... many shells are a prefix ofsh, but that's not a recognized shell (should it be?).