fabiospampinato / vscode-terminals

An extension for setting-up multiple terminals at once, or just running some commands.
MIT License
121 stars 19 forks source link

[wishlist] "target" create the terminal if it doesn't exist.. #5

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi, that's not an issue, it's working actually, and it's great, but the new "target" option could be better (for me at least..) if it could create the terminal if it doesn't exist instead of creating one with the 'name' option. let me explain how I use it. let say i have 3 terminals : term1, term2 & term3 . actually I'm using it with the Commands extension, but that's the same without. so I created 3 'Commands' buttons to launch the 3 terminals functions and I want them to be in the same terminal, so I set the 3 targets to the same terminal. but I won't always launch those terminals in the same order, so to name the target I choose "term0". now if I first launch "term1" and there's no "term0", "term1" will be created and the command will be launched on it. if I now launch "term2", same problem, no existing "term0"... If I always start with "term1", I could have named all the target "term1" and it was good, but that's not the case. what I done is add another terminal "term0" with an empty command to create the first init terminal (which I need to always call once) and then I can work with the other terminals functions the way I want.

so, it's working for me actually, that's not a big deal, but if you have to do some other updates later, maybe the "target" option could also be changed to create a terminal with that name if it doesn't exist. thanks for your work. Fred

fabiospampinato commented 6 years ago

It sounds reasonable. I'll probably add support for this later in a few hours.

ghost commented 6 years ago

sorry, replying to myself, but it's weird. I tried again and it's not exactly like I first think it was. in fact if I call "form1" first, a "form1" terminal is created but after that all the next terminals commands seems to be executed in it , even "form0". no new terminals are created !? I thought it was like that at my first try this morning, but I probably went too fast and did something wrong. so it seems to be working like I wish, except that the name displayed for the terminal is not the 'target' option but the 'name' option of the first launched terminal. after that it works like if it actually has the target name. probably like a "working bug" :-) with the visual part not correctly named ?

fabiospampinato commented 6 years ago

I think the problem was that the first terminal got created with the wrong name.

It should be fixed in v1.6.1

ghost commented 6 years ago

perfect ! thanks.. :-)