How to fix this Terminal problem as i tried to install java but came up with this issue and tried to close but it keeps popping up - terminal

so i try to install java in Terminal and used
vim ~/.bash_profile
java_HOME = $(/usr/libexec/java_home)
hit enter
and then this issue comes tried to close it but it keeps pop up and i cannot use terminal.


VSCode Terminal is not the same as my default terminal

So I downloaded VSCode today and tried the terminal.
I noticed that if I open the terminal in VSCode the tns (typescript) command doesn't work. Outside VSCode it works fine in my Iterm2 shell and in the normal
Checked if the settings are correct.
"": true,
"": "/bin/zsh",
"terminal.external.osxExec": "",
So some things to know:
in the right top corner of the terminal in VSCode it says "zsh"
already tried to restart VSCode
I installed tns with yarn globally
When I type /bin/zsh in VSCode it works for that session. But not for new sessions. I think that is a little bit weird because in the top right corner of the terminal it is already saying it is using zsh and in the configuration its also pointed to the "/bin/zsh" path.

Custom prompt displayed after first command

I have a custom prompt (with powerline) configured for bash shell. However, it is not displayed until I issue the first command or press enter.
I currently use iTerm2 as terminal application and bash installed with brew.
On the other computer where I also have Powerline installed and the same configuration files it is always displayed when opening the shell.
The chunk of code that sets the powerline prompt is in the .bash_profile file:
# add support for powerline-status
powerline-daemon -q
. /usr/local/lib/python2.7/site-packages/powerline/bindings/bash/
My guess is that it may be due to any setting the prompt in a bash file that might be loaded later or something related but I don't know how to fix it.
It seems that the strange behavior of the command prompt is due to shell integration feature of iTerm2.
It turns out that in this computer, freshly re-installed from scratch I installed the beta version of Iterm2 (obviously as any other beta still under development) and the shell integration causes this. Guess still needs some more improvements.
After uninstalling it and a reboot, custom prompt is always displayed.
Anyway, the features provided by shell integration are far superior to this minor inconvenience. After all, it is only the first time the prompt is displayed.

Basic terminal commands not working after trying to install Composer

My mac terminal is completely dysfunctional! Every time I open terminal I get this message:
-bash: export: `/Applications/MAMP/bin/php/php5.5.10/bin/:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin': not a valid identifier
The problem came about a while ago, I believe I was attempting to install composer to work with MAMP.
Today I started a beginner tutorial on how to use the Terminal and almost every command does not work such as the basic mkdir , ls , and touch (to make folder, list items, and make a file respectively), (screenshot attached).
I have already tried deleting the ~/Library/Preferences/ file. Your help is greatly appreciated.
I am working with Mac OS X 10.10.2
screenshot of terminal after making basic commands
It looks like you have an error in your .bash_profile or other startup script. Open it on terminal using vi ~/.bash_profile or some other editor of your choice and comment out that line, then type source .bash_profile to reload it.

Accidently quit updating ZSH in the middle and can't type any commands

I was upgrading everything in homebrew and zsh was upgrading and I was cycling through my open applications and accidentally closed iterm during the update. Now I can't open iterm and when I open the terminal I get the following error message:
login: /usr/local/bin/zsh: No such file or directory
I am not sure how I can switch back to bash until I correctly update zsh. I also can't type a single command in either iterm or termianl which makes sense (there's no zsh file). How can I finish upgrading zsh correctly or switch back to bash?
I have done a good amount of research and can't find someone having a similar issue.
Any guidance to how to solve this issue would be much appreciated, I currently can't do any of the development work I need to do.
Found this on Apple's suport site. Basically, you want to launch Terminal and go into Preferences. Change Shells open with from Default login shell to a valid shell (I recommend /bin/bash or even /bin/sh just to get you working again).
Once you can access your shell session, you can restore zsh.
Here's the full article...

Unable to initialize device PRN in Python

I attempt to run a python program and the following pops up in command prompt:
"Unable to initialize device PRN"
I should also mention that the program runs fine.
I had this same problem when I accidentally typed "print" instead of "python". The error message comes from the Windows command-line program named print. Those who suggested restarting the command prompt probably committed the same typo without noticing, and corrected it in their new command prompt.
In my case restarting (close / open new) the console or the Command Prompt window works
Try changing name of the program; that worked for me. Don't forget: use fresh cmd when you start executing.
I know this is an old question, but I experienced this issue in VS Code after installing the latest version of Python and the Python extension.
To fix it, I just needed to add the Python installation path to my PATH environment variable.
On Windows 10, go to Settings and search for Environment
Click on Edit environment variables for your account
Select Path and click the Edit button
If the path to your Python.exe is not listed, click the New button
Enter the path to your Python.exe application and click the OK button
The path for me was %LocalAppData%\Programs\Python\Python37-32\
Restart VS Code and try to run your python script again