Ability to identify pane ids #14581

Open
opened 2026-01-31 04:14:06 +00:00 by claunia · 3 comments
Owner

Originally created by @Rosefield on GitHub (Jul 19, 2021).

Description of the new feature/enhancement

If features are going to be added that rely on the user providing a pane id, e.g. focus-pane $id or swap-panes -s $sid -t $tid it would be helpful to have a command (perhaps identify-pane) that identifies what the ids of each pane are. This would require making the currently internal _id public, or choosing some other method of identifying each pane.

This might look like (briefly?) showing the id centered in each pane (excuse the paint mockup)

image

Proposed technical implementation details (optional)

Originally created by @Rosefield on GitHub (Jul 19, 2021). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement If features are going to be added that rely on the user providing a pane id, e.g. `focus-pane $id` or `swap-panes -s $sid -t $tid` it would be helpful to have a command (perhaps `identify-pane`) that identifies what the ids of each pane are. This would require making the currently internal `_id` public, or choosing some other method of identifying each pane. This might look like (briefly?) showing the id centered in each pane (excuse the paint mockup) ![image](https://user-images.githubusercontent.com/6185249/126178368-02cf3e06-703c-49e5-9836-19104cb7f130.png) <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details (optional) <!-- A clear and concise description of what you want to happen. -->
claunia added the Issue-TaskProduct-TerminalArea-UserInterface labels 2026-01-31 04:14:06 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Jul 19, 2021):

you know, we've got this as a sub-point in #8592, but I guess it deserves it's own specific tracking task. Thanks!

@zadjii-msft commented on GitHub (Jul 19, 2021): you know, we've got this as a sub-point in #8592, but I guess it deserves it's own specific tracking task. Thanks!
Author
Owner

@noheromen commented on GitHub (Jan 9, 2023):

Hi, any update here? It would be perfect to see list of all tabs and panes, and perhaps see which shell, what process is running in them?

I want to be able to jump to specific tab or pane, depending on the app (lets say I have nvim open in tab 3, pane 2). I could get ID of process, but I have no way to match it to that tab 3, pane 2... I would have to myself keep track what is where open....

Would it be possible to have command like:
"wt list tabs and panes"
output:

  1. pwsh process ID 10456/pwsh process ID 10452 (here are two panes)
  2. mingw process ID 10534
  3. wsl proces ID 102345
    eg...
@noheromen commented on GitHub (Jan 9, 2023): Hi, any update here? It would be perfect to see list of all tabs and panes, and perhaps see which shell, what process is running in them? I want to be able to jump to specific tab or pane, depending on the app (lets say I have nvim open in tab 3, pane 2). I could get ID of process, but I have no way to match it to that tab 3, pane 2... I would have to myself keep track what is where open.... Would it be possible to have command like: "wt list tabs and panes" output: 0. pwsh process ID 10456/pwsh process ID 10452 (here are two panes) 1. mingw process ID 10534 2. wsl proces ID 102345 eg...
Author
Owner

@woodda commented on GitHub (Apr 6, 2024):

I would be immensely interested in this too. It would also be especially useful to expose the specific Window/Tab/Pane IDs for each of the Windows Terminal "viewports" within the env vars of its contained Bash shell, Command Window or Power Shell window for easy retrieval. This way, the values could be used to essentially track a specific "viewport" between re-launches of Windows Terminal, after it re-renders its layout.

I have a S.O. question opened about this, but I fear it is not currently possible to access the window/tab/pane IDs within a Linux shell environment running within Windows Terminal (specifically, within WSL2+Ubuntu). And the existing "WT_SESSION" and WSL_INTEROP bash shell environment variables are different each time a Bash shell is created when Windows Terminal restarts (i.e., those values don't persist after pre-rendering the layout).

The specific use case I have is to use Windows Terminal as my primary terminal multiplexer, but reconnect individually persisted Gnu Screen sessions to each re-opened bash shell in the Windows Terminal layout, no matter what the dynamic layout is. Then, with the window/tab/pane IDs exposed in the env vars of the shell, one could have their .bashrc file construct a unique name to assign to the individual Gnu Screen session associated with that specific Bash shell instance running on that particular WT viewport. The ID values (or indexes) would be the same after a Window Terminal restart and re-layout, and thus the same Gnu Screen session IDs could be reconstructed in .bashrc in order to reattached the original Screen session to the same viewport.

This doesn't seem to be a particularly difficult ask. Yet myriad benefits could arise from having these values exposed in the environment of the command process running in the viewport. One could write a command to display the unique viewport ID or number (or a "tuple" of window/tab/pane index values), have Bash scripts restart specific actions based on which viewport they start in, etc.

@woodda commented on GitHub (Apr 6, 2024): I would be immensely interested in this too. It would also be especially useful to expose the specific Window/Tab/Pane IDs for each of the Windows Terminal "viewports" within the env vars of its contained Bash shell, Command Window or Power Shell window for easy retrieval. This way, the values could be used to essentially track a specific "viewport" between re-launches of Windows Terminal, after it re-renders its layout. I have a S.O. question opened about this, but I fear it is not currently possible to access the window/tab/pane IDs within a Linux shell environment running within Windows Terminal (specifically, within WSL2+Ubuntu). And the existing "WT_SESSION" and WSL_INTEROP bash shell environment variables are different each time a Bash shell is created when Windows Terminal restarts (i.e., those values don't persist after pre-rendering the layout). The specific use case I have is to use Windows Terminal as my primary terminal multiplexer, but reconnect individually persisted Gnu Screen sessions to each re-opened bash shell in the Windows Terminal layout, no matter what the dynamic layout is. Then, with the window/tab/pane IDs exposed in the env vars of the shell, one could have their .bashrc file construct a unique name to assign to the individual Gnu Screen session associated with that specific Bash shell instance running on that particular WT viewport. The ID values (or indexes) would be the same after a Window Terminal restart and re-layout, and thus the same Gnu Screen session IDs could be reconstructed in .bashrc in order to reattached the original Screen session to the same viewport. This doesn't seem to be a particularly difficult ask. Yet myriad benefits could arise from having these values exposed in the environment of the command process running in the viewport. One could write a command to display the unique viewport ID or number (or a "tuple" of window/tab/pane index values), have Bash scripts restart specific actions based on which viewport they start in, etc.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14581