Skip to content

Commit

Permalink
229280_changes: Added more shell types
Browse files Browse the repository at this point in the history
  • Loading branch information
Parasaran-Python committed Oct 15, 2024
1 parent ed11ae2 commit 82ed483
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ export class SmartPasteUtils {

switch (shellType) {
case 'gitbash':
case 'cmd':
case 'zsh':
case 'tmux':
case 'fish':
case 'bash':
{
// Escape backslashes and wrap in double quotes if necessary
const escapedPath = text.replace(/\\/g, '\\\\');
Expand All @@ -56,14 +59,8 @@ export class SmartPasteUtils {
return escapedPath;
}

case 'bash': // Linux/macOS Bash
// Wrap in quotes if spaces or special characters exist
if (text.includes(' ')) {
return this.wrapAndEscapePath(text);
}
return text;

case 'pwsh':
case 'cmd':
// Simply wrap in quotes if spaces are present
if (text.includes(' ')) {
return this.wrapAndEscapePath(text);
Expand Down

0 comments on commit 82ed483

Please sign in to comment.