When I modify files on local machine, vscode will shows changes with different colors, blue means this line was changed and green means its a new line, like this picture:
but when I modify files with Remote-SSH, it would not works, so how can I check my settings to make this works?
If the remote directory is symlinked sometimes does not work (see here and here). Changing the symlink with source directory resolves the problem and the gutters appear again.
A work-around is to install GitLens extension and enable Gutter Changes view. It is a functional replacement for built-in gutter indicators.
Related
I was trying to do some custom settings for the C++ and CMakeTools extensions. But now I want to reset/revert everything to defaults. How do I do that?
I tried uninstalling the extensions and re-installing, and they got re-installed with my custom settings wtf.
I see no reset buttons in the UI
I don't know where the per-extension settings are stored on my computer.
What am I not understanding? Why is this so unobvious?
As described in this feature request, you cannot do this directly. However, you can open your settings.json file and find the extension settings, then manually remove them.
Keep in mind, removing the extension won't remove its settings. So reinstalling the extension will not reset it at all, but keep your previous configuration.
There's a Settings tab (and apparently extension settings can be both in the User subtab and the Workspace subtab).
There's User, Workspace, and Default settings.json's which you can open from Ctrl+Shift+P, start typing "settings.j", and see the 3 suggestions (the user settings file is located at C:\Users\{USER_NAME}\AppData\Roaming\Code\User\settings.json (see docs for all OS paths).
Compiler settings are in c_cpp_properties.json, Compiling settings are in tasks.json, Debugging settings in launch.json. These are in your project folder under the .vscode folder, and you can search them in Ctrl+Shift+P (but don't write .json at the end or it won't show up).
Also check your system environment variables for "CXX" and "CC" env variables which can also overwrite the compiler (and the ui says nothing about this).
Apparently there's no way to reset all settings (the "permanence" is a giant source of ux confusion, a meme decision in my professional opinion).
Luckily you can just go to Settings and write #modified to see all the settings you've changed!
Ok, so to finally answer: HOW do you RESET an individual setting?
This cannot be "googled": There's an invisible hover hitbox on the left side leading to a hidden settings gear (red dotted line):
This ux is the source of the problem.
In VSCode, "removing"/"deleting" a setting means "resetting" it. Your settings are just "overwritings". So all auto-defaults should pop back into the UI after a VSCode restart, I hope. (also the aforementioned .vscode settings / env vars / build folder might still override)
Is there a way to only color files that have had their git statuses changed and not all parent folders, unless the directory the modified file is in is folded (and color only that folder and not all parents)?
Currently if a file has changed with respect to version control, every folder in the path is also colored, leading to too much color info for my liking:
I'd like everything except for the file someService.ts to be the same color as the models directory.
Also, if possible, all the info on the right (green dots and U) isn't really necessary anymore since the coloring conveys that information, so it's clutter for me. Would it be possible to remove that information and only display the number of errors/warnings in the file?
I have found no built in settings that allows you to set the colors of folders/files individually. It's either all or nothing. To turn the colors on and off, toggle the explorer.decorations.colors setting:
There is a settings to remove the green dots/letters. These are called "badges." To turn them off, toggle the explorer.decorations.badges setting:
This will however also remove the same badges that display the number of errors in a file, etc.
When you create a new file without an extension in VS Code you get four horizontal lines stacked on top of one another; the bottom and the third one up is shorter than the others.
What type of file is this?
And when I setup a react-app, the .gitignore has the four-line icon by it instead of the git logo. Does this mean my gitignore isn't working? and if so, what can I do about this?
If you mean this symbol:
The icons next to filenames indicate what sort of file VSCode thinks they are. JavaScript files show JS, JSX files show the React symbol, and so on.
The lines icon mentioned in your question looks to just be the default icon for any file extension VSCode doesn't recognize - it also occurs for text files (which is what the icon looks to represent) and files that end in the nonsense extension .foobar, for example.
It's only an icon - if you've set up your Git repository properly (or run something that sets one up for you), the icon that VSCode chooses will not affect your app.
I just install the latest version of the VS Code on my Win 10 x64, before that I install Python as well, but nothing else.
When I open the VS Code, it seems my Settings.json is empty (just my theme and zoom level are there).
I opened the Settings.json from settings with clicking on the icon that you can see in the bellow image (noted with a red circle in the top right side) or with searching the JSON keyword in the setting (result is the same)
But in this file I just have two lines of code which you can see in the below image:
But I think it has to bee a big file with lots of settings and so on, even I check this file in this path: %APPDATA%\Code\User\settings.json and it was empty and just have this two lines of code.
I install the python extension, Dracula theme and so on in my VS Code.
.
Can you help in these questions:
Do you know what is the problem?
How I can restore the default value of the setting? (in case they are missed)
I want to change the color of the comments in the python language because in this theme it is not easy for me to read them in files, I found I can change it from the Settings.json but mine is empty,
settings.json only contains those settings which override the default behaviors.
In order to restore the default settings (from .json) you have to delete the line. (You can also do it from the GUI)
I think the setting "workbench.colorCustomizations" is what you are searching for; try to Google it.
I'm using the default theme. The terminal's colors are impossible to read, make no sense, and are inconsistent. I've tried switching themes but they're terrible in all the themes.
Here's what it looks like in the default. Are you able to read my yellow input against the gray background? And why isn't there a black background everywhere?
I realize there are settings that can manually set the fore/background colors. But I'm thinking something is broken for me because of how screwy the terminal behaves.
For example, here's what I see when I first start the terminal, type a bunch of stuff, backspace to delete half of it, resize the terminal pane, then delete some more. Notice how some of the deleted spaces have yellow and some have gray. Also notice how the area where the CWD would be shown is all black.
Here are the contents of my settings.json file:
{
"window.zoomLevel": 0,
"git.enableSmartCommit": true,
"workbench.startupEditor": "newUntitledFile"
}
What needs fixing, and how?
Edit:
Just to satisfy your curiosity, I added this to my settings.json file:
"workbench.colorCustomizations": {
"terminal.foreground": "#ffffff",
"terminal.background": "#000000"
}
No joy:
There might be something wrong in your console settings, you might want to remove the content of HKCU\Console in your registry. Save it before, obviously, but there shouldn't be any side effect: it'll just be recreated with the default settings.
Okay, so here's a list of all possible settings that you could tweak in your terminal window colorscheme: (source)
"workbench.colorCustomizations": {
"terminal.background":"#1D2021",
"terminal.foreground":"#A89984",
"terminalCursor.background":"#A89984",
"terminalCursor.foreground":"#A89984",
"terminal.ansiBlack":"#1D2021",
"terminal.ansiBlue":"#0D6678",
"terminal.ansiBrightBlack":"#665C54",
"terminal.ansiBrightBlue":"#0D6678",
"terminal.ansiBrightCyan":"#8BA59B",
"terminal.ansiBrightGreen":"#95C085",
"terminal.ansiBrightMagenta":"#8F4673",
"terminal.ansiBrightRed":"#FB543F",
"terminal.ansiBrightWhite":"#FDF4C1",
"terminal.ansiBrightYellow":"#FAC03B",
"terminal.ansiCyan":"#8BA59B",
"terminal.ansiGreen":"#95C085",
"terminal.ansiMagenta":"#8F4673",
"terminal.ansiRed":"#FB543F",
"terminal.ansiWhite":"#A89984",
"terminal.ansiYellow":"#FAC03B"
}
Now for me, the colors of folder names was too bright over an even brighter background color that highlighted them and I couldn't read squat (that's because of my VSCode theme called NightOwl -- :P Sarah) so I thought (wrongly) to change terminal.background and terminal.foreground properties but that refer to the entire rendered window of the terminal.
Because these properties are actually named after Ansi Escape Codes, what I was actually looking for were these properties: terminal.ansiBlue for folder name text color and terminal.ansiGreen for folder name background highlight color.
As soon as I tweaked those, my terminal was good to go.
The way to do it is to just set all these settings and start removing or changing them to see which is which for your preference. K Thx Bye
Also beware that terminal.ansiGreen is used by git diff as a color to show additions.
On March 8th 2022 the default value for the integrated terminal "minimum contrast ratio" was updated from 1 (no effect) to 4.5 (minimal effect). Depending on your color settings and what is being displayed, this can cause your integrated terminal foreground colors to be wrong.
To disable this feature, override the default in your own settings.json file:
"terminal.integrated.minimumContrastRatio": 1
There are two solutions. Xavier's solution works, and mklement0's comment was also correct.
Solution #1
Do what Xavier said (and upvote his answer).
But, if you don't want to mess up registry settings (or if, like me, you have lots of registry settings nestled under the HKCU\Console root), then...
Solution #2
Get Windows 10 build number 18309 (or newer)
Join the Windows Insider Program
Make sure you're on a "ring" that includes a new-enough build. For me at this moment that meant joining the "fast" ring
Wait forever for updates to finish installing
Add "terminal.integrated.windowsEnableConpty": true to your settings.json
Restart terminals
Upvote mklement0's comment
...
Profit!
I am new to VS Code (and I'm trying to better my PowerShell skills) and have/had this same problem. Deleting all the Reg keys cited above related to colors seemed to fix it, but I believe the root problem is that VS Code seems to be trying to honor the color scheme set up outside the VS Code Terminal itself, from the shell. Really annoying and I'm not sure how to separate the two.
I had setup a blue background/yellow font scheme in PS prior to installing VS Code. That was the same color scheme the terminal in VS Code was displaying directly around the text.