Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a command to open a new window as tab (Sierra tabs) #25919

Closed
miltonbecker opened this issue May 4, 2017 · 36 comments
Closed

Add a command to open a new window as tab (Sierra tabs) #25919

miltonbecker opened this issue May 4, 2017 · 36 comments
Assignees
Labels
electron Issues and items related to Electron feature-request Request for new features or functionality upstream Issue identified as 'upstream' component related (exists outside of VS Code) verification-needed Verification of issue is requested verified Verification succeeded workbench-os-integration Native OS integration issues workbench-window Window management
Milestone

Comments

@miltonbecker
Copy link

miltonbecker commented May 4, 2017

  • VSCode Version: 1.12
  • OS Version: macOS Sierra

Steps to Reproduce:

  1. Enable window.nativeTabs in settings
  2. Click on View -> Show Tab Bar
  3. Try to open a new tab now - there is no File -> New Tab, pressing cmd+shift+t or cmd+t doesn't open a tab either, double clicking the tab also doesn't do anything.

The only way to use the new native tab on macOS is to open a new vscode window then drag one tab into another window.

@kieferrm
Copy link
Member

kieferrm commented May 4, 2017

@miltonbecker the behavior New window depends on your OS setting.

@kieferrm kieferrm added the feature-request Request for new features or functionality label May 4, 2017
@miltonbecker
Copy link
Author

@kieferrm what setting specifically?

@gdad-s-river
Copy link

gdad-s-river commented May 4, 2017

@miltonbecker ⌘ + ⇧ + n does it for me

@miltonbecker
Copy link
Author

@gdad-s-river that opens a new window here. I'm wondering what OS setting I have to change :/

@Richard-Scap
Copy link

I'm having the same issue. Code version 1.12, OS version 10.12.3

Also, any reason why 'Show Tab Bar' is not available in the Command Palette?

@sgnh
Copy link

sgnh commented May 4, 2017

You can change this under "System Preferences" -> "Dock".
dock

@miltonbecker
Copy link
Author

@sgnh that works, thanks!

But now there is another problem: I can't open a new window 😆
So it's either window OR tab.

I believe there should be a "File -> New Tab" menu option and a "+" button so we can add more tabs easily.

Anyway, should I close this issue or leave it as a feature request?

@jaybeecave
Copy link

This was working as expected in 1.12. All new windows would open in new tabs.. 1.12.1 its broken again. Now when I open 2 projects from command line they are back to opening in seperate windows...

@HADB
Copy link

HADB commented May 5, 2017

There's no "Show Tab Bar" in 1.12.1 😭

@HADB
Copy link

HADB commented May 5, 2017

I found the problem.
If set "window.newWindowDimensions" to "fullscreen", the new window will not show as tab bar even if in fullscreen.
But new window will open as tab when current window is in fullscree, "window.newWindowDimensions" is set to "default" and "window.nativeTabs" is set to true.

@balupton
Copy link

balupton commented May 5, 2017

this is totally not what I was expecting by this... I was expecting that tabs would now use the native tab bar - not windows

@gianmarcotoso
Copy link

I would like to add that calling code on a folder/file from the command line opens a new window regardless of the window.nativeTabs setting.

@bpasero
Copy link
Member

bpasero commented May 5, 2017

Our intention was never to replace the editor tabs with native tabs. Native tabs are to group windows. It is true that we might provide limited functionality, hence we should collect more issues in this item and then propose changes to Electron 👍

Related issues: electron/electron#9086 and electron/electron#9094

@bpasero bpasero added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label May 5, 2017
@bpasero bpasero removed their assignment May 5, 2017
@bpasero bpasero changed the title No way to open a new native tab in vscode 1.12 Improve native tabs (Sierra) functionality May 5, 2017
@yingbo
Copy link

yingbo commented May 9, 2017

It's very confusing to have both "native tabs" and "editor tabs". I think giving users an option to replace editor tabs by the native one is great. Otherwise, the native tabs is, at least to me, not useful at all.

