bashsupport-pro icon indicating copy to clipboard operation
bashsupport-pro copied to clipboard

Trying to run a script within a directory with spaces results in "Working directory <working_dir> does not exist

Open gsusI opened this issue 3 years ago • 13 comments

Using it in IntelliJ in Windows. Run configuration shows an error "The working directory 'G:\My Drive...\workingdir' does not exist"

I tried moving it outside the Google Drive outside and it works just fine.

gsusI avatar Feb 15 '22 13:02 gsusI

Thanks for reporting! I'll take a look and fix it for the next update.

jansorg avatar Feb 15 '22 13:02 jansorg

Thanks 👍

gsusI avatar Feb 15 '22 14:02 gsusI

@gsusI Unfortunately, I was unable to reproduce this on Windows 10 with either WSL2 or MSys Bash (i.e. Git Bash). It may be related to a network-mounted Google Drive, I still need to verify that.

Could you paste the info at Help > About > Copy, please? If you don't mind, a screenshot of the error message would be very helpful.

jansorg avatar Feb 15 '22 19:02 jansorg

Hej @jansorg - I'm having about the same trouble with PHPStorm and WSL2 on Windows 11.

And it doesn't matter whether the project is on C:\ or on Debian under \wsl.

Windows 11 self:

config_windows_self

result_windows_self

WSL

config_wsl

result_wsl

PHPStorm -> Help -> About -> copy :

PhpStorm 2022.2.2 Build #PS-222.4167.33, built on September 15, 2022 Licensed to Alexander Bombis Subscription is active until February 8, 2023. Runtime version: 17.0.4+7-b469.53 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 11 10.0 GC: G1 Young Generation, G1 Old Generation Memory: 2028M Cores: 16 Registry: editor.focus.mode.color.light=697098 ide.editor.tab.selection.animation=true run.processes.with.pty=TRUE ide.new.editor.tabs.vertical.borders=true ide.balloon.shadow.size=0 editor.focus.mode.color.dark=697098

Non-Bundled Plugins: unicorn.bar (1.1.4) some.awesome (1.14) pronskiy.elephpant (0.1.1) me.laria.code.idea_caseconv (0.7.1) manjaro.mpb (1.7) lermitage.intellij.nightandday (1.6.1.201) krasa.CpuUsageIndicator (1.14) de.ehmkah.projects.imgdiff (1.11.0) de.dieploegers.develop.idea.shellfilter (4.3.0) daehyun.kim.camelBar (1.0.5) commit-template-idea-plugin (1.2.0) com.your.ltc.flatocean.id (2.9.4) com.wuyr.intellijmediaplayer (1.0.4) com.thvardhan.gradianto (4.5) com.tabnine.TabNine (0.7.25) com.sashashpota.twitter-plugin (1.0.2) com.palantir.witchcraft.api.logging.idea (2.10.0) com.nvlad.tinypng-optimizer (1.0.8) com.mroche.JsonHelper (1.2.0) com.mintlify.document (1.1.6) com.jtschwartz.smartsort (1.0.3) com.jetbrains.hackathon.indices.viewer (1.22) com.jetbrains.darkPurpleTheme (1.3) com.itcodebox.leewyatt.notebooks.id (1.38) ru.mobiledev.plugins.uigd (1.2) com.intellij.ideolog (203.0.30.0) com.intellij.datagen (222.4167.21) com.godwin.json.parser (1.4.1) com.dethlex.numberconverter (1.5.0) com.arcticicestudio.nord.jetbrains (0.13.0) carbon-now-sh (1.3.0) ai.bloop.extension.webstormplugin (0.1.0) String Manipulation (9.5.1) Shifter (1.9.6) Shell Process (1.3.2) com.mallowigi (73.0.0) org.endpointdeps.EndpointDependencies (1.3) net.king2500.plugins.PhpAdvancedAutoComplete (1.1.0) me.elabee.idea.plugin.swoole (5.0.0) de.espend.idea.php.annotation (8.2.3) izhangzhihao.rainbow.brackets (6.26) com.github.jk1.ytplugin (2022.1.212) com.clutcher.comments_highlighter (2.4.1) com.chrisrm.idea.MaterialThemeUI (7.11.0) org.asciidoctor.intellij.asciidoc (0.37.52) ru.adelf.idea.dotenv (2022.2) pro.bashsupport (2.1.12.222)

Can you help me?

svenskanda avatar Oct 12 '22 05:10 svenskanda

@svenskanda The mapping of C:\inetpub\wwwroot\... seems to point to the wrong path inside WSL. Could you run a WSL Bash terminal and check where the inetpub directory is actually located inside it? The C:\ drive should be mapped under /mnt/c/, but apparently it's not. I'll hopefully be able to provide more help when I know where inetpub is on your system.

jansorg avatar Oct 12 '22 07:10 jansorg

Hej - in Windows is inetpub the original path and in WSL is /mnt/c/inetpub

inetpub

svenskanda avatar Oct 12 '22 16:10 svenskanda

And the path of file is okay

file_is_true

svenskanda avatar Oct 12 '22 16:10 svenskanda

@svenskanda Thanks! That's odd, the file exists but WSL's bash isn't able to locate it. At least I'm unable to spot a mistake in the paths. To debug this, could you execute a CMD shell and attempt to run the command

C:\Windows\system32\wsl.exe -e bash /mnt/c/inetpub/wwwroot/partarum/de/testserver.partarum.de/root/testBrackets.sh

please? (I hope that I got the path right in the command :)

Do you perhaps have more than one WSL distribution installed?

jansorg avatar Oct 12 '22 17:10 jansorg

her the results of test:

cmd:

cmd

powershell:

powershell

wsl --list --all:

wsl_list_all

if you need more - you get it

svenskanda avatar Oct 12 '22 17:10 svenskanda

@svenskanda Thanks! AFAIK wsl -e bash executes with the default WSL distribution, which is docker-desktop in your setup. But your file is apparently only available in the distribution "Debian". Please try to add -d Debian as arguments at File > Settings > Languages & Frameworks > BashSupport Pro > Shell Interpreters, as shown in the screenshot. With this change the run configurations will execute with the WSL Debian distribution by default.

If it doesn't work for you, please share a screenshot of the shell interpreter settings.

Unfortunately these settings aren't ideal for WSL with multiple distributions. Upcoming 3.0 with WSL "remote" execution should hopefully simplify this a bit, but I need to think a bit more about further improvements...

wsl-settings

jansorg avatar Oct 12 '22 17:10 jansorg

Right! Thanks - that is the solution.

This works for me in Windows self. The .sh is running and debug with your plugin. That's nice - one click and the script is running. With this solution is it okay if another distribution used - i only need to change the Distribution Name in the Arguments.

Thanks !!!

Only in a project which is created in wsl Debian that is not working, but that is okay. Unless you want to tackle the problem as well?

svenskanda avatar Oct 12 '22 18:10 svenskanda

Glad that it's working! 3.0 should improve this a bit, but it's still not ideal. I think using \\wsl$ will be working in 3.0, but I need to verify that again :) The plugin should support the paths and project setups the IDE is supporting, so I'd like to fix this, too.

jansorg avatar Oct 12 '22 18:10 jansorg

Cool - hey, if you need a tester to help, just let me know. Otherwise, thanks again, I'll take the subscription.

her a picture for you:

wsl_debian_wrong_path

wsl_dollar_dir

wsl_localhost_dir

wsl_dollar_to_localhost

wsl_dollar_examples

wsl_releas

https://github.com/microsoft/WSL/issues/3861

https://learn.microsoft.com/en-us/windows/wsl/release-notes

svenskanda avatar Oct 12 '22 18:10 svenskanda