ZSH Setup on Mac OS - macos

Hi guys I have various problems with my ZSH shell. I installed Hyper Terminal for Mac and Oh My ZSH with a specific theme.
It works, however I have two problems:
1.) I have no internet connection, due to our corporate proxy. I tried almost everything. export http_proxy=http://my.proxy.dns:8080/ doesn't work and so on.
2.) I don't have the same environment variables as in my standard bash shell. For example when I run 'git' or 'npm' I always get zsh: command not found npm for example.
Now it seems I just need to apply my bash-config to my zsh shell.
I have for example tried setting: export PATH=$HOME/bin:/usr/local/bin:$PATH inside my .zshrc but no luck. Also source with my bashprofile doesnt seem to work.
How can I do that?

Related

command not found after reinstalling git bash with "Windows default console window"

Before re-installing Git Bash, I was using "MinTTY as default terminal emulator". I just wanted my git bash to be colorful! Reinstall, follow this stackoverflow answer. Then when I use the same Git Bash apparently my common commands which is already installed before like:
nvm
node
npm
code
Is all gone! How do I get all of my command list back? I have python running thought, because I wrote in .bashrc alias python= winpty python. Are there any way to add those commands without adding them one by one through PATH environment variables? Or do I have to keep adding my list in .bashrc?
Thank you!
thank you for the attention.
Apparently, I was using the first CLI that is offered by the installation launcher after the installation is done. With the same CLI, I was so confused why does this CLI doesn't run my usual commands. However, turns out it can be solved by simply closing and opening a new CLI. Then everything went fine.
I sure felt so silly. Should've tried restarting it from the beginning.

Why is git bash behaving weird on PyCharm?

I am using PyCharm 2019.3.3 (Community Edition) on Windows 8. I wanted to integrate Git bash in the PyCharm terminal. I have set the shell path in the terminal application settings of PyCharm as
C:\Program Files\Git\bin\bash.exe
The problem occurs when I activate a venv virtual ennvironment, set up using
python -m venv env
by running
source env/Scripts/activate
I think env is active as I see two parenthesis, () and typing pip freeze displays all installed packages in env. But this is accompanied with an error message that displays in the terminal
bash: basename: command not found
This same message is logged after typing commands like ls, clear which doesn't work but pip freeze and pip --version work. And when I deactivate env, ls, clear and pip stopped working displaying the mentioned error message.
All this problems do not occur in the Git bash application for Windows irrespective of whether I am in env or global environment and all commands work properly. I know I can just use Git bash instead of the integrated terminal of PyCharm but just wanted an answer to this problem.
What seems to be the problem here? Am I setting up my shell path wrongly or is this problem specific to PyCharm?
I solved this issue by disabling "Activate Virtualenv" checkbox in File -> Settings -> Tools -> Terminal
Since, pycharm documents does not show any support for 'Git Bash', that is probably the reason for this weird behaviour.
Terminal Options in Pycharm

iTerm and terminal fail immediately on Mac - 'BrokenPipe'

This happened right after I tried to install pyenv and then virtualenvrapper.
As soon as I open iTerminal I get a "Broken Pipe" message and macOS terminal also shuts down immediately.
I have been trying to debug my .bash_profile but uncommenting one after another but without avail
I tried updating homebrew and bash but no change (using a previously open iterm session)
I restarted my computer with the unfortunate effect that I can't access iterm or terminal now (all old sessions closed)
I am quite at loss here now, I have no clue why this happened and how to go about fixing it without having a functioning terminal.
I'd appreciate any advice or pointers.
Following #user1934428 advice I added set -x to all the bash startup files, unfortunately was still met with the same problem. Changing the startup shell in the terminal preferences didn't work.
Thankfully when using emacs ansi-term I was able to get some information/feedback message:
The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh.
For more details, please visit https://support.apple.com/kb/HT208050.
Following the link I found that default shell has been changed to zsh Catalina. So I went and followed the instructions on the support page and changed the default shell back to bash, which fixed the problem. I am not quite sure why this problem occurred initially since the Broken Pipe Error appeared before I updated to Catalina.
Anyways changing the default shell back to bash shell fixed everything

osx terminal syntax emulation on windows for node scripts

So I have a package json file that was built with osx in mind and it contains scripts for installs and builds. A lot of the scripts in that file have osx terminal specific syntax. Is there a way to emulate that terminal in windows so that syntax is read properly?
P.S. I've tried cygwin mintty (now called cygwin64 terminal), but still have the same issues.
EDIT My intention is not to maintain two files that essentially do the same thing and because we started off only using npm package manager I really don't want to introduce a task runner at this point.
EDIT 9/15/15
Here's an example of cygwin not emulating syntax:
NODE_ENV=production bin/build.sh in linux (ubuntu) will assign "production" to the node_env var and then execute the shell file build.sh, but in windows this syntax will cause errors with the var assignment and with the execution of the shell script file unless I use this syntax: setx NODE_ENV production&&bash bin/build.sh
OS X is based on BSD, so the closest approximation would be using a BSD VM.

Stardog Command not found

I am trying to get to install stardog on mac 10.8.5 using the instructions provided at http://docs.stardog.com/quick-start/.
The export path particular directory has been created and for which echo’ed to make sure that environmental variable is set up. The license key that is provided is also in the correct directory. When I try to run “$ ./stardog-admin server start” the command is not recognized. So I tried to create an export PATH to stardog’s bin, which did not work either.
I have also tried manually adding the path in the following:
- ~/.bash_profile
- ~/.profile
Still no luck, any ideas?
Using zsh I had a similar problem. For some reason, the docs suggest that from the stardog-directory-name directory you can run the command, but it didn't work until you cd into the bin directory. Once there ./stardog-admin server start should run correctly.
It sounds like you simply have something incorrect in your .bash_profile or .profile. If you run either of the stardog scripts from it's bin directory, it will work. If you're getting a command not recognized error, that sounds like bash cannot find the stardog-admin script.

Resources