microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.02k stars 29.2k forks source link

parentTerminal doesn't always work #205254

Open drrnkin opened 8 months ago

drrnkin commented 8 months ago

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

This is precisely the same as #131594. The OP-provided code opens terminals that are separate from each other (not split). Ditto for the very similar code quoted in response (the last block). Unfortunately the OP did not follow up but I'm seeing exactly the same issue.

I've definitely seen parentTerminal work when creating two terminals at the same moment and making one the parentTerminal of the other. The option seems to be ignored if the supplied terminal was not created at the same moment, i.e. stored and used in a subsequent call.

apeters-brex commented 7 months ago

For me, the example from https://github.com/microsoft/vscode/issues/131594 works, but fails when I try to split from an existing terminal (one not created within that same function).

For instance, if you take that same snippet and change options_1 to include

location: { parentTerminal: vscode.window.terminals[0] },

Then run the command when you have an existing terminal, terminal_1 does not get split from that existing terminal.