Skip to content

Commit

Permalink
improve shell identify on case-insensitive system
Browse files Browse the repository at this point in the history
Use case-insensitive regex to remove `.exe`  extension.

microsoft#22036 (comment)
  • Loading branch information
JamzumSum committed Nov 1, 2023
1 parent 78052bd commit 761664e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export abstract class BaseShellDetector implements IShellDetector {
export function identifyShellFromShellPath(shellPath: string): TerminalShellType {
// Remove .exe extension so shells can be more consistently detected
// on Windows (including Cygwin).
const basePath = shellPath.replace(/\.exe$/, '');
const basePath = shellPath.replace(/\.exe$/i, '');

const shell = Array.from(detectableShells.keys()).reduce((matchedShell, shellToDetect) => {
if (matchedShell === TerminalShellType.other) {
Expand Down

0 comments on commit 761664e

Please sign in to comment.