Why is terminal crashing when I should be getting an error message? - visual-studio-code

My apologies if this is an overly nooby question. I'm just learning Ruby and my terminal has started acting funny and I'm not sure how to fix it. I appreciate any guidance that can steer me in the right direction.
First, when I open terminal within VS Code I have started to get the following message - "complete:13: command not found: compdef". As a newcomer, I am not very skilled yet with zsh and not sure what to do to fix this message.
Second, ever since this message started appearing, whenever I run ruby code and expect an error, instead of getting an error message, the terminal just seems to crash. The cursor moves to the next line and then nothing happens other than the fan speeding up. I can type text but the only way to get the terminal working again is to close out and reopen. Is this related to the compdef message I am getting or is this a separate message? Does anyone know how I might go about fixing this? It's preventing me from being able to learn where I am going wrong in my code.
Thank you so much to anyone that may have an answer!

Related

Variables panel not showing when debugging any language in VSCode

I used Python with VSCode for the first time in a while. When I went to debug the script I'd written, I couldn't see any variables in the debug panel. It's not just that none are showing up - there's not even a section where they would be appearing - please see the screenshots below.
When I right click on the three dots at the top of the debug panel, I can see "Watch", "Call Stack", and "Breakpoints", with ticks next to them, but no "Variables" option.
I swear I used to be able to see variables, and everything I'm seeing online is saying that I should be able to, but they just don't seem to be there. At first I thought it was just Python, but I've just tried to debug a simple C program and the same thing happens.
Besides this issue, the debugger seems to work just fine.
What I'm seeing:
What I'm supposed to be seeing, and what I used to be able to see:
Any information would be really helpful, it must be something daft I'm missing.
To clarify, I've tried a fresh VSCode install, which did not fix the issue.
Solution moved from #DCoxshall's question post.
Just did [a reinstall] and the issue disappeared. If anyone knows what caused it I'd still be interested in information, although the problem is now gone.

Have to restart Visual Studio Code to elimante mistakenly shown errors

sometimes my changes cause an error and after fixing it, VS Code wont get rid of the error. In that case I have to close VS Code and reopen it.
Example:
I add at first an click-event to an html-element, that isnt defined yet in the component.ts File. Angular shows the red unterline and the error message. After defining the missing function, the error does not disapper (even if I save all files and/or refresh explorer). I have to restart VS Code.
Of course I can prevent this using the right order. But sometimes there are errors like this.
Does anybody have an idea how to fix this?
Thanks and best regards

What code should I use? sys.exit() or some other thing I haven't found?

I'm a high school student in a class that is using Python 2 on Enthought Canopy Windows Edition. I often get stuck in coding loops, but the only way I can get out is by closing out all forms of open Enthought. Is there any more reliable way to do it? I've been using sys.exit(0), but it doesn't work correctly, and is leaving my coding in a jam. I can't even test it without it getting me stuck. Anyone know how to fix this issue?
If your code is already running, then you can't reliably type a command to stop it, because the prompt won't necessarily be live then.
Often you can use the Run menu's "Interrupt kernel" command, and you should usually be able to use "Restart kernel", though this doesn't work all the time.

Recover lost python code from running script?

I am a bit panicked right now, and I hope someone can help. I spent months writing a python program on Notepad++. The final bugs were finally worked out and the script was launched in ipython via PowerShell. Right when I went to push the save button in Notepad++, the program crashed, and when it recovered, all of the code was missing. It is as if I deleted all of the code and then hit save.
The python code is still running, and it should for several more hours. My question: is there a way to recover the code by interrupting the running script and somehow accessing the code from ipython? It always shows several lines of the code in ipython when the script is broken, and I am hoping I can somehow recover the full code through this.
Try this
If that doesn't work, let it be a lesson to ALWAYS back up your work. Use GitHub

working with workspaces and Pydev in Eclipse

im not sure what i did.. but i am working through some tutorials to get up to speed on python, and i started getting this error message... any ideas on how to fix this? from the error, i looked up the message, and it looks like wham i press the run button it is looking for a file that is no longer there.... but I'm not even working on that file anymore... I'm trying to run something different that does not refer to the previous file.
what does work is if i do run as.. but id rather not do that every time. I'm sure there is a setting I'm just not aware of that i messed up.
Well, not sure how exactly you're getting to that point from your explanation, but please take a look at: http://pydev.org/manual_101_run.html to see how to properly run a module inside PyDev.