Skip to content

Fix Ctrl+F7 view switcher showing same name for multi-instance views#4134

Open
Philipp0205 wants to merge 1 commit into
eclipse-platform:masterfrom
Philipp0205:fix/view-switcher-multi-instance-names
Open

Fix Ctrl+F7 view switcher showing same name for multi-instance views#4134
Philipp0205 wants to merge 1 commit into
eclipse-platform:masterfrom
Philipp0205:fix/view-switcher-multi-instance-names

Conversation

@Philipp0205

@Philipp0205 Philipp0205 commented Jun 22, 2026

Copy link
Copy Markdown

Change made: Removed the getPartName() override from ViewReference.java.

Views like Terminal call setPartName("Terminal " + secondaryId) which triggers CompatibilityPart to update the E4 model via part.setLabel(computeLabel()). The parent class WorkbenchPartReference.getPartName() returns part.getLocalizedLabel() which reflects this dynamic name (e.g. Terminal 1, Terminal 2 instead of Terminal Terminal).

The removed override was bypassing this by always returning the static plugin.xml descriptor label. Generic fix: Works for all multi-instance views (Terminal, Console, Search).

Fixes eclipse-platform/eclipse.platform#2774

Remove the getPartName() override in ViewReference that always returned
the static descriptor label from plugin.xml. The parent class
WorkbenchPartReference.getPartName() returns part.getLocalizedLabel()
which reflects the dynamic name set by views via setPartName().

This is a generic fix for all multi-instance views (Terminal, Console,
Search) that customize their part name.

Fixes eclipse-platform/eclipse.platform#2774
@iloveeclipse iloveeclipse force-pushed the fix/view-switcher-multi-instance-names branch from 7837dac to b566f4b Compare June 22, 2026 20:17
@iloveeclipse

Copy link
Copy Markdown
Member

@Philipp0205 : I've rebased your branch on latest master state. Your state was very old.

@Philipp0205

Copy link
Copy Markdown
Author

@iloveeclipse thanks, I forgot to update my fork 🙃

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

   855 files  ±0     855 suites  ±0   57m 5s ⏱️ + 2m 11s
 8 083 tests ±0   7 840 ✅ ±0  243 💤 ±0  0 ❌ ±0 
20 151 runs  ±0  19 497 ✅ ±0  654 💤 ±0  0 ❌ ±0 

Results for commit b566f4b. ± Comparison against base commit b7e7e0a.

@iloveeclipse

Copy link
Copy Markdown
Member

This works for Terminal views but doesn't work for Console / Search views - they also show exact same names in the tabs. I guess the way how Terminal (coming originally from CDT) manages its name differs from "regular" multi-instance views which were developed in the Platform.

Ideally we should investigate what is the difference and provide a fix that works consistently for all views.

@Philipp0205

Copy link
Copy Markdown
Author

okay, apparently I did not test this good enough. I also noticed that console and search views do not add numbers to their tab names if opened multiple times.

Let me have another look at the other views.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terminal views all show same name 'Terminal' in Ctrl+F7 view switcher popup

2 participants