@gianmarcotoso
Copy link

@yingbo For me native tabs play a different roles than editor tabs: I use native tabs to have multiple projects opened, while editor tabs (actually, I keep open files on the sidebar) for the single project's files. This way I don't need to have multiple VSCode windows open!

@davistan
Copy link

In File menu, should have New Tab and New Window (like in Chrome). There will be New File menu which is just adding a tab in editor.

For Window menu, it should have "Merge All Windows". If you're using SourceTree you know what I meant.

And to make it more usable, adding a + icon beside the native tabs will be natural for UX. Refer to Safari browser.

This is my 2 cents. Hope this helps.

@kethinov
Copy link

kethinov commented May 16, 2017

For anyone struggling to get View > Show Tab Bar to appear, pasting "window.nativeTabs": true into settings.json and manually quitting and reopening the app doesn't appear to work. You have to fish for it under "Search Settings" on the left panel via Preferences > Settings, click the edit icon, and set it to true that way. That will have the effect of pasting "window.nativeTabs": true into settings.json, but it will also trigger code to prompt you to restart the editor, after which if you answer yes, it will actually display the new View > Show Tab Bar option.

@LeoNatan
Copy link

The current implementation goes against Cocoa design guidelines for the tabs, thus extremely confusing and one has to wonder what was the point of implementing in the first place. Tabs are meant for document apps to be able to collect multiple windows (each displaying a document). Sounds a lot like “editor tabs”. There should be an option to replace editor tabs completely, if this is what users prefer. I reckon most Mac users would prefer using native tabs rather than “editor tabs”.

@qbilius
Copy link

qbilius commented Jun 20, 2017

Native tabs work just fine for me in 1.13.1 but after restarting VS Code all these tabs open in new separate windows. Since there is no "Merge All Windows" option, the only way to put them back into a single window is drag and drop, which is really inconvenient.

@beeing
Copy link

beeing commented Jul 13, 2017

I thought I saw merge all windows to tabs, but now in 1.14.0 it's gone.

@okonon
Copy link

okonon commented Aug 4, 2017

I can't get native tabs to work either. Version 1.14.2 (1.14.2)

@bishless
Copy link

If I pair these two settings, I can get native tabs to work in 1.15.0.

"window.nativeTabs": true,
"window.openFoldersInNewWindow": "on",

@DavidBabel
Copy link

DavidBabel commented Aug 29, 2017

It worked for me for a long time, but after rewrite my config (for cleanup) it broke and it's now impossible to get native tabs back again.
I tried everything mentionned above, and it's broken, even on fresh install. Maybe something to change at the system config level.

Sierra 10.12.6
vscode 1.15.1

The only workaround i found for now is to set this settings to "Always" :
image
But it's a global settings for the whole system.

@bpasero
Copy link
Member

bpasero commented Sep 10, 2017

