How do I stop VSCode from starting up maximized? - visual-studio-code

On just one of my two Linux systems, Visual Studio Code always starts in a maximized window. It doesn't do it on the other one. Both systems are Pop!_OS 20.10, upgraded along the way from each Pop!_OS release from 18.04. VSCode is 1.51.1, and has been doing this since I started using it about 1.36 or so. I'm using the default Gnome Shell on each system. On the system where it doesn't start maximized, it remembers its previous size and placement. If I double-click on the window header on the failing system, it returns to its prior placement and size, but if I close it in that state, when I reopen it it's maximized again.
I'm guessing there's a settings file or something that's set to force it to be maximized, but I didn't explicitly set anything like that, and I wasn't able to find anything when searching that would have that effect.
The failing system is one I built up with a Ryzen 9 3900X, 64 GB RAM, 1 TB M.2 PCIe 4 SSD, and an RTX 2060. The working system is a System76 Oryx Pro v4 with 64 GB and an 8th gen Core i7. VSCode has done this on the failing system ever since I was running it on a dual-hex Mac Pro, and on a 1080p monitor; I'm now using a 3840x2160 monitor - but that's what the Oryx Pro has on it, too.
What am I missing?

Following works on ubuntu 20.10. Position VSCode window where you would like it to open next time. Then, hit <Ctrl><CloseXButton>
This will close your current session. Next time you open this project via code ., you should get VSCode to open in that last state you <Ctrl>-closed it in.
I don't know where this status is stored in the settings file.

Related

why Visual Studio Code is get slower and freezes and suddenly gives not responsing message

I have a problem with VS Code: whenever I code, debug, or run the code on my physical device using Flutter, it gets very slow, freezes, and shows "Windows is not responding: Reopen!" I disabled all the extensions, but nothing worked. I even tried some commands like deleting the user directory and disabling the extensions, but I still faced the same issue. I deleted the cache in AppData/Roaming/code, but still no luck. I also deleted the code file, and the same issue still exists! I even did this: -Open the Command Palette (Ctrl+Shift+P). Run the Preferences: Configure Runtime Arguments -Add "disable-hardware-acceleration": true. -Restart VS Code. I have looked it up all over the internet, and nothing worked! Please help me! these are the extntion:
Device Specifications:
Device name BadriyaHaddad
Processor Intel(R) Core(TM) i5-3230M CPU # 2.60GHz 2.60 GHz
Installed RAM 12.0 GB (11.9 GB usable)
Device ID 7B1CE693-8DEC-426E-B6FB-54CC3FADE82A
Product ID 00331-10000-00001-AA635
System type 64-bit operating system, x64-based processor
Pen and touch No pen or touch input is available for this display
Windows Specifications:
Edition Windows 10 Pro
Version 22H2
Installed on ‎11/‎27/‎2022
OS build 19045.2364
Experience Windows Feature Experience Pack 120.2212.4190.0
enter image description here

VS Code is slow and freezing and then not responding [duplicate]

I have a problem with VS Code: whenever I code, debug, or run the code on my physical device using Flutter, it gets very slow, freezes, and shows "Windows is not responding: Reopen!" I disabled all the extensions, but nothing worked. I even tried some commands like deleting the user directory and disabling the extensions, but I still faced the same issue. I deleted the cache in AppData/Roaming/code, but still no luck. I also deleted the code file, and the same issue still exists! I even did this: -Open the Command Palette (Ctrl+Shift+P). Run the Preferences: Configure Runtime Arguments -Add "disable-hardware-acceleration": true. -Restart VS Code. I have looked it up all over the internet, and nothing worked! Please help me! these are the extntion:
Device Specifications:
Device name BadriyaHaddad
Processor Intel(R) Core(TM) i5-3230M CPU # 2.60GHz 2.60 GHz
Installed RAM 12.0 GB (11.9 GB usable)
Device ID 7B1CE693-8DEC-426E-B6FB-54CC3FADE82A
Product ID 00331-10000-00001-AA635
System type 64-bit operating system, x64-based processor
Pen and touch No pen or touch input is available for this display
Windows Specifications:
Edition Windows 10 Pro
Version 22H2
Installed on ‎11/‎27/‎2022
OS build 19045.2364
Experience Windows Feature Experience Pack 120.2212.4190.0
enter image description here

Why does Eclipse freeze for nearly every action?

Problem
Every time I use Eclipse on my personal laptop, it constantly freezes (e.i. the process stops responding) for seemingly everything I do except for regular typing (without content assist). Any other action will cause it to freeze 7 out of 10 times, for roughly 10-20 seconds, mainly:
Any automatic proposal menus (e.g. when you type . after a variable name and a list of options appears) or manual ones (e.i. Ctrl + Space).
Any auto-import (Ctrl + Shift + O) or auto-format (Ctrl + Shift + Space)
Any context menu
Viewing JavaDoc comments
Any interaction with the project/package explorer
Any load/save operations
Any run/debug operation
Exiting the program
Every once in a while, it will not freeze, but the content assist will take a very long time to give me proposals, or the JavaDoc info will take a long time to load.
I use Eclipse on my work laptop and I do not experience any of these issues.
Things I've tried
Increase the RAM
Monitor the heap (I did not observe any correlation between heap size and freezing)
Move my workspace from my external drive to my internal drive
Run eclipse -clean
Perform a clean installation:
Delete the installation directory (%userprofile%\eclipse\java-XXXX-XX\eclipse)
Delete the .p2 directory (%userprofile%\.p2)
Download and install the latest version of Eclipse
Create a new workspace (and test it by creating a new project instead of importing old ones)
Disable the "Override high DPI scaling behavior" option (see this)
Environment
I am sure that someone is going to ask if I have a computer capable of running Eclipse. These are my laptop's specifications:
GPU : NVIDIA GeForce RTX 3070 Laptop GPU
CPU : AMD Ryzen 9 5900HS with Radeon Graphics
Memory: 16 GB RAM (15.41 GB RAM usable)
It's a ROG Zephyrus G15 (Model: GA503QR_GA503QR). I previously owned a G14 and had the same issue.
Observations
I notice that often when this happens explorer.exe also stops responding. I can still use other applications like Google Chrome, but I have to wait for Eclipse to respond before Windows Explorer starts responding.
Question
What are the potential causes of the described behaviors, and remedies thereof?

