mklement0 / ttab

macOS and Linux CLI for opening a new terminal tab/window, optionally with a command to execute and/or display settings
283 stars 15 forks source link

Is there a way to get the new terminal to open in the VSCode integrated terminal #51

Open tnrich opened 1 year ago

tnrich commented 1 year ago

Hey there,

Say I have the following command in my package.json scripts:

    "sayHello": "ttab echo hello",

And I run npm run sayHello from the vscode integrated terminal. Is there a way to have it so that the new terminal that is created is created within the integrated terminal instead of from (in my case) the default mac terminal application?

Thanks very much! Thomas

tnrich commented 1 year ago

@mklement0 :)

mklement0 commented 1 year ago

That would be nice, but requires research to see if it's even possible.

It is easy to detect whether the caller runs in a VSCode terminal, but the question is what APIs can be used to request a new tab (stacked or split?) - I haven't looked; do you have pointers?

Assuming such APIs exist, the next question is how they fit into the parameter model of ttab; for instance, many options, such as -s and -w wouldn't apply; however, if there's a reasonable subset that can be supported, it's worth considering.

mklement0 commented 1 year ago

Also note that such APIs must be callable from Bash.