Let wt.exe test by window name if the corresponding window is already opened #16846

Closed
opened 2026-01-31 05:24:55 +00:00 by claunia · 5 comments
Owner

Originally created by @edshamis on GitHub (Feb 22, 2022).

Description of the new feature/enhancement

My use case: I want to keep single headless window and single tab with a favourite text editor always opened.
Now I can run wt -Mf -w vv -p Ubuntu wsl zsh -i -c vim and get this window.
But how do I check if the window is already running and run wt -w vv ft to just open it again instead of creating a new tab?

Originally created by @edshamis on GitHub (Feb 22, 2022). # Description of the new feature/enhancement My use case: I want to keep single headless window and single tab with a favourite text editor always opened. Now I can run `wt -Mf -w vv -p Ubuntu wsl zsh -i -c vim` and get this window. But how do I check if the window is already running and run `wt -w vv ft` to just open it again instead of creating a new tab?
claunia added the Issue-FeatureResolution-DuplicateArea-Windowing labels 2026-01-31 05:24:55 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Feb 23, 2022):

Ah, the key operative phrase here is

But how do I check if the window is already running

That's a good question. I suppose there isn't a great way to do that today.

  • #12135 might be a potential solution for this. For that, you'd create a "vv" profile for vim, and then you'd be able to run something like wt summon --profile vv, which would find the "nearest" terminal running the vv profile and activate it.
  • Otherwise, more complicated-ly, maybe some version of #9992, where you set the default profile/commandline for the "vv" named window to wsl zsh -i -c vim. Then, wt -w vv ft -t 0 would always work to:
    1. create the window if it doesn't exist yet (which would launch the default profile for that window, which would be vim)
    2. focus that window's first tab

Either of those sound like they'd work for you?

@zadjii-msft commented on GitHub (Feb 23, 2022): Ah, the key operative phrase here is > But how do I check if the window is already running That's a good question. I suppose there isn't a great way to do that today. * #12135 might be a potential solution for this. For that, you'd create a "vv" profile for vim, and then you'd be able to run something like `wt summon --profile vv`, which would find the "nearest" terminal running the vv profile and activate it. * Otherwise, more complicated-ly, maybe some version of #9992, where you set the default profile/commandline for the "vv" named window to `wsl zsh -i -c vim`. Then, `wt -w vv ft -t 0` would always work to: 1. create the window if it doesn't exist yet (which would launch the default profile for that window, which would be vim) 2. focus that window's first tab Either of those sound like they'd work for you?
Author
Owner

@ghost commented on GitHub (Feb 27, 2022):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Feb 27, 2022): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@edshamis commented on GitHub (Feb 28, 2022):

Thanks a lot! I'll check it later)) Peace!

@edshamis commented on GitHub (Feb 28, 2022): Thanks a lot! I'll check it later)) Peace!
Author
Owner

@zadjii-msft commented on GitHub (Feb 28, 2022):

Okay thanks!

/dup #12135
/dup #9992

@zadjii-msft commented on GitHub (Feb 28, 2022): Okay thanks! /dup #12135 /dup #9992
Author
Owner

@ghost commented on GitHub (Feb 28, 2022):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Feb 28, 2022): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16846