Rename Tab Access


#1

I have a lot of index.js and index.html files in my project. This leads to a lot of tabs with the same name.

It would be nice to have a package that changes the tab name to reflect the directory it is in. So instead of ‘index.js - dir/dir/WidgetView’ and ‘index.html - dir/dir/WidgetView’, it would be ‘WidgetView (JS) - dir/dir’ and ‘WidgetView (HTML) - dir/dir’.

I have tried to create a package to do this, but I was unable to access the tab name to change it. How I can change the tab name through the Atom API?


#2

You can’t, but it isn’t hard to find using DOM selectors. Look at the code for any package that adds icons to tabs or changes appearance. web-browser is one but I’m sure there are simpler ones.


#3

You could add a service consumer to the tabs package (this would require a PR for the tabs package) perhaps that allows someone to override the tab naming scheme. That way your package could just provide a “tab naming service”.