posit-dev / positron

Positron, a next-generation data science IDE
Other
1.34k stars 40 forks source link

Cmd+Enter in a shell script should send code to the active terminal #1493

Open jmcphers opened 9 months ago

jmcphers commented 9 months ago

Our Cmd + Enter binding for the editor sends statements to the active language runtime for the editor's language, but does not work on shell scripts as they don't technically have a language runtime attached.

If Cmd + Enter is used in a shell script (including .sh, .bat, .ps1, files with a shebang, or otherwise identified by VS Code as having a shell type), it should send statements to the active terminal instead.

If we wanted to be really fancy we could hook up a StatementRangeProvider for shell scripts so that they get statement-by-statement execution as Python and R do.

lionel- commented 9 months ago

I like the really fancy scenario! Many data analysis users are spending a lot of time in shell scripts to hook up pipelines (e.g. bioinformaticians). Having a positron-like experience that's file-centric rather than console-centric for the editing of shell files would be very nice.

Also, personally, I use shell snippets in my technical notes all the time. I would guess this is somewhat common to do? It would be nice to be able to edit those shell snippets and send them (or individual statements) to the terminal for feedback during editing.