Latest VS Code insider releases (https://code.visualstudio.com/insiders) come with some additional features for native tab support:

  • there is a "+" in the tab well to create a new tab (= empty window)
  • there are new commands to manage tabs under the window menu (Show Next Tab, Show Previous Tab, Merge All Windows, Move Tab to New Window)
  • all commands are also accessible from command palette and can have keybindings (including the command Toggle Windows Tabs Bar to show or hide the tab bar)

See https://twitter.com/BenjaminPasero/status/906162846186209281

@miltonbecker
Copy link
Author

The new stable release (1.17.0) has completely broken the native tabs support on macOS High Sierra (10.13).

  • The tab bar is now blank, completely blank. I can't see any tab, nor text, nor the + sign.
  • When I click on the supposed-to-be tab bar, a new window opens instead.
  • When I click on "Merge All Windows", I can't see any tabs on the tab bar. However, I can see the tabs when I click on "Show All Tabs".

@bpasero
Copy link
Member

bpasero commented Oct 6, 2017

High Sierra is covered in #35361

@bpasero bpasero added electron Issues and items related to Electron workbench-os-integration Native OS integration issues workbench-electron Electron-VS Code issues and removed workbench labels Nov 16, 2017
@qiuyuntao
Copy link

qiuyuntao commented Jan 9, 2018

In my vscode, tabbar is still blank.
MacOS version 10.13.2
vscode version 1.19.1

image

@DavidBabel
Copy link

Try to update to 1.19.2

@miltonbecker
Copy link
Author

@qiuyuntao @DavidBabel this issue is caused by an electron issue. You can see the electron issue at electron/electron#10657.

We can only hope that issue gets fixed soon :(

@jatinwaichal
Copy link

Hi, I am not sure if this issue is fixed or not.
I am using Mac OS High Sierra 10.13.4 & Visual Studio 1.23.1.
I tried setting the nativtab to true, and other setting mentioned above. But it is still not working.
I know it was working before.

Any help or guidance I highly appreciated.

@miltonbecker
Copy link
Author

@jatinwaichal the source issue was apparently fixed on electron 2.0.
So now we're waiting for vscode to upgrade its electron from 1.7 to 2.0 😄
You can follow this process here: #45542

@jatinwaichal
Copy link

thanks, @miltonbecker for the update. I will keep an eye on the other ticket

@miltonbecker
Copy link
Author

miltonbecker commented Jun 9, 2018

bpasero found a fix! It's still not official but I can confirm it works! (and in the end this issue might not have anything to do with electron hah)

you can check the comments here: #35361 (comment)

and the quick-fix-command as said by johnelm (you have to run it after every vscode update, for now):
sed -i -- 's/com.microsoft.VSCode/com.microsoft2.VSCode/g' /Applications/Visual\ Studio\ Code.app/Contents/Info.plist

@bpasero bpasero changed the title Improve native tabs (Sierra) functionality Add a command to open a new window as tab (Sierra tabs) Jul 8, 2018
@bpasero bpasero added workbench-window Window management and removed workbench-electron Electron-VS Code issues labels Aug 6, 2018
@bpasero bpasero self-assigned this Aug 7, 2018
@bpasero bpasero added this to the August 2018 milestone Aug 7, 2018
@bpasero bpasero added the verification-needed Verification of issue is requested label Aug 7, 2018
@bpasero bpasero closed this as completed in 6f3f9ed Aug 7, 2018
@bpasero
Copy link
Member

bpasero commented Aug 7, 2018

With Electron 2.0.x we can have a new "New Tab" entry under the "Window" menu to open a new window as window tab:

image

There is also a new command to assign a keybinding to: workbench.action.newWindowTab

Verifier:

  • you need to enable "window.nativeTabs": true and restart
  • you can use the command from the Window menu
  • you can use the command via keybinding or command palette

bpasero added a commit that referenced this issue Aug 8, 2018
@spike1292
Copy link

@bpasero Awesome! The new tab is working like a charm in the latest insiders build.

Just installed vscode insiders on a new Mac

screen shot 2018-08-18 at 17 57 30

and it's not showing the tabs any more. I didn't see this problem when I updated from 1.25 to 1.26.

So I think electron 2.0.x broke setting the NSUseImprovedLayoutPass default, see https://github.com/Microsoft/vscode/blob/b6411f27b0e41588fa897d51c34eafb636f6cbae/src/vs/code/electron-main/app.ts#L293

After I set the defaults manually:

defaults write com.microsoft.VSCodeInsiders NSUseImprovedLayoutPass -bool true

The tabs show up!
screen shot 2018-08-18 at 18 08 29

@bpasero
Copy link
Member

bpasero commented Aug 19, 2018

@spike1292 I cannot reproduce that, it works fine for me using insiders.

@jrieken jrieken added the verified Verification succeeded label Aug 28, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Sep 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
electron Issues and items related to Electron feature-request Request for new features or functionality upstream Issue identified as 'upstream' component related (exists outside of VS Code) verification-needed Verification of issue is requested verified Verification succeeded workbench-os-integration Native OS integration issues workbench-window Window management
Projects
None yet
Development

No branches or pull requests