Tabs API does not allow to identify internal tabs
See original GitHub issueType: Bug
If you set a listener to vscode.window.tabGroups.onDidChangeTabs
, you will only get an undefined
for tab.input
when switching to the “Settings” or the “Keyboard Shortcuts”.
vscode.window.tabGroups.onDidChangeTabs((tabs) => {
if (tabs.changed.length) {
tabs.changed.forEach(tab => {
console.log(tab.input);
})
}
});
Since the tab object does not contain any meaningful usable indication of what the user is actually looking at (except for the label
, which is language dependent though), it is not possible to build a complete replacement for the “Open Editors” panel.
Here an internal uri object (with path: "vscode://settings"
) would be useful, so that one can open the tab via vscode.open
as with all other tab items.
VS Code version: Code 1.70.2 (e4503b30fc78200f846c62cf8091b76ff5547662, 2022-08-16T05:35:13.448Z) OS version: Windows_NT x64 10.0.22000 Modes: Remote OS version: Linux x64 5.10.16.3-microsoft-standard-WSL2
System Info
Item | Value |
---|---|
CPUs | Intel® Core™ i3-8130U CPU @ 2.20GHz (4 x 2208) |
GPU Status | 2d_canvas: enabled canvas_oop_rasterization: disabled_off direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_renderer: enabled_on video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled |
Load (avg) | undefined |
Memory (System) | 7.91GB (0.49GB free) |
Process Argv | –crash-reporter-id f99464a5-8822-46d7-a621-d6395d9680b9 --crash-reporter-id f99464a5-8822-46d7-a621-d6395d9680b9 |
Screen Reader | no |
VM | 0% |
Item | Value |
---|---|
Remote | WSL: Ubuntu |
OS | Linux x64 5.10.16.3-microsoft-standard-WSL2 |
CPUs | Intel® Core™ i3-8130U CPU @ 2.20GHz (4 x 2207) |
Memory (System) | 3.79GB (0.66GB free) |
VM | 0% |
Issue Analytics
- State:
- Created a year ago
- Reactions:22
- Comments:7 (1 by maintainers)
Top GitHub Comments
It’s at 19, which is close enough. I’ll explore this item, but make no promises surrounding it’s implementation as those internal tabs don’t really have URIs so calling
vscode.open
is unlikely to work.@lramos15 It may not even be necessary for the internal pages to have URLs. Maybe it is enough to have the possibility to switch to a tab, regardless of the content of the tab (
reveal()
,select()
… whatever). At the moment there is only the possibility to close a tab (TabGroup.close()
) or open it viavscode.open
andvscode.diff
. Areveal()
would give you the possibility to switch to the settings, for example, because thelabel
is currently already included in its tab. On the other hand, it would be nice to have some more info about the internal tabs (“Keyboard shortcuts”, “Settings” etc.), so that you can see without a doubt that it is the respective page and you can display the corresponding icons. Thelabel
is unfortunately language dependent and therefore not usable as a key.