How to remove rare whitespaces in the VS Code background [duplicate] - visual-studio

In the VS Code editor window, there are squares of another color that bother me when coding.
Has anyone had or has the same problem?

I started experiencing this issue in my MacBook Pro M1 after the June 2022 autoupdate.
Setting "disable-color-correct-rendering": false in ~/.vscode/argv.json worked for me.
I hope this is fixed in the next release. It seems to be an old issue based on what I found when searching for a solution.

If you are on a mac, see Different colored area on macOS - although there is a linux report there too. Same dark grey patches of color. There are a couple of suggested fixes mentioned.
The most reliable appears to be changing this setting:
"disable-hardware-acceleration": true
Open command palette and search for "Configure Runtime Arguments"
Set "disable-hardware-acceleration": true
Restart
from https://github.com/microsoft/vscode/issues/156405#issuecomment-1196503399
or starting vscode from a terminal with code --disable-gpu.
Also
What did work is removing "disable-color-correct-rendering": true from
~/.vscode/argv.json file and restarting vscode. Now the different
coloured patch on the side and bottom is gone.
Or
This happens to me with an intel mac as well. It was fixed by setting
"disable-hardware-acceleration": true in the .vscode/argv.json file.
More from the issue:
Had the same problem on my M1 macbook air, I had to open the argv.json
file (you can use Shift + CMD + P and type Configure Runtime Arguments
to open it) and set this line to false :
"disable-color-correct-rendering": false (it was on true, maybe by
default).
After that, just close your VS Code instance with CMD + Q and restart
it.
And here are download links (for macOS) for the previous vscode version v1.68 in case you want to rollback:
https://az764295.vo.msecnd.net/stable/4af164ea3a06f701fe3e89a2bcbb421d2026b68f//VSCode-darwin-universal.zip
https://az764295.vo.msecnd.net/stable/4af164ea3a06f701fe3e89a2bcbb421d2026b68f/VSCode-darwin.zip
https://az764295.vo.msecnd.net/stable/4af164ea3a06f701fe3e89a2bcbb421d2026b68f/VSCode-darwin-arm64.zip
Thanks for the information to those posting in the issue comments.

if you are facing this on mac you have to follow following steps
open terminal and type cd ~/.vscode
then open 'argv.json' file using vim argv.json
just uncomment the line // "disable-hardware-acceleration": true to "disable-hardware-acceleration": true
quit vim Esc then shift+: then wq then press enter, restart vs code your vs code will work normal again.

Related

Command Prompt Changing Colors after Compile

Whenever I run a compiler on a bash cmd and I get an error, the command prompt changes back to 'default' like colors. It stays like this till I change it manually again.
I have tried changing "right click->properties->color" and "right click->defaults->color" and I have went where the cmd is in the file system and change the color through properties. Same problem occurs.
I am very unsure where else I could change the color to fix this problem.
System = Razerblade Steath 2017
OS = Updated Windows 10
Compilers Using = g++ and gcc (same problem on both)
Picture of how and when it occurs. The code I am running is just one line in the main function purposely giving an error.
You can use -fno-diagnostics-color on your command line to disable this. gcc tries to determine if your window supports color and it will use it to try to make the error messages easier to read. Apparently, it's not restoring the original colors correctly.
Windows command prompts stopped supporting color long ago, but that feature has recently be re-enabled in one of the Windows 10 releases.

IntelliJ 14 keyboard shortcuts are QWERTY though keyboard is DVORAK

