fabiospampinato / vscode-terminals

An extension for setting-up multiple terminals at once, or just running some commands.
MIT License
121 stars 19 forks source link

How to run commands containing strings? #73

Closed SurajMeena closed 1 year ago

SurajMeena commented 1 year ago

How can I run commands like Get-Process | Tee-Object - FilePath "results$((get-date).ToString("MM-dd-yyyy")) or for that matter functions with multiple lines? I couldn't find any example for usage of global env variables as well. Is it possible to add that in documentation?

SurajMeena commented 1 year ago

How can I run commands like Get-Process | Tee-Object - FilePath "results$((get-date).ToString("MM-dd-yyyy"))

I got answer to this part from the demo file that comes when you first run terminal: edit configuration. So we can use backslash to escape inverted commas. I am still curious how multiline commands can be written maybe backslash would work for them as well.

fabiospampinato commented 1 year ago

I think perhaps if you want to write newlines you have to write the escape sequence for that: \n, which encoded inside JSON becomes: \\n.