Code Monkey home page Code Monkey logo

Comments (11)

bfontaine avatar bfontaine commented on August 27, 2024

@xu-cheng Any idea on this?

from homebrew-command-not-found.

xu-cheng avatar xu-cheng commented on August 27, 2024

Sorry dunno.

from homebrew-command-not-found.

bfontaine avatar bfontaine commented on August 27, 2024

@bartonfriedland Would you mind posting your .zshrc here?

from homebrew-command-not-found.

xu-cheng avatar xu-cheng commented on August 27, 2024

What will happen if you run the command manually eval "$(brew command-not-found-init)"?

Also what is the output of echo "$(brew command-not-found-init)"?

from homebrew-command-not-found.

bartonfriedland avatar bartonfriedland commented on August 27, 2024

@xu-cheng, here is the first one:

➜ ~ eval “$(brew command-not-found-init)”;
zsh: no matches found: “#

And here is the second:

➜ ~ echo "$(brew command-not-found-init)";

brew-command-not-found script for OS X

Usage: Source it somewhere in your .bashrc (bash) or .zshrc (zsh)

Author: Baptiste Fontaine
URL: https://github.com/Homebrew/homebrew-command-not-found
License: MIT
Version: 0.2.0

if ! which brew > /dev/null; then return; fi

homebrew_command_not_found_handle() {

local cmd="$1"

http://www.linuxjournal.com/content/bash-command-not-found

do not run when inside Midnight Commander or within a Pipe, except if on
Travis-CI
if test -z "$CONTINUOUS_INTEGRATION" && test -n "$MC_SID" -o ! -t 1 ; then
[ -n "$BASH_VERSION" ] &&
TEXTDOMAIN=command-not-found echo $"$cmd: command not found"
return 127
fi

</from Linux Journal>

local txt="$(brew which-formula --explain $cmd 2>/dev/null)"

if [ -z "$txt" ]; then
[ -n "$BASH_VERSION" ] &&
TEXTDOMAIN=command-not-found echo $"$cmd: command not found"
else
echo "$txt"
fi

return 127
}

if [ -n "$BASH_VERSION" ]; then
command_not_found_handle() {
homebrew_command_not_found_handle $*
return $?
}
elif [ -n "$ZSH_VERSION" ]; then
command_not_found_handler() {
homebrew_command_not_found_handle $*
return $?
}
fi
➜ ~

from homebrew-command-not-found.

bartonfriedland avatar bartonfriedland commented on August 27, 2024

@bfontaine, here is my .zshrc:

# Path to your oh-my-zsh configuration. ZSH=$HOME/.oh-my-zsh

# for homebrew-command-not-found
# https://github.com/Homebrew/homebrew-command-not-found
if brew command command-not-found-init > /dev/null; then eval “$(brew command-not-found-init)”; fi

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"

# Example aliases
alias zshconfig="subl ~/.zshrc"
alias ohmyzsh="subl ~/.oh-my-zsh"
alias reset_ow="/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/
LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -``domain user"
alias countTex="clear;texcount -total -q -col -sum *.tex"
alias fuck='eval $(thefuck $(fc -ln -1 | tail -n 1)); fc -R'

# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"

# Comment this out to disable weekly auto-update checks
# DISABLE_AUTO_UPDATE="true"

# Change this value to set how frequently ZSH updates¬
export UPDATE_ZSH_DAYS=13

# Uncomment following line if you want to disable colors in ls
# DISABLE_LS_COLORS="true"

# Uncomment following line if you want to disable autosetting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment following line if you want red dots to be displayed while waiting for completion
COMPLETION_WAITING_DOTS="true"

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git)

source $ZSH/oh-my-zsh.sh

# for accessing the zsh online help
unalias run-help
autoload run-help
HELPDIR=/usr/local/share/zsh/help

# Customize to your needs...
exportPATH=$PATH:/Users/barton/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/go/bin:/usr/texbin

export WWW_HOME='http://www.google.com'

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

from homebrew-command-not-found.

bfontaine avatar bfontaine commented on August 27, 2024

What does zsh --version say?

from homebrew-command-not-found.

bartonfriedland avatar bartonfriedland commented on August 27, 2024

➜ ~ zsh --version
zsh 5.0.8 (x86_64-apple-darwin14.3.0)

from homebrew-command-not-found.

bfontaine avatar bfontaine commented on August 27, 2024

if brew command command-not-found-init > /dev/null; then eval “$(brew command-not-found-init)”; fi

Those quotes doesn’t seem correct, they should both be ", not and .

from homebrew-command-not-found.

bartonfriedland avatar bartonfriedland commented on August 27, 2024

The inverted quotes were the issue. I am not sure how those got in there - I suspect I was using an editor that changed them without realising it. Sorry for the trouble, but it is working now. Thank you for all of your help.

from homebrew-command-not-found.

bfontaine avatar bfontaine commented on August 27, 2024

We found it! 😄

from homebrew-command-not-found.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.