Eclipse editor unable to display file contents

I've run into a very strange issue with my Eclipse installation. In fact, I've tried installing three different instances and the problem persists, so something must be seriously messed up with my machine.
The best way I can describe it is this. When I open a file in Eclipse (regardless of file type - I've tried .java, .js, .xml, etc.), the file appears to open and the filename is shown at the top of the editor panel as normal. But the file itself appears to be empty or blank.
Upon clicking in the editor window to attempt typing, it gets even more strange. The normal blinking black cursor is the full height of the window. Typing doesn't actually do anything. No text shows up, but it appears as if the file is being edited because the (*) symbol displays next to the filename as if it hasn't been saved since it was last changed.
I would provide a screenshot, but it's simply a blank window with a giant typing cursor. My current environment information is below, but like I said, I've had the issue with three different versions of Eclipse. Also, it's peculiar that this started happening seemingly randomly. Everything was fine but my machine was overdue for a restart. After restarting I opened up my workspace and this just sort of happened. I haven't been able to find any suggestions that aren't "reinstall" or "run Eclipse with the -clean tag" (neither of which worked).
Windows 7 Enterprise
Service Pack 1
Processor: Intel(R) Xeon(R) CPU E5-2695 v2 # 2.40GHz
RAM: 8GB
System type: 64-bit
Eclipse Mars 4.5.2

How can I disable GPU rendering in Visual Studio Code

I'm with bad rendering issues... Seems that the Visual Studio Code window do not clean a screen area before redraw it. The same thing happens here with chrome browser, but in chrome I can start it with " --disable-gpu-rendering " and it goes well.
How can I disable GPU rendering in Visual Studio Code ?
I'm thinking it's a hardware specific problem, and I'm looking for a other way to solve it too.
May be useful know my hardware:
Machine: Notebook dell vostro 3500 (intel chipset)
CPU: Intel i5
RAM: 8G
linux kernel: 4.0
video graphics: intel i915 (latest)
X -version: X.Org X Server 1.14.0
Note that VSCode 1.40 (Oct. 2019) proposes an alternative to the parameter/flag --disable-gpu:
Disable GPU acceleration
We have heard issue reports from users that seem related to how the GPU is used to render VS Code's UI.
These users have a much better experience when running VS Code with the additional --disable-gpu command-line argument.
Running with this argument will disable the GPU hardware acceleration and fall back to a software renderer.
To make life easier, you can add this flag as a setting so that it does not have to be passed on the command line each time.
To add this flag:
Open the Command Palette (Ctrl+Shift+P).
Run the Preferences: Configure Runtime Arguments command.
This command will open a argv.json file to configure runtime arguments.
You might see some default arguments there already.
Add
"disable-hardware-acceleration": true
Restart VS Code.
Note: Do not use this setting unless you are seeing issues!
Note that Gilbert points out in the comments to "How To Fix Screen Flickering Issue On Mac, MacBook, And iMac" from Preeti Seth.
Gilbert adds:
I fixed the problem by disabling automatic graphics switching on my macbook pro.
The setting is located in system preferences -> battery.
It worked!
Under Windows, I can confirm that launching VSCode with --disable-gpu does not create a GPU process:
C:\Users\alex\AppData\Local\Code\app-0.1.0>Code.exe --disable-gpu
Perhaps the same flag works on Linux too?
On Ubuntu, the file to edit is /usr/share/applications/code.desktop.
Change:
Exec=/usr/share/code/code --unity-launch %F
to:
Exec=/usr/share/code/code --disable-gpu --unity-launch %F
For Windows users
Visual studio code is based on chrome, to make it work you'll have to disable hardware acceleration.
Add --disable-gpu --disable-gpu-compositing to the vs code shortcut on your desktop.
Example:
"C:\Program Files (x86)\Microsoft VS Code\Code.exe" --disable-gpu --disable-gpu-compositing
Inside settings.json you can write this:-
"terminal.integrated.gpuAcceleration": "off"
on Mac running in virtualbox you can edit the file in ~/.vscode/argv.json
Add
"disable-hardware-acceleration": true
macOS users can try the following commands in the terminal :
Goto Applications folder :
cd Applications
Open VS Code with GPU Disabled :
Visual\ Studio\ Code.app/Contents/MacOS/Electron --disable-gpu
Note : You might need to supply sudo with second command.
On Linux Mint I had to right click the lower left mint button, then choose configure, then press the menu button. Then press the "Open Menu Editor" button and find Visual Studio Code in the programming group. Click properties and find the command field. There you can set the --disable-gpu option.
If environment variables are mapped correctly, you can simply use cmd.exe to start an instance of code with --disable-gpu . See the screenshot. enter image description here
Sometimes the problem is caused by automatic graphic switching as the computer tries to save energy.
In my case my macbook pro has battery problems so they manifested as the screen flickering whenever I ran an intensive application like vscode.
To disable automatic graphic switching, go to system preferences -> battery and untick Automatic graphic switching.
Refer to this guide: https://wethegeek.com/how-to-fix-screen-flickering-issue-on-mac-macbook-and-imac/