Skip to content

Allow to minimize VS Code to tray #11723

Closed

Description

@MoshiMoshi0

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.

Activity

  1. added
    install-update
    and removed
    install-update
    on Sep 8, 2016
  2. changed the title [-]Feature: Add close to tray option[/-] [+]Allow to minimize VS Code to tray[/+] on Sep 9, 2016
  3. added
    feature-request
    on Sep 9, 2016
  4. PowerWeb5 commented on Jan 15, 2017

    @PowerWeb5

    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.

  5. CBuntrock commented on Jan 16, 2017

    @CBuntrock

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

  6. PowerWeb5 commented on Jan 23, 2017

    @PowerWeb5

    Benjamin Pasero (@bpasero) Johannes Rieken (@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.

  7. tivoa-gigatronik commented on Mar 22, 2017

    @tivoa-gigatronik

    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.

  8. m34nbunny commented on Sep 27, 2017

    @m34nbunny

    Can't wait for this feature

  9. 37 remaining items

  10. SekiBetu commented on Mar 30, 2021

    @SekiBetu

    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?

  11. altosaar commented on May 20, 2021

    @altosaar

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

  12. altosaar commented on May 20, 2021

    @altosaar

    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"
  13. anandinasu commented on Sep 13, 2021

    @anandinasu

    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
    
  14. tifish commented on May 27, 2022

    @tifish

    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
    
  15. BettyJJ commented on Feb 6, 2023

    @BettyJJ

    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. 🤔

  16. MMMMMoris commented on Aug 9, 2023

    @MMMMMoris

    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.

  17. ruri4 commented on Jan 14, 2024

    @ruri4

    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.

  18. chloe0xff commented on Apr 6, 2024

    @chloe0xff

    Please do it!
    Hope consider it again

  19. d-kleine commented on Apr 6, 2024

    @d-kleine

    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).

  20. Nick2bad4u commented on Dec 24, 2024

    @Nick2bad4u

    still not here?

  21. Milor123 commented on Apr 10, 2025

    @Milor123

    any solution for 2025?

  22. whyboris commented on Aug 25, 2026

    @whyboris

    Still desirable in 2026 😔

    Slow startup time can be 0ms instead, if close to tray setting is added 🙇

  23. whyboris commented on Aug 25, 2026

    @whyboris

    As for feasibility: VS Code is Electron, no? It's fewer than 20 lines of code to configure and get an Electron application to hide to tray 🤷

    Adding this very-much-in-demand feature wouldn't take much effort. Please 🙇 PLEASE 🙇 add this feature ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    *out-of-scopefeature-requestworkbench-window

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions