Fix Bash path interpretation for Windows terminal - #26125
Fix Bash path interpretation for Windows terminal#26125Akash (akashdeepmaity4) wants to merge 1 commit into
Conversation
Fixed path interpretation issues for Bash commands in Windows, ensuring proper command and argument formatting.
@microsoft-github-policy-service agree |
|
🔒 Automated review in progress — Bill Schnurr (@bschnurr) is auto-reviewing this PR. |
|
|
||
| // Ship the cleanly escaped string to the terminal stream! | ||
| this.terminal!.sendText(text, true); | ||
| } |
There was a problem hiding this comment.
Issue · Please address or respond
These duplicated statements are directly in the class body, reference method-local variables, and introduce an extra closing brace, so the file cannot compile. Remove this entire duplicated block.
| const text = processedArgs.reduce((p, c) => `${p} "${c}"`, processedCommand); | ||
|
|
||
| // Ship the cleanly escaped string to the terminal stream! | ||
| this.terminal!.sendText(text, true); |
There was a problem hiding this comment.
Warning · Non-blocking recommendation
This replaces buildCommandForTerminal and executeCommand with unconditional double-quote concatenation, losing the existing shell-aware escaping and execution behavior. Handle Bash path normalization within the existing shell-aware command-building path instead.
| let safeArg = arg.replace(/\\/g, '/'); | ||
| safeArg = safeArg.replace(/^([A-Za-z]):/, (_, drive) => `/${drive.toLowerCase()}`); | ||
| return safeArg; | ||
| }); |
There was a problem hiding this comment.
Warning · Non-blocking recommendation
Replacing backslashes in every argument treats opaque values such as regular expressions or Python snippets as paths and can corrupt them. Restrict conversion to known path operands or move normalization into an API that can identify paths.
|
Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified. Result: Summary: No meaningful test executed because the verification container could not start. Static inspection found duplicate statements at class scope in `service.ts`, which makes the PR head syntactically invalid. No tests were added, and existing terminal tests do not cover the new Bash path conversion. Test runs: 1 not run
|
Fixed path interpretation issues for Bash commands in Windows, ensuring proper command and argument formatting. Check recent issues submitted by Akash (@akashdeepmaity4) to reproduce issue and get more details.