I find myself in a position where it would be useful to open a VS Code terminal profile and have it automatically run certain commands.
The specific case is I want to set up a profile where it automatically ssh's into another machine. I am doing this because I do my dev work on one machine (machine_A), but the actual running of the code occurs on a second machine (machine_B). Is it possible to make a profile that automatically runs
ssh {user_name}@{machine_name}
upon opening the profile?
Machine_A and machine_B are both remote and being accessed through RemoteSSH. (And no I cannot do the dev work on the same machine I run the code.)
I am currently defining a custom profile in the workspace settings file ({workspace}/.vscode/settings.json
) as suggested by the VS Code docs on terminal profiles. My current attempt is:
{
"terminal.integrated.profiles.windows": {
"ssh_session": {
"path": "ssh",
"args": \["{user_name}@{machine_name}"\]
}
}
}