Terminal started behaving badly when Zshell theme is present - visual-studio-code

Originally from here.
Versions:
VSCode Version: 1.46.1
OS Version: Windows_NT x64 10.0.20161
Steps to Reproduce:
Install debian-dev-boilerplate inside WSL.
Setup powerlevel 10k.
Clone a git repo and enter its folder.
git clone git#github.com:DanielAtKrypton/debian-dev-boilerplate.git
cd debian-dev-boilerplate
You should now see something like:
Open vscode from zshell. By typing at the zshell prompt:
code .
At this point the bug is revealed when the terminal is opened for the first time inside vscode. At first glance, the terminal renders correctly the powerlevel10k theme. After half a second, the theme is deactivated as can be seen in the next picture.
Does this issue occur when all extensions are disabled?:
Yes. The first time vscode is launched, it installs a vanilla (with no extensions) vscode-server to the linux distro. And still the bug happens.
It is interesting to note that in prior vscode versions this functionality was working alright. For any reason I don't know this issue started to happen in the last couple weeks.
Additional Info:
Here is the log file when running the commands:
code . --log trace
exthost.log

Most likely Powerlevel10k has been installed and/or loaded from ~/.zshrc incorrectly. The screenshot of VS Code shows robbyrussell theme, so I surmise that you are using Oh My Zsh. To install Powerlevel10k on top of Oh My Zsh you need to follow these instructions:
Run: git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
Set ZSH_THEME="powerlevel10k/powerlevel10k" in ~/.zshrc.
Try running grep -E 'ZSH_THEME|/powerlevel10k' ~/.zshrc. The output must be exactly like below.
ZSH_THEME="powerlevel10k/powerlevel10k"
If it's not, you need to fix ~/.zshrc.

Related

Histfile in integrated terminal not the same as normal terminal

I just lost my terminal history in VS Code. I noticed it when trying to do a reverse search in the Integrated Terminal (CTRL+R).
To debug, I ran this command:
echo $HISTFILE
This gives me:
/var/folders/ky/ltbvkg9s1239m5c9bccj5xtc0000gn/T/johndoe-code-zsh/.zsh_history
I would expect the normal path of my ZSH history is shown instead, like I get in iTerm2 when running the same command.
/Users/johndoe/.zsh_history
I believe this is a bug with VSCode's ZSH shell integration, that has already been resolved on the Insiders version.
Here is the offending line (note the HISTFILE without $):
I've seen it merged into the release/1.74 branch so hopefully, a v1.74.1 is not too far away. In the meanwhile, you can switch to Insiders (side-by-side installation) or turn off shell integration as suggested in the other answer.
Try turning off the shell integration that's enabled by default ("terminal.integrated.shellIntegration.enabled") and then restart the terminal.
https://i.stack.imgur.com/1Ger0.png
I fixed the problem by just adding this two lines at the bottom of my ~/.zshrc file.
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

How to uninstall VS code completely from manjaro linux, when terminal doesn't see it at all?

I am very new here, and also in programming.
I have found out that I have VS Code two times installed with different ways. When I started it from the KDE it ran well, but when I have started it from the current directory with "code ." it was an oss version without some extension and accounts.
Now I want to uninstall completely both of them. One version I could from terminal with yay --remove code. So the terminal can't see any versoion of vs code any more. But in the application launcher is vs code still there, I can run it and use completely. But I have no idea how to uninstall it.
I have already tried this: https://code.visualstudio.com/docs/setup/uninstall
you can uninstall from manjaro linux by visiting the add software>installed>code and clicking the trashcan near the name of the software. this will queue the action of deletion. Now just click apply on the bottom right of the screen and confirm all the things it will ask you. then it will uninstall code.
So I also had this problem, I found this command for uninstall vs code,
sudo pacman -R visual-studio-code-bin

VSCodium terminal error message => error layer=debugger can't find build-id note on binary?

I have VSCodium v1.64.2 and have this error message in my integrated terminal window upon "Run/Start Debugging" command:
2022-02-14T17:14:16-06:00 error layer=debugger can't find build-id note on binary
This error message appears on all my programs inside the terminal window. I'm learning Golang (GO) and am new to the VSCodium (VSCode community) editor. My program runs fine with no errors in my Ubuntu terminal window as well as the integrated terminal in VSCodium.
Is there something I can do to correct the error? It's not interfering with my work, but I was curious. Thanks.
According to the issue of go-delve / delve (
#latestas delve#1.8.2of 2022/02/13), this problem is not addressed, so
install delve manually instead of installing with VS Code extension etc
# Install at tree head:
$ go install github.com/go-delve/delve/cmd/dlv#master
or
$ git clone https://github.com/go-delve/delve
$ cd delve
$ go install github.com/go-delve/delve/cmd/dlv
According to https://github.com/go-delve/delve/pull/2893, which has been merged, it should now just be a warning. You likely pulled delve before the merge, though, so updating should fix this.

Visual Studio Code, code command does not start new file

I'm having an issue where if I do code <filename> where the file does not already exist, it does not create a new file.
Normally, vscode would (almost) create a new file, I could write some code, and then save it and it would appear in my file manager. But this just stopped working.
I had a look through all my extensions and uninstalled all the recent extensions. I've reinstalled vscode, still no luck.
I am using windows with wsl, this affects me when running vscode both in windows and in wsl.
Did some googling around, can't find anything useful. Any advice?
I figured out what caused this in case anyone else is having the same problem.
I installed Rust in windows and that seemed to have messed up the code command.
Sorry, can't remember which version it was, I just uninstalled it on windows and noticed that it fixed it.
(p.s: Rust is great, but I have it installed in WSL so don't need it in windows.)
If you are using npm on windows, you can install touch by running npm i -g touch and creating a folder in a specific location by navigating in the location and creating by mkdir <foldername> navigating inside it and using touch <filename>. From there you can simply launch VS Code by running code . in that folder namespace
If you are using WSL (Ubuntu), it comes preinstalled and you can run mkdir <foldername> && touch <filename> && code .
Not exactly what you are looking for but it can work!

VSCode on Linux Mint, integrated terminal not able to type anything

Hi I'm running Linux Mint 19 and I have just installed vscode using the snapd package manager. I've not used vscode on linux before as my usual editor is emacs. However, on a fresh new install of vscode, the integrated terminal does not work, there is just a non blinking cursor in the top left of the screen, but no prompt and no keyboard strokes are registering. This appears to be a common problem as there are a lot of posts about it if googled, but they are all for Windows versions and none of the solutions that I'm able to try do anything. I've tried to open a new terminal window, but the same thing happens I just get two terminal windows that I now cannot use. I've also tried checking the box that says Code-runner: Run In Terminal, but that does nothing either. What can I do to get this to work please, I looks to me like it is just not connected to either a bash or Zsh(which I normally use). Any help on this would be appreciated.
Instead of starting vscode with its default shell script (usually located on /usr/share/code/bin/code), the integrated terminal only works for me when starting it directly from the compiled binary (typically found on /usr/share/code/code, which is the same as the launcher created by the installer:
/usr/share/code/code --no-sandbox --unity-launch %F
While I searched for a solution in the past I've also noticed that lots of folks solved similar problems just by adding --disable-gpu flag, so might be worth checking out as well.