vscode-rdbg icon indicating copy to clipboard operation
vscode-rdbg copied to clipboard

Can't open a file with a space in the path (such as any file in iCloud)

Open agodoroja opened this issue 2 years ago • 2 comments

When trying to debug a file that is in iCloud, I get an error something like:

can't open file '/Users/XXX/Library/Mobile'

That is because iCloud files are stored in a folder with the path "/Users/XXX/Library/Mobile Documents/com~apple~CloudDocs". The file "launch.json" contains:

{
  "name": "Debug Local File",
  "type": "rdbg",
  "request": "launch",
  "script": "${file}"
}

Removing the "script" line, which is supposed to default to the currently open file, doesn't work either.

agodoroja avatar Jul 27 '23 18:07 agodoroja

I have the same problem where specifying any script path containing a space fails to launch correctly

{
      "name": "Debug cost",
      "type": "rdbg",
      "request": "launch",
      "script": "C:/Users/Brad/Documents/src/Power Costs/calculate-usage-cost.rb",
      "args": ["-y", "202302"]
}
ruby: No such file or directory -- C:/Users/Brad/Documents/src/Power (LoadError)

The path continues after the space character following Power & will launch as expected without spaces.

bradkrane avatar Sep 02 '24 00:09 bradkrane

It will work if you add quotes to the script path to enclose the path as a single var

bradkrane avatar Sep 02 '24 03:09 bradkrane