Last updated: Apr 6, 2024
Reading time·4 min
There are multiple ways to restart your VS Code Window.
One way is using the Command Palette:
Ctrl
+ Shift
+ P
on Windows and LinuxCommand
+ Shift
+ P
on macOSF1
to open the Command Palette.Here is a quick GIF that demonstrates the process.
You can also open the Command Palette by:
Alt
to show the top menu bar on Windows and Linux.Once you open the command palette, type Reload Window and select Developer: Reload Window.
The name of the action is called "workbench.action.reloadWindow".
To set a keyboard shortcut for the action:
Ctrl
+ Shift
+ P
on Windows and Linux.Command
+ Shift
+ P
on macOS.F1
to open the Command Palette.keybindings.json
file.[ { "key": "ctrl+f5", "command": "workbench.action.reloadWindow", "when": "editorTextFocus" } ]
You can also set the keybinding to "cmd+f5" if you are on macOS.
Now you can reload your VS Code window by pressing Ctrl
+ f5
(or cmd
+
f5
if on macOS).
You can also restart your VS Code window by using an extension:
Ctrl
+ Shift
+ X
on Windows or Linux.Command
+ Shift
+ X
on macOS.Now you will get a Reload button in the bottom status bar.
To restart your TypeScript server:
Open a file that has a .js
, .ts
or .tsx
extension.
Press:
Ctrl
+ Shift
+ P
on Windows and Linux.Command
+ Shift
+ P
on macOS.F1
to open the Command Palette.Note that you have to open a .ts
or .tsx
file for the option to show.
Make sure you haven't opened a Git diff instead of a TypeScript file.
If you have issues with your TypeScript server in VS Code, make sure you haven't disabled the TypeScript and JavaScript Language Features built-in extension by mistake.
Ctrl
+ Shift
+ X
on Windows or Linux.Command
+ Shift
+ X
on macOS.The TypeScript and JavaScript Language Features built-in extension must be enabled for your TypeScript server to work as expected.
The same approach can be used to restart a language server.
However, one thing you should note is that you need to open a file that is written in the language for the option to show.
For example, if you need to restart the Python server, you have to open a file
with a .py
extension.
Let's look at an example of restarting the Python language server in VS Code.
Open a file that has a .py
extension.
Press:
Ctrl
+ Shift
+ P
on Windows and Linux.Command
+ Shift
+ P
on macOS.F1
to open the Command Palette.When you have issues with a language server in VS Code, always check that you haven't disabled the built-in extensions for the language by mistake.
Ctrl
+ Shift
+ X
on Windows or LinuxCommand
+ Shift
+ X
on macOSThe built-in extension must be enabled for your language server to work as expected.
You can open the command palette and type Restart to view all the servers that you are able to restart directly in VS Code.
Ctrl
+ Shift
+ P
on Windows and Linux.Command
+ Shift
+ P
on macOS.I've also written an article on how to clear the Cache in VS Code.
You can learn more about the related topics by checking out the following tutorials: