wt split-pane (multiple copies) seems to have occasional focus issues #9138

Closed
opened 2026-01-31 01:46:57 +00:00 by claunia · 7 comments
Owner

Originally created by @mfeemster on GitHub (Jun 19, 2020).

Originally assigned to: @zadjii-msft on GitHub.

Environment

Windows build number:  10.0.18363.0
Windows Terminal version (if applicable): 1.1.1671.0

Any other software? No

Steps to reproduce

Run a command line which opens multiple tabs, and some split panes. Supply a name for each tab using --title.

Example command line:

wt.exe -p "Command Prompt" -d . --title Cmd1 ; split-pane -H -p Cmd -d . ; new-tab -p "Windows PowerShell" -d . --title Posh1 ; new-tab -p "Windows PowerShell" -d . --title Posh2 ; split-pane -H -p "Windows PowerShell" -d . ; split-pane -H -p "Windows PowerShell" -d . ; new-tab -p "Windows PowerShell" -d . --title Posh3 ; split-pane -V -p "Windows PowerShell" -d .

Expected behavior

Each tab gets the name you assigned it.

Actual behavior

Tabs sometimes get the names you supplied, and sometimes not. Since this problem is intermittent, I suspect it's a threading bug. I would guess you are using the same string variable to parse parts of the command line successively and passing each to a thread. The variable is getting clobbered.

Also of note, this is likely the same problem that is causing #6340, because they also describe it happening intermittently.

Thanks.

Originally created by @mfeemster on GitHub (Jun 19, 2020). Originally assigned to: @zadjii-msft on GitHub. <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 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! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 10.0.18363.0 Windows Terminal version (if applicable): 1.1.1671.0 Any other software? No ``` # Steps to reproduce Run a command line which opens multiple tabs, and some split panes. Supply a name for each tab using `--title`. Example command line: `wt.exe -p "Command Prompt" -d . --title Cmd1 ; split-pane -H -p Cmd -d . ; new-tab -p "Windows PowerShell" -d . --title Posh1 ; new-tab -p "Windows PowerShell" -d . --title Posh2 ; split-pane -H -p "Windows PowerShell" -d . ; split-pane -H -p "Windows PowerShell" -d . ; new-tab -p "Windows PowerShell" -d . --title Posh3 ; split-pane -V -p "Windows PowerShell" -d .` # Expected behavior Each tab gets the name you assigned it. # Actual behavior Tabs sometimes get the names you supplied, and sometimes not. Since this problem is intermittent, I suspect it's a threading bug. I would guess you are using the same string variable to parse parts of the command line successively and passing each to a thread. The variable is getting clobbered. Also of note, this is likely the same problem that is causing #6340, because they also describe it happening intermittently. Thanks.
Author
Owner

@DHowett commented on GitHub (Jun 19, 2020):

What titles are you getting?

@DHowett commented on GitHub (Jun 19, 2020): What titles _are_ you getting?
Author
Owner

@mfeemster commented on GitHub (Jun 19, 2020):

Since the tabs I specified are either powershell or cmd, the cmd tab is randomly either Command Prompt or Cmd1, which I specified on the command line.

For the powershell tabs, I've specified Posh1, Posh2 and Posh3. Each of those is randomly the text I specified for it, or Windows PowerShell, which is the default in the settings.json file.

The randomness of it leads me to believe it's a threading bug. Run the command line I posted above several times and you'll start to see different results.

@mfeemster commented on GitHub (Jun 19, 2020): Since the tabs I specified are either powershell or cmd, the cmd tab is randomly either Command Prompt or Cmd1, which I specified on the command line. For the powershell tabs, I've specified Posh1, Posh2 and Posh3. Each of those is randomly the text I specified for it, or Windows PowerShell, which is the default in the settings.json file. The randomness of it leads me to believe it's a threading bug. Run the command line I posted above several times and you'll start to see different results.
Author
Owner

@DHowett commented on GitHub (Jun 19, 2020):

So, as far as I can tell, this is wrong for a different reason than "titles aren't working". Here's why.

I've decomposed your command into the wtscript that it runs, then annotated it.

wt.exe 
 new-tab -p "Command Prompt" -d . --title Cmd1       [1]
 split-pane -H -p Cmd -d .                           [2]
 new-tab -p "Windows PowerShell" -d . --title Posh1  [3] 
 new-tab -p "Windows PowerShell" -d . --title Posh2  [4]
 split-pane -H -p "Windows PowerShell" -d .          [5]
 split-pane -H -p "Windows PowerShell" -d .          [6]
 new-tab -p "Windows PowerShell" -d . --title Posh3  [7]
 split-pane -V -p "Windows PowerShell" -d .          [8]
  1. Open a new tab, running a terminal whose title is "Cmd1"
  2. Split that terminal, running a new terminal with the default title
  3. Open a new tab, title "Posh1"
  4. Open a new tab, title "Posh2"
  5. Split that terminal, running a new terminal with the default title
  6. Split that terminal again, running a new terminal with the default title
  7. Open a new tab, title "Posh3"
  8. Split that terminal, running a new terminal with the default title

Titles are actually attached to Terminals, not to tabs. The title shown in the tab is that of the active, focused terminal in that tab.

The issue here is that focus isn't ending up where we expect it. When you switch focus to the original split in the split pane, the title comes back.

@DHowett commented on GitHub (Jun 19, 2020): So, as far as I can tell, this is wrong for a different reason than "titles aren't working". Here's why. I've decomposed your command into the wtscript that it runs, then annotated it. ``` wt.exe new-tab -p "Command Prompt" -d . --title Cmd1 [1] split-pane -H -p Cmd -d . [2] new-tab -p "Windows PowerShell" -d . --title Posh1 [3] new-tab -p "Windows PowerShell" -d . --title Posh2 [4] split-pane -H -p "Windows PowerShell" -d . [5] split-pane -H -p "Windows PowerShell" -d . [6] new-tab -p "Windows PowerShell" -d . --title Posh3 [7] split-pane -V -p "Windows PowerShell" -d . [8] ``` 1. Open a new tab, running a terminal whose title is "`Cmd1`" 2. Split that terminal, running a new terminal _with the default title_ 3. Open a new tab, title "`Posh1`" 4. Open a new tab, title "`Posh2`" 5. Split that terminal, running a new terminal _with the default title_ 6. Split that terminal again, running a new terminal _with the default title_ 7. Open a new tab, title "`Posh3`" 8. Split that terminal, running a new terminal _with the default title_ Titles are actually attached to Terminals, not to tabs. The title shown in the tab is that of the active, focused terminal in that tab. The issue here is that _focus isn't ending up where we expect it._ When you switch focus to the original split in the split pane, the title comes back.
Author
Owner

@mfeemster commented on GitHub (Jun 19, 2020):

Ah ok, that is very interesting. Thank you!

This now seems also bit more like user error on my part. Every pane needs a title, not just every tab. I will handle my setup by naming each pane, no problem.

Maybe clarify the documentation to state this clearly?

@mfeemster commented on GitHub (Jun 19, 2020): Ah ok, that is very interesting. Thank you! This now seems also bit more like user error on my part. Every *pane* needs a title, not just every *tab*. I will handle my setup by naming each pane, no problem. Maybe clarify the documentation to state this clearly?
Author
Owner

@ghost commented on GitHub (Aug 31, 2021):

:tada:This issue was addressed in #10978, which has now been successfully released as Windows Terminal Preview v1.10.2383.0.🎉

Handy links:

@ghost commented on GitHub (Aug 31, 2021): :tada:This issue was addressed in #10978, which has now been successfully released as `Windows Terminal Preview v1.10.2383.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.10.2383.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Aug 31, 2021):

:tada:This issue was addressed in #10978, which has now been successfully released as Windows Terminal Preview v1.11.2421.0.🎉

Handy links:

@ghost commented on GitHub (Aug 31, 2021): :tada:This issue was addressed in #10978, which has now been successfully released as `Windows Terminal Preview v1.11.2421.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.11.2421.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Oct 20, 2021):

:tada:This issue was addressed in #10978, which has now been successfully released as Windows Terminal Preview v1.12.2922.0.🎉

Handy links:

@ghost commented on GitHub (Oct 20, 2021): :tada:This issue was addressed in #10978, which has now been successfully released as `Windows Terminal Preview v1.12.2922.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.12.2922.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9138