I'm
running IntelliJ 14
using Mac OS X layout
running on OS X (Yosemite)
IntelliJ is using DVORAK in general but not for keyboard shortcuts.
keyboard shortcuts are in QWERTY. As if they were scancode based instead of the key value after mapping.
Ideas?
edit 1
#gabriel hard to tell but here are some examples...
note: m, a and 0-9 are same on DVORAK and QWERTY
cmd+/ 'comment line' flashes code menu and sometimes moves to a brace (/ == {)
cmd+b works, goes to definition (b == n)
cmd+opt+l 'reformat' flashes code menu (l == p)
It turns out this is a problem in Java that has existed for some years, and is still present in Java 9. See the bug report here: https://bugs.openjdk.java.net/browse/JDK-8022079
JetBrains has been aware of the problem for some years, but is waiting for Oracle to fix it. See these JetBrains bug reports: https://youtrack.jetbrains.com/issue/IDEABKL-6493 and https://youtrack.jetbrains.com/issue/IDEA-63779
In those reports you'll find a work-around using a free tool called Karabiner. I have just verified that it works for IntelliJ. It will probably also work for other Java-based tools.
For OSX earlier than Sierra The work-around is:
Download and install Karabiner from https://pqrs.org/osx/karabiner/
In the OSX System Preferences, set your keyboard to the default "U.S. International" PC. If you don't often type diacritics and other international characters, it's easier to just set the keyboard to "U.S" instead.
In the Karabiner settings, type "dvorak" in the search box, then scroll down to the section For U.S. Input Source and check Use Dvorak Keyboard Layout (QWERTY to Dvorak)
From macOS Sierra onwards, as reported by user MithrilTuxedo in the comments, the procedure is different. You have to use Karabiner Elements (the new Karabiner core) with a configuration file. I have outlined the procedure at https://cpbotha.net/2016/12/16/dvorak-remapping-with-karabiner-elements-on-macos-sierra-works/ and summarise it here briefly:
Download and install Karabiner Elements.
Copy qwerty_to_dvorak.json from the examples and install it as the new karabiner.json configuration file.
If Karabiner Elements is running, it'll pick up the new file.
This bug will affect most Java-based tools such as those by JetBrains (IntelliJ, PyCharm, WebStorm, AppCode) and probably also Netbeans. The work-around summarised above should alleviate the problem in all cases.
I've had a similar problem using key combinations like ctrl+n in intellij 16 on linux (red hat). I use Colemak keyboard. I had two input sources setup in my operating system, system preferences .
English(US)
English(Colemak)
When I changed the order of the Input Sources, and put Colemak first, the problem seemed to go away.
System Tools > Settings > Keyboard > Input Sources
JetBrains are waiting for the bug to be fixed upstream in JDK, which of course will never happen. The other answer here is informative, but will only work on Mac OS, so if you're on linux or windows you're out of luck there.
I wrote a script to work around the issue, which you can find here. If you normally use GNOME keymap in pycharm on linux, then you're in luck - you can simply import my dvorak_settings.jar file and get back to coding.
Otherwise you can use the script to generate your own bugfixed keymap, read on...
The original keymap files are located in <pycharm>/lib/resources.jar/idea/Keymap_*.xml.
Example usage:
./to_dvorak Keymap_Emacs.xml -o Keymap_Emacs_Dvorak.xml
Have a browse over the generated file and if it looks sane, pack it up into the .jar file (see my dvorak_settings.jar example for the required structure) and import this in your IDE.
This problem is (finally!) fixed in IntelliJ IDEA 2017.1. See JetBrains issue JRE-172, “Wrong keys are picked up on dvorak layout in Mac OSX 10.6.2”.
It also seems to be fixed in other JetBrains tools. I tested that it's fixed in PyCharm 2017.1, CLion 2017.1, and AppCode 2017.1.

Sublime toggle comment is grayed out

For sublime text 3059:
- 'edit -> Comment -> toggle comment' is grayed out and I cannot comment out code.
Note, this is not the same issue as in:
Keyboard shortcut to comment lines in Sublime Text 3
I have observed that when I enable logging:
sublime.log_commands(True)
ctrl+/ sends the correct command:
command: toggle_comment {"block": false}
But nothing happens.
This is something that only started happening today (I updated my system yesterday).
OS:
- Linux Fedora 21
- tried with standard us keyboard layout, I do not think it is due to keyboard layout as command is triggered.
Note:
- I'm now observing that a lot of other stuff doesn't work either. E.g ctrl+bs doesn't erase whole words anymore. But this sort of thing works well in other apps like eclipse...
I updated to latest 3065 but that did not fix.
It looks like my configuration must have broken something.
i.e:
I ran it as 'sudo subl' and I had restored the functionality.
I then moved the config file
mv ~/.conf/sublime-text-3 ~/.conf/sublime-text-3_OLD
and then my functionality was restored again under regular user.
I think I will just re-configure it again.

How to close layout SRC windows in gdb?

When debugging with GDB, i usually using layout src to check my code. But when i open it, i don't know how to close it. It seems that there are some other layout, and when open a new layout, it will split the window, but i still can not found a command to merge the splitted windows.
You can always leave or enter TUI at any time durring debug session. For example you can do it with ctrl+x a key binding. 25.2 TUI Key Bindings.
vi Readline input bug
In GDB 7.7, Ctrl-x + a does not work if you have in your ~/.inputrc:
set editing-mode vi
set keymap vi
If I remove those lines it works.
This seems to be mentioned at in the following bug report: https://sourceware.org/bugzilla/show_bug.cgi?id=15163
I have requested a workaround at https://sourceware.org/ml/gdb/2015-06/msg00009.html and Andrew Burgess replied that he had just submitted a well received patch to add:
tui enable
tui disable
so in future versions we should have commands as an alternative to the shortcuts.
I have later tested this on GDB 8.1 in Ubuntu 18.04 and it worked perfectly.
But then I saw the light and moved from TUI to GDB Dashboard: https://github.com/cyrus-and/gdb-dashboard which is simply more powerful and less buggy.
See also: http://superuser.com/questions/180512/how-to-turn-off-gdb-tui

Keyboard shortcut to quit kernel in Mathematica 5 and 7?

Here is an explanation how to define a custom keyboard shortcut for quitting the kernel of the selected notebook by modifying the file KeyEventTranslations.tr. This file is located by default (under Windows) for Mathematica 5.2 in the folder
C:\Program Files\Wolfram Research\Mathematica\5.2\SystemFiles\FrontEnd\TextResources\Windows
and for Mathematica 7.0.1 in the folder
C:\Program Files\Wolfram Research\Mathematica\7.0\SystemFiles\FrontEnd\TextResources\Windows
In this file after EventTranslations[{ I have added a line:
Item[KeyEvent["q", Modifiers -> {Control}],FrontEndExecute[FrontEndToken[SelectedNotebook[],"EvaluatorQuit",Automatic]]]
But unfortunately after restarting Mathematica the shortcut Control+q does not work on both versions.
Moreover, in Mathematica 7.0.1 executing the command
FrontEndExecute[FrontEndToken[SelectedNotebook[], "EvaluatorQuit", Automatic]]
and pressing "Quit" leads to an application error and closing FrontEnd with loosing all unsaved changes (I am using Windows 2000).
What am I doing wrong?
EDIT: The problem was in missing comma after added Item[...] (thanks to belisarius). Here is the right line to add to KeyEventTranslations.tr:
Item[KeyEvent["q", Modifiers -> {Control}],FrontEndExecute[FrontEndToken[SelectedNotebook[],"EvaluatorQuit",Automatic]]],
Now shortcut Control+q works nice both in Mathematica 5.2 and 7.0.1.
But the above bug with "application error" still appears (not when using the shortcut but only when evaluating FrontEndExecute[FrontEndToken[SelectedNotebook[], "EvaluatorQuit", Automatic]] in notebook).
This answer and the associated comments may help you.
HTH!
BTW ... I did the same in v7 and it worked. On what version are you having trouble?
Just a note: Be very careful with the syntax Verify that every Item[Keyevent ends with a comma, except the last one.

Resources