Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unquoted paths lead to error when trying to use 'Run Shiny App in Terminal' button #6094

Open
pieterjanvc opened this issue Jan 23, 2025 · 4 comments
Labels
area: run app bug Something isn't working os-windows Windows issue support
Milestone

Comments

@pieterjanvc
Copy link

System details:

Positron and OS details:

Positron Version: 2025.01.0 (system setup) build 152
Code - OSS Version: 1.95.0
Commit: 66aa3fb
Date: 2025-01-06T02:53:20.465Z
Electron: 32.2.1
Chromium: 128.0.6613.186
Node.js: 20.18.0
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.26100

Interpreter details:

Python 3.11 and R4.4.2

Describe the issue:

Unable to use the built-in 'Run Shiny App in Terminal' button on top of an R or Python Shiny script

Steps to reproduce the issue:

  1. Open any valid R or Python Shiny script (example here Python)
  2. Click the 'Run Shiny App in Terminal' button

ERROR:

C:\Users\me\AppData\Local\Programs\Python\Python311\python.exe -m shiny run 
--reload c:\Users\me\Documents\LocalProjects\shinyApp.py
bash: C:UsersmeAppDataLocalProgramsPythonPython311python.exe: command not found

NOTE: I tried using different terminals (Git Bash, CMD. ...), but all give the same issue.

POTENTIAL FIX
Make sure that the commands are quoted and the issue should be fixed.
Example: When copy pasting the code, quoting the paths like so ....

"C:\Users\me\AppData\Local\Programs\Python\Python311\python.exe" -m shiny run
--reload "c:\Users\me\Documents\LocalProjects\shinyApp.py"

and the app will start without issues.

Unfortunately I can't seem to find a way to edit the command run when clicking the 'Run Shiny App in Terminal' button, so I think this will need to be fixed by you.

Thanks!
PJ

@sharon-wang
Copy link
Member

Hey @pieterjanvc 👋

We just released version 2025.02.0-79 a couple days ago, which fixed a similar issue for FastAPI apps that I think should have fixed this issue with Shiny as well. I was able to run this example shiny app via the 'Run Shiny App in Terminal' button without issue, so that is a good sign!

Could you please give the 2025.02.0-79 a try and see if the issue is resolved for you?

@sharon-wang sharon-wang added info needed Waiting on information area: run app labels Jan 23, 2025
@pieterjanvc
Copy link
Author

Hello,

Thanks for the quick response.
I installed the following version

Positron Version: 2025.02.0 (system setup) build 79
Code - OSS Version: 1.96.0
Commit: a268bc8
Date: 2025-01-21T02:49:15.664Z
Electron: 32.2.6
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.19045

Unfortunately the issue has not been fixed. The paths in the command are still unquoted resulting in an error that's fixed when I copy, quote and rerun again.

By the way, this message also appears alongside, regardless of the CMD or Git Bash terminal being used

Shell integration isn't supported in this terminal, so automatic preview in the Viewer pane isn't available. To use this feature, please switch to a terminal that supports shell integration.

Thank you for looking into this

@pieterjanvc
Copy link
Author

pieterjanvc commented Jan 24, 2025

Hello,

FYI: I have also tried running the app in VS-code with the Shiny extension, and in that case it does correctly quote and run the code when clicking the button. Interestingly, when I then install this extension in Positron, it will actually override the default and run the app properly. The big downside in this case is that the extension has a requirement to have the file name be app.py or <name>_app.py which I don't like, but that's a separate issue.

@juliasilge
Copy link
Contributor

We've run into similar issues in the R extension and do some work here to choose vscode.ProcessExecution or vscode.ShellExecution:

// Using vscode.ProcessExecution gets around some hairy quoting issues on Windows,

We likely need to do something similar for the "run app" functionality.

@juliasilge juliasilge added bug Something isn't working os-windows Windows issue support and removed info needed Waiting on information labels Jan 27, 2025
@juliasilge juliasilge added this to the Future milestone Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: run app bug Something isn't working os-windows Windows issue support
Projects
None yet
Development

No branches or pull requests

3 participants