Input does not work in Visual Studio Code - visual-studio-code

So I just started learning programming and I think something is messed up with my code runner in Visual Studio Code. When I try to use input in Python I can not write anything in the terminal. This problem came out recently. It writes that when I try to input anything that it "cannot edit in read-only editor". I also checked in here what could be the solution, but it did not help. Input still does not work. I am on Linux, and I also tried to uninstall the program and code runner as well, none of them worked so far.
Ps: I tried the Code-runner: Run in Terminal box check method, which did not work at all.

Related

Elixir: VS Code ExUnit cannot find Mix

I cannot load or run my tests, from within VS Code.
I'm a new user to Elixir, and to VS Code. I'm running Lubuntu 21.10 (Impish). I've downloaded Erlang/OTP 25 (.deb), and Elixir 1.14 (precompiled binary in /usr/share/elixir), and can get anything I need running in a Bash terminal. Again, in a standard QTerminal window,
erl, iex, mix, elixir, etc. all work fine.
In VS Code, however, I get some errors. I feel stupid, but I'm coming from Sublime Text, so please forgive me.
In the left pane of VS Code, ExUnit shows an error (red):
Clicking on this error gives me this, on the bottom right pane. The command line options, passed to mix test, seem to be the default configuration:
This result is bizarre to me, because I can open the integrated terminal, execute /bin/sh, and then run the exact mix test line that's displayed:
/usr/share/elixir/bin has been added to my PATH variable, in ~/.bashrc, ~/.profile, and /etc/environment.
However, I am further confused by all tests being excluded, and wonder if there's some connection to the core issue:
Note that I can run my tests just fine, using different command line options. I've tried adding tags, but that didn't fix the problem.
I tried Google'ing this, and played around with my settings. Here is what I have configured in the "User" settings.json, and I made sure nothing overrides this in "Workspace" settings:
Changing the useNativeTesting setting doesn't solve the problem.
On another (?) note, I get a "failed to run elixir" upon VS Code startup:
Again, I have no problem running commands from a Linux terminal, or from a terminal within VS Code.
Plot twist: If I remove the precompiled Elixir 1.14, and downgrade to an older version, via apt, the problem goes away. But Lubuntu 21.10 doesn't offer Elixir 1.14, and I'm really into using the new dbg() feature.
But for now, I cannot load or run my tests, from within VS Code, apparently because Mix cannot be found.
Thanks to Daniel Imms, from the VS Code team, for answering my question on Twitter:
"Try moving where ever you init mix and elixir (.bashrc?) into your .bash_profile and then logging out and in again or restarting. I'm guessing it's in your bashrc which doesn't run in non-interactive sessions like in tasks."

Why is it showing makefile not found?

The code is not compiling on VSCode. I am using the MingW compiler for C++ and it's showing this:
Earlier, the terminal that I was using was powershell integrated into VSCode, which showed this error , but now the above is happening when I am using Git Bash terminal.
I have tried searching on internet but couldn't find anything helpful. What should I do from here?
Any help will be appreciated!

When working with python, there is no output when I run vs code

For some reason I cannot run python in vs code. This problem is new. I have used vs code before without a problem. When I click run the code appears to run but there is no output. I assume there is a wrong setting somewhere, but I don't know where to start. I am new to vs code and python.

Why do no programs run in visual studio code?

I recently got a new computer and reinstalled visual studio code but I haven't been able to run any of my files. The error has occurred with both python and C++, so I feel as though it is the IDE that is the problem. I have looked online and there are no straight answers as I have tried following some solutions which have resulted in different errors.
The error above comes up when I run (F5) a simple line of code in c++. Does anyone have a solution?
Thanks, Jacob
[EDIT]
For my python files to work I have to manually select 'Python: current file' but for c++ files they still have the same error.
First step, uninstall python from this machine.
Second, reinstall and make sure that you check the box "add to path".
It's pretty easy to miss as it's a small box, and I missed it my first time installing python earlier in the year. Here's the box you may have missed while installing.
It could be your extensions.
I had a similar error message and simply updated all of my extensions and then my SDK. I was then able to run my code within the IDE. I was using VSCode for c++ and also updated my GCC compiler along with the extensions.
Also look into your computer's environment variables, if you have changed the %PATH variables it may be affecting your ability to run/compile programs.

Debugging Python Code, Visual Studio Code, Virtual Enviroments

I have been trying to configure the debugger on vscode for debugging python code. Below is the launch.json config and following are the settings.json and externalTerminal (launch.json) config, respectively.
I have read through the documentation but I am afraid I am not able to understand it. From what I read on there, I need to set up my external terminal configuration as the integrated terminal isn't capable of accepting inputs(yet).
I am using virtualenvs for my project and I have them in the path: usr/Projects/VirtualEnvs. All my venvs reside in there. I tried to set "python.pythonPath": "/usr/Projects/VirtualEnvs/myVenv/bin/python3.6" which doesn't seem to work. Could anyone help me out or at least point me in the right direction (would be a good learning experience)? Please let me know if my question isn't clear enough.
I figured it out!
My mistake: The python interpreter was not set for the script I was debugging, and since I was using a venv with different Python version, I was thinking that maybe I'd have to somehow set it to that version of the Python interpreter!
How I came to the solution?: Today, while studying and getting stuck with a problem, I noticed that near my shebang was line that said 'Set as interpreter'. I clicked that and VSCode told me that it was now using Python 3.6.1 as the interpreter, that kind of got me excited. Just to be sure I did a google search and found this video. That, very quickly, helped me understand my problem that firstly the interpreter wasn't set and secondly, I was running the debugger from the wrong file!
"program": "${file}",
"cwd": "${workspaceFolder}"
This setting takes care of which folder and what file for you!
For the External Terminal configuration, a new terminal window pops up and you can supply args to your input statement and watch as the debugger goes step by step!