Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commands running twice #80

Open
gustadsg opened this issue Mar 1, 2023 · 2 comments
Open

Commands running twice #80

gustadsg opened this issue Mar 1, 2023 · 2 comments

Comments

@gustadsg
Copy link

gustadsg commented Mar 1, 2023

I configured terminals-manager to run some simple commands and it runs every command twice.

here are my workspace settings
"settings": { "terminal.integrated.cwd": "path/to/project/root/folder", "terminals.autorun": true, "terminals.autokill": true, "terminals.terminals": [ { "name": "Startup", "focus": true, "cwd": "path/to/project/root/folder", "description": "Run startup commands", "commands": [ "git fetch --all --verbose", "${workbench.action.terminal.focus.next}", ] }, { "name": "VideoWall", "focus": false, "cwd": "path/to/project/subfolder", "description": "open VideoWall terminal on startup", "command": "git branch", }, { "name": "Desktop", "focus": false, "cwd": "path/to/project/root/folder", "description": "open Desktop terminal on startup", "command": "git branch", "split": "VideoWall" } ] },

As a result, git fetch runs twice, Desktop is focused instead of VideoWall and git branch runs 4 times (twice in each splitted terminal)

@fabiospampinato
Copy link
Owner

How are you running these terminals? And can you provide a simpler configuration with just 1 terminal that reproduces the problem?

@usersina
Copy link

usersina commented Dec 7, 2023

I also had something similar happen with a repo/repo.code-workspace config file:

{
  "folders": [
    {
      "name": "user-service",
      "path": "user-service"
    },
    {
      "name": "product-service",
      "path": "product-service"
    }
  ],
  "settings": {
    "terminals.autokill": true,
    "terminals.autorun": true,
    "terminals.terminals": [
      {
        "name": "user-service",
        "cwd": "/Users/myuser/repo/user-service",
        "command": "docker-compose up", // this was running twice
        "dynamicTitle": true,
        "open": true
      },
      {
        "name": "product-service",
        "cwd": "/Users/myuser/repo/product-service",
        "command": "docker-compose up", // this was running twice as well
        "dynamicTitle": true,
        "open": true
      }
    ]
  }
}

The workaround I did is to create a .vscode/terminals.json file for each sub repository with the individual config, but that's not perfect since which one opens first is not guaranteed, hence creating a race condition between which command runs first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants