terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Tab search from wt.exe?

Open SPgreg opened this issue 9 months ago • 3 comments

Hi,

I'm unsure if this is available and if it is, seems documentation might be lacking, though I get the idea of leaving out documented features.

I'm trying to show a list of tabs in the terminal, so I'd like to be able to do something like wt -l tabs and it give me a list of tabs with perhaps some of the details of the tab, such as Profile and title and such.

In my use case, I'm running a script which opens up other tabs and runs a simple ssh command in those tabs. The reason I'm using my own setup and not some SSH client that already exists is that I have a lot of customization I want to match the network I'm tying into and it's an absolute nightmare to setup even an existing putty instance without significant modification.

So, what I'm hoping for is a way to list the open tabs and if there's already an existing tab, just change the focus to match that tab, rather than opening a new one, unless I want to.

Anyway, please let me know if this exists and if not, know of how I can generate a list?

Ohh, btw, this got me thinking. Could it be possible to add a "send after start" and "send before end script" in the Profiles? Basically something that will be sent to the new tab/pane/whatever after initialization and before it exits... tangent.

Thanks, Greg

SPgreg avatar May 21 '25 14:05 SPgreg

I have a similar need to know if a window and tab already exists from PowerShell scripts. Any clues or documentation you could provide would be very helpful.

Thanks, Alan

alan-skimmer avatar May 21 '25 21:05 alan-skimmer

Right now, we don't have a good way for wt to (1) read session info back from a running instance of Terminal or (2) produce its own output, since it is a Win32 (rather than Console) subsystem application.

We're also not likely to move in that direction any time soon.

Regardless, I'm gonna tag this one up for the backlog as a desirable feature.

DHowett avatar May 28 '25 19:05 DHowett

Ohh, btw, this got me thinking. Could it be possible to add a "send after start" and "send before end script" in the Profiles? Basically something that will be sent to the new tab/pane/whatever after initialization and before it exits... tangent.

Now this we have been actively resistant to add. You can run anything you want before your shell starts (pwsh -noexit -c foo) or after it exits (pwsh -noprofile -c pwsh ; foo) by coming up with increasingly wild commandlines. 🙂

DHowett avatar May 28 '25 19:05 DHowett