-
Notifications
You must be signed in to change notification settings - Fork 44
Fix cell executor selection logic so bash cell execution works #826
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
base: main
Are you sure you want to change the base?
Conversation
Am I missing something or should this ensure that the terminal is running bash? There's probably at least one sicko out there running powershell on macos as their main shell. (And will this work on windows where... isn't powershell is the default?) |
You must be right? I am not sure how to check though. Will look into it, but I think we should proceed with the fix regardless? This is a fix of a regression after all. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comment on the PR thread itself was:
Am I missing something or should this ensure that the terminal is running bash? There's probably at least one sicko out there running powershell on macos as their main shell. (And will this work on windows where... isn't powershell is the default?)
From my read of the code, Elliot is correct that this PR doesn't add a new problem. But it might surface the underling problem more broadly. The previous logic might have caused the bash cells to be unavailable on Windows, and that might no longer be the case.
I really think we ought to test this on Windows...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does fix the problem for me locally. ✅
I would be entirely unsurprised if this never worked at all on Windows, and from my experience running tests with this infrastructure on different OSes, it would take some very bespoke test infra setup to cover the Windows terminal options. Not unimportant, but also IMO not the highest priority right now compared to other options to spend time on.
Sorry, I should have clarified - I didn't mean automated testing. I just meant "someone with a windows computer should try this fix and see what it does". |
Can we get @cderv to try this perhaps? You can get the https://github.com/quarto-dev/quarto/actions/runs/17988978857/artifacts/4098060255 Download, unzip, then do Extensions: Install from VSIX... |
I think this is what worries me. It's a "bash" cell. It should work with bash-only commands. |
Currently, it is a convenient feature that assumes users running .qmd cell interactively have the same terminal as the terminal cell they are using... 😅 Not sure if there is a way to check the terminal that is open, and compare to the name of the cell language. |
I agree that it is somewhat problematic that the bash cell is executed in whatever terminal you have laying around (for clarity, cross-system consistency, reproducibility reasons). At the same time, it seems quite convenient and nice that it opens up/uses the terminal you have in your editor. We can specify a custom shellPath when creating the terminal...
Here's a terminal object. We could check if the running terminal's name === 'bash' (or 'zsh'?)... ![]() Seems like a bit of a rabbit hole... should I go there? Or should I, for now, let the user run the cell in their terminal, whatever it might be? |
I would advocate for letting the user run the cell in their terminal for now (i.e. fix the regression), and looking for user feedback on specifics for when this isn't working, to inform future work. |
Fixes #687
There was a bug in the logic that checked if a cell executor required an extension to run. As a result, bash cells could not be run. That is fixed, and you can send bash/sh cells to the console now. Also added some logic to avoid sending bash code cells to terminals running R language interactive sessions.