Code-OSS doesn't open folder or files from terminal command 'code-oss .' - visual-studio-code

A few days ago I installed Kali Linux. I'm trying to use Code-OSS instead of VSCode, since newest version of Kali doesn't have the libraries needed to install the normal one.
If I try to open a folder in Code-OSS from terminal using code-oss . or code ., it just opens Code on a new 'untitled-1' document, or opens the folder I was before closing Code-OSS. It doesn't open the folder I was in the terminal.
In these cases I need to open the folder I want through File > Open folder > search for folder and then open it.
The same just occurred with git commit or git commit --amend; it opens a new document, not the one I want to open.
I spent sometime searching for a solution on documentation, stackoverflow, google but could not find anything.

I cannot find any way to resolve this problem on Code-oss. Apparently it happened just with me.
Surprisingly for me, I was able to install VSCode following this tutorial, and it apparently managed to ignore the lack of libraries of Kali Linux that I mentioned above.
I hope this solution prevent any person in the future to get stuck on this.

I had the same issue when I first installed Kali-linux on my VM. Pretty anoying.
Just intall vscode by running :
sudo apt update
sudo apt install code
It will unistall code-oss and install VsCode, and it works now.

Related

rust-analyzer failed to load workspace: "cargo" "--version" failed: program not found

I have Rust installed using WSL2 Ubuntu I have alredy ran basic commands like hello world in rust so cargo is working. I wanted to download the rust-analyzer in VSCODE but I keep getting that error message from the title: rust-analyzer failed to load workspace: "cargo" "--version" failed: program not found
I tried ensuring all paths are correct, all vesions of extension and vscode and rust are up to date. several uninstall re-installs and rustup updates. Toolchain is using stable version. I have reviewed a lot of the other post about this accross all platforms but it seems I can not find the fix. It would be very helpful to get some guidance. Thank you!st
The solution is to open folder as if in WSL.
To do that you need to install this VS code extension called Remote development
Than go to the green symbol in the bottom right corner and then select open WSL folder and open folder with your rust project or just open new WSL window
The last step is to go to extensions and then search for rust-analyzer and hit install
More info regarding the development on WSL can be found here
another good option is open your wsl, move to the project folder and type $ code . or $ code YOUR_PROJECT, then install rust-analyzer extension
Remove the rustc and cargo provide by system package manager (e.g. apt).
Install them from offical rustup script instead.
[note]
I just encounter the same problem when using flatpak version of Lapce.
rust-analyzer failed to load workspace: "cargo" "--version" failed: No such file or directory (os error 2)

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

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!

Recipe terminated with fatal error: spawn latexmk ENOENT

I have just installed debian 10 as well as vscode. I have been struggling with this for 3 days now.. I installed texlive from terminal with the following command:
sudo apt install texlive
I then installed the latex workshop extension in vscode and tried building a .tex file. The following error popped up:
Recipe terminated with fatal error: spawn latexmk ENOENT.
I then preceded to install latexmk from terminal with:
sudo apt install latexmk
The same error kept popping up after that. The output showed this.
[14:59:34] Recipe step env: {}
[14:59:34] cwd: /home/phoenix/Documents/stellies/year4/2021/s&s-414/pracs/prac-4/report
[14:59:34] LaTeX build process spawned. PID: undefined.
[14:59:35] LaTeX fatal error: spawn latexmk ENOENT, . PID: undefined.
[14:59:35] Does the executable exist? PATH: /app/bin:/usr/bin:/home/phoenix/.var/app/com.visualstudio.code-oss/data/node/bin:/home/phoenix/.var/app/com.visualstudio.code-oss/data/cargo/bin:/home/phoenix/.var/app/com.visualstudio.code-oss/data/python/bin
[14:59:35] The environment variable $SHELL: /bin/sh
I then proceded to review the texlive website. I noticed that i did not set the path variable to include the texlive binaries. The texlive website gives the following path to the binary files : PATH=/usr/local/texlive/2021/bin/x86_64-linux:$PATH
however /usr/local/texlive does not exist on my system for some reason. Where can i find the correct path to the texlive binaries on Debian 10?
I had the same problem. The root cause was: (1) software's bin folder missing from PATH; (2) bad file privileges. Consequently, VSC couldn't access latexmk, which explains the error messages.
In my case, the problem occurred on a mac, and specifically after I installed MacTex, which, in turn, installs Tex Live. I believe the same solution may apply to linux distros too.
Solution:
Claim file ownership (which was originally root) under folder /usr/local/texlive: sudo chown -R <username> /usr/local/texlive, where <username> is the OS-level user name. The fix will work for this specific user. If it is not enough, try instead setting group owner appropriately, and/or consider Step 3.
Add /usr/local/texlive/2021/bin/<software_dialect> to PATH. <software_dialect> depends on the installed software version: in my case it is universal-darwin; on linux it might be x86_64-linux.
If the problem persists, try to change file access permissions under /usr/local/texlive using chmod.
EDIT: As a final step, restart VSC for changes to take effect.
I recently encountered the same problem on MacOS Monterrey (M1 based). I used basictex (just for the context). As required by the installation instruction,
I added TeXLive to PATH,
installed latexmk package to the TeX distribution.
However, still got the same error as OP.
Afte reading the wiki again more carefully, what finally worked for me was as simple as restarting VS Code and MacOS. Everything works as expected after a reboot of the MAC.
I had this same problem on Mac recently, the fix that worked for me was to uninstall and reinstall the LaTeX Workshop extension.
I got the same issue , seems to be a misbehaving from Vscode on MacOS
check if the command is in the path on mac
-which command_you are running example which latexmk
If this output something that means you have your latex installed, otherwise go and installed it and make sure it is accessible via command line.
If latex is installed and you are getting that issue you can just restart your VSCode and everything will be okay.
Had a similar error and came across this post when looking for a solution.
I wanted to use texlive on Vscode with WSL2 on Windows 10. Installing texlive-full in wsl fixed this error for me.
On Mac, this is a way to fix the issue
Step1: reinstall mactex by downloading it from this link: http://www.tug.org/mactex/mactex-download.html
Step2: In your terminal do cd /usr/local, you should see texlive folder
Step3: In your terminal do sudo vim etc/paths to set the environment. Details are in this link: https://www.architectryan.com/2012/10/02/add-to-the-path-on-mac-os-x-mountain-lion/
Step4: In your terminal do /usr/local/texlive/2021/bin/x86_64-linux at the bottom. check the folder to see if the year is correct. Details in: http://www.tug.org/texlive/quickinstall.html.
Step5: Quit VC code completely, and reopen it.

Flutter and Dart -> add path on Ubuntu 20.04

I am trying to add flutter to the path but no solution is working for me right now. It was working before when I installed it from snap. Now I am cloning flutter repo into the opt folder and No matter what I try, flutter is not working. I am using ZSH terminal.
So far I have tried:
Adding export PATH=~/opt/flutter/bin:$PATH on last line of .zshrc and .bashrc file.
Running export PATH="$PATH:~/opt/flutter/bin" on the terminal.
And bunch of other tweaks on the keywords but none of the things seems to work.
Try this if you mean you have cloned flutter to /opt folder
export PATH="$PATH:/opt/flutter/bin"
Also if you doesn't mean that and you solely mean ~/opt folder then first verify your flutter installation by typing
~/opt/flutter/bin/flutter
in your terminal,
It should launch flutter it your terminal if not then either your installation is broken or you have to type
chmod +x -R ~/opt/flutter/bin
to make flutter executable if it's not.
PS: Also don't forget to restart your shell if you haven't cause you have to restart you shell after changing something in your .rc files.
I hope I have helped you if not please comment so that I can improve the answer.
This work on Ubuntu.
Add to file .profile the following line:
export PATH="$PATH:/home/your_user_name/opt/flutter/bin