iridakos / goto

Alias and navigate to directories with tab completion in Linux
https://iridakos.com/programming/2019/04/10/shell-navigation-with-autocomplete
MIT License
873 stars 63 forks source link

goto does not work for me on MacOS 10.15 #55

Open ndsvw opened 4 years ago

ndsvw commented 4 years ago

I can install goto without having any problems via brew but it won't start.

brew install goto

/usr/local/Cellar/goto/1.2.3: 6 files, 18.9KB, built in 4 seconds

If I try starting it: goto

zsh: command not found: goto

With MacOs 10.15, Apple changed the default shell on MacOS to zsh. Maybe that's the problem..

I tried solving this issue by doing this (without success): https://github.com/iridakos/goto/issues/36#issuecomment-496945108


OS: MacOS 10.15.1 Shell: zsh (default shell) goto Version: 1.2.3 (newest version I get via brew install goto) never had such a problem with any brew package

iridakos commented 4 years ago

Hi @ndsvw ,

I will try to to the same asap in my mac and let you know.

Thanks for the detailed feedback.

bluespore commented 4 years ago

Reporting that I had the same issue, and I understand this doesn't help the install with brew, but I did have success simply using the manual method FWIW. So you can use it that way in the meantime @ndsvw

mjwwit commented 4 years ago

I just ran into this issue, and it appears that the actual binary is not part the things installed; /usr/local/Cellar/goto/1.2.3 does not contain a binary. -- EDIT -- Of course by binary I mean the shell script 😅

ndsvw commented 4 years ago

@iridakos, can you update the brew-version of goto? The lastest version of goto on brew is 1.2.3 (from 14 Mar 2018).

iridakos commented 4 years ago

Hi @ndsvw ,

I created a release and I will try to update the version in Brew as well. Unfortunately I no longer have access to a MacOS system and I can't test if the functionality is working on ZSH there. Do you have any updates on this?

iridakos commented 4 years ago

@ndsvw Here's the pull request to Homebrew https://github.com/Homebrew/homebrew-core/pull/49477

ndsvw commented 4 years ago
➜  ~ brew upgrade goto
==> Upgrading 1 outdated package:
goto 1.2.3 -> 2.0.0
==> Upgrading goto 
==> Downloading https://github.com/iridakos/goto/archive/v2.0.0.tar.gz
==> Downloading from https://codeload.github.com/iridakos/goto/tar.gz/v2.0.0
######################################################################## 100.0%
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/goto/2.0.0: 6 files, 20.8KB, built in 10 seconds
Removing: /usr/local/Cellar/goto/1.2.3... (6 files, 18.9KB)
Removing: /Users/-/Library/Caches/Homebrew/goto--1.2.3.tar.gz... (667KB)
==> Checking for dependents of upgraded formulae...
==> No dependents found!
➜  ~ 

but still:

➜  ~ goto
zsh: command not found: goto
➜  ~ 
juliofalbo commented 4 years ago

Having the same issue here.

zsh: command not found: goto
prvn commented 4 years ago

Having same issue

OS: macos 10.15.6 Brew: 2.5.1 goto: 2.0.0

trifygri commented 3 years ago

This solved it for me:

add this to your ~./zshrc file and source it or start a new terminal session

autoload bashcompinit
bashcompinit
source /usr/local/etc/bash_completion.d/goto.sh

goto <tab>

showed all my previously defined aliases

but trying to call them errored

goto mydir
goto error: unregistered alias mydir

I had to reregister my aliases with

goto -r <alias> <directory>

and this solved it.

helpful link Can a Bash tab-completion script be used in zsh?

dcchambers commented 3 years ago

If you're still using bash with MacOS instead of zsh and are encountering this error, you can add this to your .bash_profile to fix this error:

source $(brew --prefix)/etc/bash_completion.d/goto.sh
davidgourde commented 2 years ago

I can source goto.sh to have the script works, but I cannot get the auto-completion work at all. When I press after writing "goto ", I get the auto-completion of the current folder's files instead... I tried all the solutions listed here. 😭

Note: The same .zshrc lines works on my Windows + WSL machine, but not on my MacOS (Monterey)

silent-tan commented 5 months ago

hope this can help u if u install goto via script : )

check if following code in your ~/.zshrc, and append it if not

# Source goto
[[ -s "/usr/local/share/goto.sh" ]] && source /usr/local/share/goto.sh

the reason it not work maybe you have both .bashrc and .zshrc

https://github.com/iridakos/goto/blob/b7fda54e0817b9cb47e22a78bd00b4571011cf58/install#L48-L53

alperenkilic commented 5 months ago

Copy the file goto.sh somewhere in your filesystem and add a line in your .zshrc or .bashrc to source it.

For example, if you placed the file in your home folder, all you have to do is add the following line to your .zshrc or .bashrc file: source ~/goto.sh

download goto.sh

it fixed my problem

Screenshot 2024-04-10 at 01 40 19