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

Configuration option for multi-root workspaces #4

Open
janbaykara opened this issue Dec 1, 2020 · 7 comments · May be fixed by #12
Open

Configuration option for multi-root workspaces #4

janbaykara opened this issue Dec 1, 2020 · 7 comments · May be fixed by #12

Comments

@janbaykara
Copy link

Hi, I'm looking for a way to determine which CLI commands will run under which directory, for a workspace that has more than one root directory. How are people solving this currently?

@LorenzBischof
Copy link

I am currently solving it by adding cd ../project before the real commands.

@EthanSK
Copy link
Owner

EthanSK commented Mar 24, 2021

I'm not sure i fully understand the question, could you explain it in more detail pls?

@Enzime Enzime linked a pull request Jun 3, 2021 that will close this issue
@afreeland
Copy link

I think this is similar to what I am looking for...where I have a workspace that has multiple folders. I need a terminal in each of those folders as they all have something that I need to start. So it would be awesome if there was a WORKDIR argument for convenience.

Structure

Workspace
  folder1
  folder2
  folder3

So could have something along the lines of

"restoreTerminals.terminals": [
{
   "splitTerminals": [{
     "name": "api",
     "workdir": "./folder1"
   },{
     "name": "ui",
     "workdir": "./folder2"
   }
   ]
 }
]

@afreeland
Copy link

I've tried running something along the lines of

"restoreTerminals.terminals": [
			{
				"splitTerminals": [
					{
						"name": "ui",
						"commands": ["cd ../ui"]
					},
					{
						"name": "api",
						"commands": ["cd ../api"]
					}
				]
			},
			{
				"splitTerminals": [
					{
						"name": "shared",
						"commands": ["cd ../shared"]
					},
					{
						"name": "backend",
						"commands": ["cd ../backed"]
					}
				]
			}
		]

When this runs in actually gives some very strange results, even with the artificial delay set to 1000.
I end up seeing the following terminals where there are two high level terminals without any splits...and then some that are split but not named properly and an extra terminal thrown in o.O

api
api

-ui
-zsh
-zsh

-ui
-zsh

@EthanSK
Copy link
Owner

EthanSK commented Jul 14, 2021

I'm struggling to think of a fix. This is a known new problem microsoft/vscode#45407

If anyone knows how to get around it, please help!

@gustavorps
Copy link

I like the @afreeland proposal.
My 5 cents:

Keep in alignment with the VS Code nomenclature

"restoreTerminals.terminals": [
{
   "splitTerminals": [{
     "name": "api",
     "workspaceFolderBasename": "folder1"
   },{
     "name": "ui",
     "workspaceFolderBasename": "folder2"
   }
   ]
 }
]

@Mkhassani
Copy link

Mkhassani commented Aug 4, 2022

The commands accept array of commands you can have cd command to the work folder before main command.

"restoreTerminals.terminals": [ { "splitTerminals": [ { "name": "project-name", "commands": ["cd workdir","npm start"] } ] } ]

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

Successfully merging a pull request may close this issue.

6 participants