Debug Assertion Failure 'Expression: vector subscript out of range'" #1435

Open
opened 2026-01-30 22:27:02 +00:00 by claunia · 0 comments
Owner

Originally created by @compnerd on GitHub (May 31, 2019).

Environment

Windows build number: Microsoft Windows [Version 10.0.18908.1000]
Windows Terminal version (if applicable): 71e19cd82528d66a0a7867cbed85990cfc1685f1

Steps to reproduce

launch Terminal
create cmd tab
close PowerShell tab via x on tab
type word^W into cmd

Expected behavior

Close the terminal (really, I would like readine completion)

Actual behavior

Invalid vector access.

Seems that the _GetFocusedTabIndex is returning the index unadjusted for the closing of the tab. I think that _RemoveTabViewItem is not readjusting the index. The shared_ptr is constructed by indexing into _tabs by _GetFocusedTabIndex. That calculates the index by _tabView.SelectedIndex The _RemoveTabViewItem does not update the index. I can not seem to track down where the implementation for the tab bar renderer is handled (I suspect due to the Xaml bits). Some pointers as to where to start digging would be appreciated.

Originally created by @compnerd on GitHub (May 31, 2019). <!-- 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. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: Microsoft Windows [Version 10.0.18908.1000] Windows Terminal version (if applicable): 71e19cd82528d66a0a7867cbed85990cfc1685f1 ``` # Steps to reproduce launch Terminal create cmd tab close PowerShell tab via x on tab type `word^W` into cmd # Expected behavior Close the terminal (really, I would like readine completion) # Actual behavior Invalid vector access. Seems that the `_GetFocusedTabIndex` is returning the index unadjusted for the closing of the tab. I think that `_RemoveTabViewItem` is not readjusting the index. The `shared_ptr` is constructed by indexing into `_tabs` by `_GetFocusedTabIndex`. That calculates the index by `_tabView.SelectedIndex` The `_RemoveTabViewItem` does not update the index. I can not seem to track down where the implementation for the tab bar renderer is handled (I suspect due to the Xaml bits). Some pointers as to where to start digging would be appreciated.
claunia added the Issue-BugNeeds-Tag-FixProduct-TerminalArea-UserInterface labels 2026-01-30 22:27:02 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1435