Skip to content

Local tasks #168

Open
Open

Description

I am using a server under Linux to be able to compile my app (my computers need to be on windows) but I need to transfer the result (a binary file) in local then flash this bin in a microcontroller.

I would like to be able to :

  • open a local terminal to launch some commands locally,
  • use task locally.

I did not see anything in the documentation for this.

Also, following the architecture of extensions, I do not think it will be possible to have extension which work both sides with remote and local commands i.e. building remotely, retreiving and uploading locally (case of micropython IDE).

Activity

  1. Tyriar commented on May 9, 2019

    @Tyriar

    Right now you can't do this and would need to open a new window. also I'm not sure it makes sense for tasks as they're contained within the folder itself on the remote?

    I was discussing the terminal case with roblourens as we've both felt the need to open a local terminal, the only issue is it could potentially get very confusing which terminal is running on which machine.

  2. psolyca commented on May 10, 2019

    @psolyca
    Author

    I understand tasks are in the remote folder which can be in a remote workspace.

    But, could it be possible to open a folder and/or workspace in both side as in the extension view where you have a remote and a local view ?
    Thus in the explorer view, you have both workspace local and remote and you choose which one you want to work on !

    This could be the same for terminal, linked to the folder/workspace.

    Switching from one view to another by the explorer view or by a button in the status bar.
    You know you have a remote session open with the left status in the side bar and you can have an other button just near to indicate if you are remote (same color of the remote connection) or local (another color).
    This way you know quickly where you are.

  3. ardikaveh commented on May 10, 2019

    @ardikaveh

    +1 for local terminal, this would also solve the issue that ssh agent is not forwarded with current remote terminal. Can't typing 'exit' just fall back to local terminal?

  4. Tyriar commented on May 11, 2019

    @Tyriar

    ardi (@ardikaveh) the terminals are run by design on the machine and leverage through the same connection as everything else, that's what makes various terminals features like links and reflow on Windows work. If we were to support something like this it would likely be a special "Open Local Terminal" command.

  5. Tanja-4732 commented on Jun 19, 2019

    @Tanja-4732

    a special "Open Local Terminal" command

    This "special option" is exactly what I've been searching for. I have several extensions installed which can open various shells (PS, CMD, WSL, Git Bash) as a one-off question of which one to open, but this doesn't work while connected to a container.

    PGP problems

    Similar to what is said in #72, I am not able to utilize the GPG signing of commits (or tags for that matter) inside of containers, for the necessary (key-) files are stored outside of said containers.

    Accessing those key-files is crucial when signing ones work, and doing so from within a container would likely require the use of volumes, which would need to be mounted accordingly - a task which has proven to be rather challenging, given the limited configuration options made available to the user by the Remote Development Extention.

    SSH problems

    Furthermore, an SSH connection must be established (again, using key-files) which have to be mounted, as copying (private-) key-files into a container is unacceptable.

    Collaboration-friendly configurations

    When collaborating with others, everyone uses their own keys. Everyone has their own Git configurations and everyone has configured their Git installation accordingly.

    Which leads us to containers, as they need the mounting of the same files (notably with different contents) by different people. This container configuration (for example the devcontainer.json file) needs to be in the Git repository to allow for effective collaboration. However, it (alongside the also to-be-committed docker-compose.yml file) is also the only place to mount the key- and configuration-files required (see above).

    While the Remote Development Extension provides automated configuration of the containers Git installation (via auto-mounting), this only works for the Git configuration.

    The paths to the various key- and configuration-files on the devices of all collaborators is unlikely the same amongst all of them. It is thus required to be able to configure the mounting of such files dynamically, for the Remote Development Extension to fulfil its intended


    Please provide the functionality to mount the GPG and SSH keys required for development into the containers to be used by the Remote Development Extension.

    Being able to open local terminals would be an acceptable workaround for the time being.

  6. Tyriar commented on Jun 19, 2019

    @Tyriar

    Forked off just terminal into #730, tasks isn't done yet.

  7. removed their assignment
    on Jun 19, 2019
  8. added this to the Backlog milestone on Jun 20, 2019
  9. 13 remaining items

  10. ilyvion commented on Oct 22, 2022

    @ilyvion

    To give my justification for why I want the ability to do this: I'm coding within a docker image that was specially designed to offer the ability to compile C/Rust to a somewhat obscure platform, and rather than having to do all the clunky configuration and extra work it would be to set this up locally, I just do my VSCode dev within this image.

    The emulator for the platform, however, is a GUI program that runs natively/locally on my host machine. As it is now, I have to compile the program in the dev container, then switch to a separate terminal on my host machine and run the emulator on the output. What I would like would be a complete set of "build in dev container and then run on local machine" chain of tasks/launch configurations.

    This currently seems unattainable, and it's making my work more tedious.

  11. thw0rted commented on Dec 8, 2022

    @thw0rted

    If use cases help: I inherited a project that includes local development scaffolding via a series of Docker containers, which I run under WSL2. I opened the workspace in a WSL window (based on the remote extension), and I can write tasks that run in WSL. Now, I want to connect to these running containers from a browser on the local desktop.

    Normally, I make a task in Code that launches Chrome with a dev/debug profile, separate from my day to day browser. I don't want to install Chrome under WSL (is that even supported?), I just want to hit the "launch task" shortcut I'm used to, pick the "Debug Chrome" task, and have it run chrome from the (Windows-side) PATH with a couple extra arguments. It looks like that's still unsupported.

  12. g-kartik commented on Feb 3, 2023

    @g-kartik

    Curious to know when this feature request shall go on-deck!

  13. g-kartik commented on Feb 3, 2023

    @g-kartik

    My use case related to this feature is creating dev containers using git hooks. I am writing it, if in case anybody is interested in it and may be someone can help me with some alternative methods.

    • I created post checkout and post merge git hooks such that on these triggers, docker containers will be rebuilt and restarted within the context of the branch name.
    • I am using volumes suffixed with branch name to persist data for each branch. So switching between branches wouldn't require creating container data.
    • At the end of the hook script, I am launching vs code remote instance via cli and attach it to the running container.
    • Container volume mounts the source code including the git repository with ssh access to remote repo. So, git is accessible within the container.

    Now here is the problem; inside the container post-checkout and post-merge triggers won't work. Its because they run in the context of the container's terminal and they can't find docker or code. So either the user has to select and open Create New Integrated Terminal (Local) from the command palette or use external terminal for just executing git checkout or git merge. Both are not user friendly.

    It would be nice if we can pipe commands from container terminal to local terminal and view its output, without opening a separate local terminal. As per this feature request, we have been talking about local tasks, so that can be a subset of it I guess.

  14. BillDenton commented on Mar 30, 2023

    @BillDenton

    I do a mixture of local (Windows) and remote (Windows) development on the same code. I have build tasks that I want to run locally or remotely depending on if I'm working locally or remotely. I also have some other tasks that can only run on the local machine (Windows). These tasks are stored in user tasks.json so are available in all workspaces. Hence I'd like a way of specifying that a task always be run locally.

  15. g-kartik commented on Apr 1, 2023

    @g-kartik

    I have Django server container to which I have attached the vs code instance. My plan with local tasks is to run docker logs command in the local terminal automatically as the remote vscode instance starts up.

  16. berge472 commented on Aug 2, 2023

    @berge472

    This feature would also really benefit those doing embedded work in VS Code. When I want to debug something on a device, I have to start something like OpenOCD on the host machine, and then my launch.json attaches to that. It would be nice if I could have a task that starts OpenOCD on the host machine with the proper settings for my project, and just have the launch script run that task.

  17. mandrewpowers commented on Aug 28, 2023

    @mandrewpowers

    I'd also love to run local tasks when connected to a remote container!

    My use case is that I don't want to clutter my local machine with various development environments and would rather cross-compile inside of a dev container. The current problem with this is I have to manually download and run the build on the destination host. If I could execute a local task I could rsync and run locally which would greatly improve cycle times.

    For now I may setup a task to push code to my destination machine from the container then manually run it, or something similar, but it'd be great to run local build task to do it all at once.

  18. lfdmn commented on Dec 13, 2023

    @lfdmn

    I do lots of Yocto build on a server with lots of resource but need to download back the generated images (long complicated paths) to my local host where the boards are connected, flash them, etc.

    I'd like to be able to have a single workspace where all the tasks are defined, but be able to specify in the tasks if they should run on the remote or the host.

  19. adamgreg commented on Dec 22, 2023

    @adamgreg

    I think this would help for my use case too. I'm developing a full-stack web app inside a dev container, and want to be able to launch a browser on the host, configured for remote debugging in VS Code.

  20. Benjamin-Tan commented on Mar 11, 2024

    @Benjamin-Tan

    There seems to be several requests over time, is there any plan to support this feature in the near future? I think this would be very helpful for many people.

  21. ericblade commented on Feb 5, 2025

    @ericblade

    Additional use case:

    I'm using Remote Tunnel to access another Windows host that I am editing a web server configuration on. I can use tasks to deploy and restart the remote webserver, but I'd like to also have a task to open the site in my local browser. Alternatively, if there's a way I can open a browser tab from a task or some other mechanism, that would satisfy this to some degree.

    Perhaps the remote plugins could offer some method of defining tasks that can only be run if you are connected to a remote, but they run on the local side?

    I could probably see lots of additional use cases given some time

  22. dkouba-atym commented on Jul 31, 2025

    @dkouba-atym

    Adding an upvote for this functionality — this would be very useful for embedded dev as berge472 called out, and also I sometimes need to trigger programs running on my host machine as part of an automation that otherwise cannot run inside of a containers.

  23. tooyangtoonaive commented on Jan 5, 2026

    @tooyangtoonaive

    +1

  24. added a commit that references this issue on May 6, 2026
    6520c22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestRequest for new features or functionalitytasks

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions