GAM icon indicating copy to clipboard operation
GAM copied to clipboard

GAM install doesn't install in ZSH (or other shells)

Open evilhamsterman opened this issue 7 years ago • 19 comments

Full steps to reproduce the issue:

  1. Install GAM as per wiki
  2. Restart ZSH

Expected outcome (what are you trying to do?): GAM command will be available

Actual outcome (what errors or bad behavior do you see instead?): GAM command is not available

The appears to append gam() { "/home/dmills/bin/gam/gam" "$@" ; } to the .bashrc file to load the gam command. However zsh and other popular shells don't use .bashrc file. GAM should check what shell is running and append it in the appropriate file for at least common shell options.

evilhamsterman avatar May 28 '19 16:05 evilhamsterman

Yes this is true, I'm having the same issue after installing macOS Catalina which uses zsh as the default shell

maximusapen avatar Oct 17 '19 08:10 maximusapen

I have the same issue on macOS Catalina - any solution how to make the commands working ? thanks

ghost avatar Jan 07 '20 10:01 ghost

Use bash? The forum is probably a better place for this discussion.

mick-t avatar Jan 07 '20 12:01 mick-t

Start terminal echo 'alias gam="~/bin/gam/gam"' >> .profile source .profile gam version

taers232c avatar Jan 07 '20 13:01 taers232c

Start terminal echo 'alias gam="~/bin/gam/gam"' >> .profile source .profile gam version

yes, it helps! thanks!

ghost avatar Jan 07 '20 14:01 ghost

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Apr 06 '20 14:04 stale[bot]

As far as I'm aware this is still an issue. More so with MacOS now defaulting to zsh instead of bash. Workarounds are nice, and I used one myself. But this should be solved by the package.

evilhamsterman avatar Apr 06 '20 18:04 evilhamsterman

Thanks @taers232c! Totally helped :)

valentinwong avatar Apr 06 '20 23:04 valentinwong

As far as I'm aware this is still an issue. More so with MacOS now defaulting to zsh instead of bash. Workarounds are nice, and I used one myself. But this should be solved by the package.

So I have been doing the commands that @taers232c posted which would work until terminal was restarted, and then I would need to redo those steps. What I figured out that ~/.zshrc does not exist by default and doing those commands would only write them to either to the session or to a temp file that was purged when terminal restarted. Creating .zshrc using touch ~/.zshrc and then adding alias gam="~/bin/gam/gam" to it using nano or whatever you want solved this problem.

eosrebel avatar Apr 16 '20 23:04 eosrebel

As far as I'm aware this is still an issue. More so with MacOS now defaulting to zsh instead of bash. Workarounds are nice, and I used one myself. But this should be solved by the package.

So I have been doing the commands that @taers232c posted which would work until terminal was restarted, and then I would need to redo those steps. What I figured out that ~/.zshrc does not exist by default and doing those commands would only write them to either to the session or to a temp file that was purged when terminal restarted. Creating .zshrc using touch ~/.zshrc and then adding alias gam="~/bin/gam/gam" to it using nano or whatever you want solved this problem.

I have a working .zshrc, I filed this bug because others probably have similar issues, and especially with MacOS switching to zsh it is probably going to come up a lot more.

evilhamsterman avatar Apr 17 '20 01:04 evilhamsterman

Gam install on zsh still not working after change https://github.com/jay0lee/GAM/pull/1164

jnance86 avatar Apr 23 '20 14:04 jnance86

Jacob,

The change happened after 5.06 was released.

Ross

[email protected]

On Apr 23, 2020, at 7:11 AM, Jacob [email protected] wrote:

Gam install on zsh still not working after change #1164 https://github.com/jay0lee/GAM/pull/1164 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jay0lee/GAM/issues/940#issuecomment-618417079, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYL3ODFIEZ62FAJYI343ROBD75ANCNFSM4HQFGYZQ.

taers232c avatar Apr 23 '20 14:04 taers232c

Jacob,

Are you installing GAM on lots of computers? Once you've set the GAM alias on a computer you're good to go.

Ross

[email protected]

On Apr 23, 2020, at 7:11 AM, Jacob [email protected] wrote:

Gam install on zsh still not working after change #1164 https://github.com/jay0lee/GAM/pull/1164 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jay0lee/GAM/issues/940#issuecomment-618417079, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYL3ODFIEZ62FAJYI343ROBD75ANCNFSM4HQFGYZQ.

taers232c avatar Apr 23 '20 14:04 taers232c

It worked now. Not sure what I did different to make it work. I had the alias set.

jnance86 avatar Apr 23 '20 14:04 jnance86

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Jul 22 '20 15:07 stale[bot]

Just installed GAM and had this issue when starting up Terminal...

Last login: Fri Sep 18 13:00:55 on ttys000
/Users/sean/.zshrc:104: defining function based on alias `gam'
/Users/sean/.zshrc:104: parse error near `()'
➜  ~ 

syoung-quizlet avatar Sep 18 '20 20:09 syoung-quizlet

Modified .zshrc to the below resolved it...

function gam() { "/Users/USERNAME/bin/gam/gam" "$@" ; }

syoung-quizlet avatar Sep 18 '20 20:09 syoung-quizlet

Just forked the repo and submitted a fix. https://github.com/jay0lee/GAM/pull/1245

seanism avatar Sep 18 '20 20:09 seanism

This is still a problem out of the box on MacOS using zsh. 😔

The workaround appears to be working.

mattflemingrelyance avatar Feb 13 '23 16:02 mattflemingrelyance