An error in the running of kotline in vscode - visual-studio-code

enter image description here
Can anyone say how to debug it

It seems like your kotlin directory is not added to your PATH variable thus the extension/terminal may not know what to execute, when trying to execute kotlinc.
The easiest way to resolve this issue is by adding the path to your kotlin directory (path/to/your/kotlin/bin) to your PATH variable
(see here), if you are on windows, or here, if you are on a linux system.
You can check, if it works by opening a command line window and trying to execute
kotlinc -version
However, as it seems like you are using Code-Runner extension in vscode, you can also update your settings.json file:
reference here.

Related

'very_good' is not recognized as an internal or external command, operable program or batch file

I tried to activate very_good_cli in flutter with this command:
dart pub global activate very_good_cli
and result was this:
...
...
...
Building package executables...
Built very_good_cli:very_good.
Installed executable very_good.
Warning: Pub installs executables into ~\AppData\Local\Pub\Cache\bin, which is not on your path.
You can fix that by adding that directory to your system's "Path" environment variable.
A web search for "configure windows path" will show you how.
Activated very_good_cli 0.7.2.
I also added ~\AppData\Local\Pub\Cache\bin to system Path, but this warning still persists and the error I get is:
'very_good' is not recognized as an internal or external command,
operable program or batch file
how can I solve this?
I just wanted to quickly put this together to make it obvious.
After running...
dart pub global activate very_good_cli
very_good.bat is added to your ~\AppData\Local\Pub\Cache\bin directory. So, you need your command-line shell to pick up on this change.
As mentioned above, if you run dart pub global activate very_good_cli a second time it will give you some good info in the form of a warning
Warning: Pub installs executables into `~\AppData\Local\Pub\Cache\bin`, which is not on your path.
You can fix that by adding that directory to your system's "Path" environment variable.
A web search for "configure windows path" will show you how.
Activated very_good_cli 0.7.2.
So, if the warning states the ~\AppData\Local\Pub\Cache\bin is not in your path, you need to add it there. Something like this. This essentially allows your command-shell to recognize 'very_good' as a command.
Link to video showing the process of adding to path
Once you are done with that, you need your command-line shell(s) to pick up the change. Easiest way to do that is to close them completely and reopen them. A tricky situation you might run into is if you are using a shell inside of another process. I use powershell terminal in vscode. So, I had to close vscode to actually refresh the terminal.
Restarting your computer is the nuclear button that should get the issue resolved if your Environment Variables are setup correctly or if there isn't some other wonky issue with the shell you are using. Using the built in windows cmd is a good test to see if it is just a problem with your preferred shell.
So after running dart pub global activate very_good_cli and adding path to ...\Pub\Cache\bin to the Path in system environment variables, restarting the windows solved the issue.

TCL/TK Wish can't find file in the same directory

I am trying to write a TCL/TK Script that accesses an INI File with the command [::ini::open DBW.ini]. I am using the inifile package for this and am trying to run on wish for the gui.
However, wish answers with "couldn't open "DBW.ini": no such file or directory". The odd thing about this is, that I can run this Code in the VSCode extension "Code Runner".
Code Runner is configured to access the same wish Compiler that I'm trying to run on my Windows System.
Why would I be able to run this Code through VSCode, but when im using the wish Compiler directly it throws an error message.
Thank you in advance
Most likely your Tcl code is not being executed in the same directory as where the DBW.ini file is. The Tcl command pwd will return the directory where the code is executing. If this is not where the ini file is, a simple fix would be to specify the whole path to the file when you try to open it, something like:
[::ini::open C:/some/where/DBW.ini]

How to NOT open Visual Studio Code from the command line

I see a lot of posts asking how to open VScode from the command line; I have the opposite problem!
When a type a file name from the CMD terminal, VSCode is launched with the file contents...why is that? I don't want that to happen! Any ideas on how to stop this from happening?
Maybe you should check your environment variables and find path for VScode, then delete it
Also maybe in your file properties VScode is set to default opening app , so it open files by default
For example (In my case Intellij IDEA) it looks something like this:
this mean you should go to properties and change "opens with" options
Thanks for the hints; they both helped on solving the problem.
The one particular file that I wanted to execute and NOT open with vscode is a bash script file with extension " .sh ".
I checked the file manager and it is not associated with vscode; instead, it says "SH Source File".
Then, I followed the link to thisdavej and after seeing the proposed registry entries, I went ahead and looked into my own registry...found that the .sh extension had an "OpenWithProgids/VSCode.sh", deleting that solved my problem. Now, when I type the name of the shell script, it actually executes.
Thanks.

Vscode : Open file locally using Remote-SSH through integrated terminal

I am using Remote-SSH plugin for remote development and would like to open a file in the existing editor using an integrated terminal (which is running a remote shell). A similar issue was posted on fit repository but it doesn't seem to work now.
https://github.com/microsoft/vscode-remote-release/issues/766
Local Machine
1.41.1
26076a4de974ead31f97692a0d32f90d735645c0
Windowsx64
Remote Machine
1.41.0
9579eda04fdb3a9bba2750f15193e5fafe16b959
CentOsx64
Can you help me to debug
Copying my answer from https://stackoverflow.com/a/68090934/319542
You shouldn't have to do anything. VSCode automatically sets the path/PATH to the code in the path/PATH environment variable depending on your shell. See this response. You might be overwriting your path/PATH like I was. I was accidentally overwriting path in ~/.cshrc and PATH in ~/.bashrc and was running into the same issue. After fixing it, I can run code on the command line. which code returns the location of the command.
Until I spent time to figure it out, I was using the two methods mentioned below. Both of which worked for me in bash; you can modify it for your shell as you see fit. But really fix your path/PATH rather than using these methods.
Adding location of code to the PATH in ~/.bashrc
export PATH=${VSCODE_GIT_ASKPASS_NODE%/*}/bin:$PATH
OR
Setting alias to code in ~/.bashrc
alias code="${VSCODE_GIT_ASKPASS_NODE%/*}/bin/code"
More on path vs. PATH here and here

How to open Visual Studio Code from the command line on linux?

I know I can use command "code" to open VS code or file, but I don't know what should I do to make it possible after I install VS code in Ubuntu.Thanks.
Launching from the Command Line
You can launch VS Code from the command line to quickly open a file, folder, or project. Typically, you open VS Code within the context of a folder. We find the best way to do this is to simply type:
code .
Tip: We have instructions for Mac users in our Setup topic that enable you to start VS Code from within a terminal. We add the VS Code executable to the PATH environment variable on Windows and Linux automatically during installation.
Sometimes you will want to open or create a file. If the specified files does not exist, VS Code will create them for you:
code index.html style.css readme.md
Tip: You can have as many file names as you want separated by spaces.
Source: https://code.visualstudio.com/Docs/editor/codebasics
So, there are a couple of solutions for this.
I've linked a video that shows you how to add vscode to $PATH
(which didn't work for me because I couldn't find the "shell:install path" command)
I uninstalled the vscode from my ubuntu and re-installed using sudo snap install --classic code
(This method worked for me)
Tell me which one works for you... and if you have extensions installed to your vscode then i guess you ought to make a backup or something.
Link to the video: https://youtu.be/iP5FKZXtDBs