Is there a way to achieve something similar to "Python: Run Selection/Line in Python Terminal " but where the current line of code, or block of code, is passed as an argument to a configurable shell script?
Question posted in Visual Studio Code
View the official documentation.
View the official documentation.
2
Answers
You can use the extension Command Variable to pass the selected text to the task command
If needed you can add some arguments to the
${selectedText}
variable.You can directly use the variable
${selectedText}
in a keybinding that sends a command to the terminal:u000D
is areturn
so the command runs immediately.Or try this keybinding to select the current line first and send that to the terminal:
Or in a task: