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

Allow to minimize VS Code to tray #11723

Closed
MoshiMoshi0 opened this issue Sep 8, 2016 · 44 comments
Closed

Allow to minimize VS Code to tray #11723

MoshiMoshi0 opened this issue Sep 8, 2016 · 44 comments
Labels
feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code workbench-window Window management
Milestone

Comments

@MoshiMoshi0
Copy link

Even though VSC is launching very fast (clean install, 3s on my machine) it is not instant like the classic sublime text or N++.
If we could keep the editor loaded all the time we would get faster file opening times by sacrificing ram.

Therefore I suggest addition of editor tray and "Minimize to tray"/"Close to tray" options.
The editor would be then closed by right clicking the tray icon and selecting "close" option there.

@ramya-rao-a ramya-rao-a added install-update VS Code installation and upgrade system issues and removed install-update VS Code installation and upgrade system issues labels Sep 8, 2016
@bpasero bpasero changed the title Feature: Add close to tray option Allow to minimize VS Code to tray Sep 9, 2016
@bpasero bpasero added feature-request Request for new features or functionality workbench labels Sep 9, 2016
@bpasero bpasero added this to the Backlog milestone Sep 9, 2016
@PowerWeb5
Copy link

PowerWeb5 commented Jan 15, 2017

This would be very helpful, making it feasible to preload vscode on startup, as is necessary, as vscode is extremely slow to launch to use as a Notepad++ replacement, taking 11 seconds for a cold startup and 7-8 seconds for Reload Window after that. This is with high-end SSD, quad-core CPU and all extensions disabled, even with vscode added excluded by Webroot and Anti-Malware.

@CBuntrock
Copy link

I agree. Just keep it in RAM and show on file opening (e.g. add a new tab with the file).

@PowerWeb5
Copy link

@bpasero @jrieken
Could this be added as a workaround for extremely slow startup described in #15455 ?

Even if some have faster startup for some reason, it would shave off at least 2-3 seconds for them, which could make the difference it not being annoying to use as a Notepad++ replacement for opening misc text files.
Also, even for those with faster startup initially, adding a number of extensions could still slow down further.

@tivoa-gigatronik
Copy link

Closing VS Code to tray and pinning important files just like important tabs in the browser would improve my productivity SO MUCH.
The use-case is: I open an important file, then open some log, read it and by accident keep closing VS Code with the X button. Then I have to reopen the program and reopen the important file I am working on.

Please think about these two (imo) related features that make working for some people way more productive.

@m34nbunny
Copy link

Can't wait for this feature

@Otiel
Copy link

Otiel commented Oct 18, 2017

I hope we get this in the near future so that VS Code can finally replace Notepad++.

@kikloo
Copy link

kikloo commented Nov 9, 2017

Hi,

I also today removed Notepad++ and installed VS code. Just need to add an option to make it so that when clicking X or Alt+F4 there it minimizes to tray instead of closing so the re-loading is faster. I have i5, 16 GB RAM and SSD but its still not fast enough to load up like Notepad++.

Thanks.

@bpasero bpasero removed this from the Backlog milestone Nov 16, 2017
@bpasero bpasero added workbench-electron Electron-VS Code issues and removed workbench labels Nov 21, 2017
@farid-fari
Copy link

@PowerAccess You should really be looking into other things than the vscode github repo if it's taking 7 seconds to load on a quad-core. More than likely you have a strong bottleneck somewhere else, or a botched installation or maybe even a virus.

There is clearly more to it than that and closing to tray won't solve the problem for you at all.

@PowerWeb5
Copy link

@farid-fari
It was Malwarebytes Anti-malware inspection which was the bottleneck, as I believe I may have detailed elsewhere, even after whitelisting. However, close to tray would certainly workaround that, because the slow open only occurs on first launch, due, I would think, inspection of vscode's many components, etc - and not for any consecutive opening of additional content files after that in vscode.

Even with AV disabled, vscode is a bit slow IMO in opening (though not as bad) especially with plugins, if you include time until file content first gets rendered (and disabling major AV's isn't neccisarily a good suggested workaround) - though at least it's absolutely nothing like time to open in full Visual Studio, hence why I use vscode as default text editor.

@kikloo
Copy link

kikloo commented Apr 6, 2018

Yes its not as instant as N++ but takes 2 seconds to load and then to colour the code. How to speed it up ?

@farid-fari
Copy link

@kikloo you probably can't do much. Microsoft are doing their best to make it as fast as possible but the overhead from electron (no debates pls) makes it hard to go under a certain limit.

@bpasero bpasero added the workbench-window Window management label Aug 6, 2018
@bartosz-jarmuz
Copy link

Also, please bear in mind that it's not necessarily a matter of VS Code performance / slow machines etc.

If you have opened a file / bunch of files on a remote location, then even if your machine is very fast, it will be as slow as the network connection - and if the file has gone unavailable (lost network, whatever), it will take even more.

Keeping it running all the time is the way to go.

@bpasero bpasero added this to the Backlog milestone Oct 24, 2019
@ViperLuna
Copy link

ViperLuna commented Mar 1, 2020

I can't believe I'm seeing people outraged because a program takes a whole 11 seconds to load. That is some kind of serious problem right there. One can do so many things in 11 seconds and that should be outlawed. You must have been pacing back and forth in anticipation.

@akka-clema
Copy link

I can't believe I'm seeing people outraged because a program takes a whole 11 seconds to load. That is some kind of serious problem right there. One can do so many things in 11 seconds and that should be outlawed. You must have been pacing back and forth in anticipation.

It's not about the 11 seconds once. It's happening all the time, if you're used to close this kind of application. Having Code in the background all the time would bring a bit benefit for some developers, that need the feature.

@ViperLuna
Copy link

I can't believe I'm seeing people outraged because a program takes a whole 11 seconds to load. That is some kind of serious problem right there. One can do so many things in 11 seconds and that should be outlawed. You must have been pacing back and forth in anticipation.

It's not about the 11 seconds once. It's happening all the time, if you're used to close this kind of application. Having Code in the background all the time would bring a bit benefit for some developers, that need the feature.

Having Code run in the background is a wonderful idea. I believe that would benefit any programmer who needs their code to stay running throughout the day. Most people I know have had at least one opportunity where their mouse slipped off of the desk and it just happened to slide up to the corner and hit the X button when it landed. Or people like me who have children who sneak over and click things.
But closing the application and reopening it is more annoying than waiting 11 seconds. My comment wasn't about the idea of running Code in the tray. Maybe it's because I'm from a time when computers took 60 seconds or longer to load a good programming software other than something as small as QBASIC, which took about 5 seconds. Regardless, how impatient do you really have to be to get upset about 11 seconds of loading speed? That, in itself, certainly has to be the least of all problems. Load the software, turn your head, take a sip of coffee, or bite into your sandwich, whatever, and you've just compensated for that tragic 11 second debacle.

@Merlin2001
Copy link

Merlin2001 commented Mar 24, 2020

As a workaround, I'm currently using the excellent RBTray and its <Win> + <Alt> + <Down> shortcut (or <Shift> + <Right Click> on the title bar) to minimize VS Code to the tray.
The downside of this approach is, that you'll still have to manually click the tray icon to bring VS Code back to the front after opening a file.

tl;dr: Minimizing to tray is still a desperately needed feature!

@PowerCoder
Copy link

I just like minimizing programs I don't use all the time to the tray. I suppose I can put them on a second desktop, but I like my tray.

@Impose-d
Copy link

Impose-d commented Mar 29, 2020 via email

@bo-liao
Copy link

bo-liao commented Apr 20, 2020

I am not sure we can achieve it by the way like minimize outlook to tray.

@vscodebot vscodebot bot added the *out-of-scope Posted issue is not in scope of VS Code label Nov 3, 2020
@connorp2311
Copy link

Please?

@acodecow
Copy link

acodecow commented Jan 7, 2021

Hope consider it again

@connorp2311
Copy link

Plz?

@luisluftcrossover
Copy link

Please do it!

@spaceclottey
Copy link

Please consider again, would find this feature super useful

@adhptrh
Copy link

adhptrh commented Feb 21, 2021

go go minimize vs code to tray

@travexyz
Copy link

bruh, please do a minimize vscode to tray setting

@SekiBetu
Copy link

SekiBetu commented Mar 30, 2021

just uninstalled the notepad, hope vscode can replace it, but only to find out that it takes too much time on launching.
it's a really useful function for me that keeps it running in backgroud, opens any files in a second.
can we reconsider about this?

@jaanli
Copy link

jaanli commented May 20, 2021

Seconded -- VS Code really takes way too much time to launch compared to others. Having the window launch maximized on startup is not nice.

@jaanli
Copy link

jaanli commented May 20, 2021

For reference, this workaround I tried does NOT work

  1. Start menu -> open "Run"
  2. Type in "shell:startup"
  3. Copy and paste the VS Code shortcut into the startup folder (C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup)
  4. Right click on the VS Code shortcut, select properties
  5. Under "Run", select "Minimized"

@teamayu
Copy link

teamayu commented Jul 23, 2021

@anandinasu
Copy link

anandinasu commented Sep 13, 2021

A simple workaround could be using this Auto Hot Key script

!F4:: ;; 
	; https://www.autohotkey.com/boards/viewtopic.php?t=53800#:~:text=by%20registering%20to%20this%20forum%20and%20using%20this%20code%3A

	;https://autohotkey.com/board/topic/60398-ifwinactive-with-multiple-programs-possible/#:~:text=Joined%3A%2028%20Nov%202009-,I%20would%20use%20%20GroupAdd,GroupAdd,-%2C%20WorkIn%20%2C%20ahk_class%20Progman
	GroupAdd, MinimizeGroup , ahk_exe code.exe
	GroupAdd, StayGroup , ahk_exe notepad.exe	

	ifWinActive, ahk_group MinimizeGroup
	{
		; https://www.autohotkey.com/boards/viewtopic.php?t=48944#:~:text=51-,%5E!z%3A%3A%20%3B%20ctrl%2Balt%2Bz,-WinMinimize
		; https://www.autohotkey.com/boards/viewtopic.php?t=6898#:~:text=58-,code%3A%20select%20all%20-%20toggle%20line%20numbers,-WinMinimize
		WinMinimize, A
	}
	else ifWinActive, ahk_group StayGroup
	{
		Send {Alt}{Tab}

	}
	else
	{ 
		; https://www.autohotkey.com/boards/viewtopic.php?t=43119
		WinClose, A
	}	
return

@tifish
Copy link

tifish commented May 27, 2022

Thanks to @anandinasu, the script help me a lot.
I modified it a bit to solve 2 problems:

  1. WinClose may change default behavior of some apps.
  2. When I press Alt+F4, I want to close current document.

Here is the modified version:

#IfWinActive ahk_exe code.exe
    !F4::
        Send {F4 up}^{F4}
        WinMinimize, A
    return

@BettyJJ
Copy link

BettyJJ commented Feb 6, 2023

A simple workaround could be using this Auto Hot Key script

!F4:: ;; 
	; https://www.autohotkey.com/boards/viewtopic.php?t=53800#:~:text=by%20registering%20to%20this%20forum%20and%20using%20this%20code%3A

	;https://autohotkey.com/board/topic/60398-ifwinactive-with-multiple-programs-possible/#:~:text=Joined%3A%2028%20Nov%202009-,I%20would%20use%20%20GroupAdd,GroupAdd,-%2C%20WorkIn%20%2C%20ahk_class%20Progman
	GroupAdd, MinimizeGroup , ahk_exe code.exe
	GroupAdd, StayGroup , ahk_exe notepad.exe	

	ifWinActive, ahk_group MinimizeGroup
	{
		; https://www.autohotkey.com/boards/viewtopic.php?t=48944#:~:text=51-,%5E!z%3A%3A%20%3B%20ctrl%2Balt%2Bz,-WinMinimize
		; https://www.autohotkey.com/boards/viewtopic.php?t=6898#:~:text=58-,code%3A%20select%20all%20-%20toggle%20line%20numbers,-WinMinimize
		WinMinimize, A
	}
	else ifWinActive, ahk_group StayGroup
	{
		Send {Alt}{Tab}

	}
	else
	{ 
		; https://www.autohotkey.com/boards/viewtopic.php?t=43119
		WinClose, A
	}	
return

Does it work for you? It seems this script just minimize to taskbar, not minimize to tray. 🤔

@MMMMMoris
Copy link

VSCode can now minimize to tray with a hotlkey. I can assure it, for I just did it by accident. I press some specific keys, the keys of left hand area, perhaps with ctrl or shift. This was what it happened when I pressed the hotkey: VSCode window was closed as I thought so, while it didn't acctually. Since I thought it was closed, I tried to reopen it with right clicking in the folder and choosing "Open With Code" option.

However, nothing happened after I clicked on "Open With Code", even clicking for several times. I was wondering if someting was wrong with my PC. And I tried to open another folder with VSCode, Well, it worked this time, VSCode was opened in a smaller window just like this. I didn't realize it was because of the existence of a formerly opened VSCode window. I tried to open VSCode with right clicking in the original folder for times again, nothing happened still.

When I was just about to reboot my PC, I found the very vscode icon lying in my tray with other minimized programs. I clicked on the icon, the original window that I thought to be closed was restored. I was suprised, thinking that VSCode can be unexpectedly minimized to tray. Unfortunatelly, I didn't capture the screenshot before I clicked on the icon and it was gone with restoring of its windows. I tried to google for methods to minimize VSCode to tray, with any hotkey or command.

Well, it was not until then that I know this is still an unrealized issue on github.

Guys, you can try to reproduce this phenomenon with some key combinations in the left hand area and come back to comment on this thread when you are free. I did try for half an hour, sorry you tell you that I was unable to reproduce it either. All I can tell you guys is what I just experienced half an hour ago. By the way, I don't think it was caused by any extensions, for I didn't install any extensions else except C++ and python grammar extensions.

@RuriYoshinova
Copy link

RuriYoshinova commented Jan 14, 2024

Hey guys, since this issue hasn't been solved yet, This program here can minimize-to-tray any window, it's just a workaround but it's an easy setup.

https://github.com/benbuck/rbtray

It was already mentioned here but I'll just bump it incase anyone don't want to read everything.

@notfind4040
Copy link

Please do it!
Hope consider it again

@d-kleine
Copy link

d-kleine commented Apr 6, 2024

I am looking for this feature in VS Code too 😄
Why has this thread been closed as being "out of scope"? Some programs offer this feature, and especially when I want to run something for longer time in a terminal in VS Code, minimizing it to the tray would be really helpful (without needing extra programs for that).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code workbench-window Window management
Projects
None yet
Development

No branches or pull requests