question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tabs API does not allow to identify internal tabs

See original GitHub issue

Type: 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:open
  • Created a year ago
  • Reactions:22
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
lramos15commented, Oct 25, 2022

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.

0reactions
McSodbrennercommented, Oct 26, 2022

@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 via vscode.open and vscode.diff. A reveal() would give you the possibility to switch to the settings, for example, because the label 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. The label is unfortunately language dependent and therefore not usable as a key.

Read more comments on GitHub >

github_iconTop Results From Across the Web

chrome.tabs - Chrome Developers
The Tabs API not only offers features for manipulating and managing tabs, but can also detect the language of the tab, take a...
Read more >
Working with the Tabs API - Mozilla - MDN Web Docs
Tabs let a user open several web pages in their browser window and then switch between those web pages. With the Tabs API,...
Read more >
Why doesn't chrome.tabs.query() return the tab's URL when ...
Even stranger is that I've sometimes seen the URL available from within that call to chrome.tabs.query() inside the require() call. But mostly it...
Read more >
4 Ways to Communicate Across Browser Tabs in Realtime
As a result, we can find multiple ways of achieving similar functionality. ... The Broadcast Channel API allows communication between Tabs, ...
Read more >
View and Edit Tab Settings in Permission Sets and Profiles
Which Salesforce Apps Don't Support Shield Platform Encryption? How Does Shield Platform Encryption Work in a Sandbox? Check Your Cache-Only Key Connection ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found