restore-terminals-vscode icon indicating copy to clipboard operation
restore-terminals-vscode copied to clipboard

Add `cwd` terminal configuration option

Open Enzime opened this issue 3 years ago • 10 comments

This fixes #4, as it allows users to specify the folder that they want each terminal to start in (cwd) and it will override terminal.integrated.splitCwd temporarily when creating splits so that the user isn't prompted which stops terminals from being created.

Enzime avatar Jun 03 '21 15:06 Enzime

Looks good! Could you also please update the package.json configuration properties accordingly. Thanks

EthanSK avatar Jun 03 '21 22:06 EthanSK

Could you please describe the problem better? Why can't the user just cd to the right directory in the commands array themselves?

EthanSK avatar Jun 03 '21 22:06 EthanSK

Could you please describe the problem better? Why can't the user just cd to the right directory in the commands array themselves?

People can cd to the right directory in the commands array, but if you have shouldRunCommands set to false, I think the cd command should still be executed. Another issue that my PR works around is that, if you have terminal.integrated.splitCwd set to workspaceRoot, if you're in a multi-root workspace every time you try to create a terminal split it'll prompt the user what folder to start that terminal in which stops the extension from creating terminals.

I made this PR because it would be nice to just directly use the cwd parameter of vscode.window.createTerminal which means the terminal is just started in the correct directory. But I didn't want the PR to be limited to only the first terminal being set to a cwd so I made it use a workaround by manually executing cd for the user, in the hopes that one day VS Code will release a proper API for creating terminal splits where you can specify the cwd.

Enzime avatar Jun 04 '21 00:06 Enzime

Ok cool, makes sense. Could you first address the other comments i've left (just unhidden them), then I can merge

EthanSK avatar Jun 04 '21 16:06 EthanSK

@EthanSK OK?

lhl2617 avatar Jun 18 '21 12:06 lhl2617

@EthanSK can this be merged soon please ? Very useful.

ocervell avatar Sep 10 '21 09:09 ocervell

@EthanSK bump

alondon17 avatar Jan 17 '22 10:01 alondon17

Is this PR still being considered?

sepsol avatar Apr 22 '22 00:04 sepsol

Just another voice wondering if this PR will be considered. Very useful feature.

dljaime avatar May 26 '22 08:05 dljaime

Bump?

flash716 avatar Jan 26 '23 22:01 flash716