In Sublime Text, you could achieve remote code execution using the following code:

    "cmd": ["rsync -az '$file' && ssh 'chmod +x ./$file_name; ./$file_name'"],

In VSC same could be achieved using Tasks functionality. The difference is you couldn’t create global settings. Whatever you do will be saved in the project you’re working in. Another difference is you could write something in the console, and it will be sent over to the script’s STDIN, which is unachievable in Sublime Text.

To start, open your project task configuration file via Ctrl+P, >Configure Task Runner, Others. Then paste the following JSON text and customize it for yourself:

    // See
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
            "taskName": "",
            "command": "rsync -az '${file}' && ssh 'chmod +x ./${fileBasename}; ./${fileBasename}'",
            "type": "shell",
            "group": {
                "kind": "build",
                "isDefault": true

What will it do? Copy currently open file to server’s home (~) folder using rsync (non-verbose mode, add -v in case of trouble), then make it executable and run it via ssh.