Comments (11)
@xu-cheng Any idea on this?
from homebrew-command-not-found.
Sorry dunno.
from homebrew-command-not-found.
@bartonfriedland Would you mind posting your .zshrc
here?
from homebrew-command-not-found.
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.
@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.0if ! which brew > /dev/null; then return; fi
homebrew_command_not_found_handle() {
local cmd="$1"
http://www.linuxjournal.com/content/bash-command-not-founddo 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"
fireturn 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.
@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...
export
PATH=$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.
What does zsh --version
say?
from homebrew-command-not-found.
➜ ~ zsh --version
zsh 5.0.8 (x86_64-apple-darwin14.3.0)
from homebrew-command-not-found.
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.
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.
We found it! 😄
from homebrew-command-not-found.
Related Issues (20)
- Takes 1-2 seconds before it shows the message HOT 10
- Commands starting with '-' can appear to be options and need quoting HOT 1
- Using brew gives warnings HOT 18
- Command brew which-update fails HOT 2
- Consider supporting fish. HOT 1
- Incorrectly refer to .bashrc as opposed to .bash_profile? HOT 3
- not working and I've installed and edited my bash_profile HOT 6
- I followed the installation instructions but it doesn't work HOT 2
- Error: undefined method `install_tap' for Homebrew:Module HOT 3
- could this be extended to support searching libraries? (not just binaries) HOT 2
- `brew which-formula lldb` empty for formulas requiring options (eg lldb) HOT 2
- duplicate 'zsh: command not found: ' HOT 1
- Error with brew which-update: undefined method `split' for nil:NilClass HOT 2
- Redundancy in installation instructions around `brew command-not-found-init` HOT 5
- command-not-found causes VERY long zsh startup times HOT 10
- `brew which-formula` doesn't work HOT 2
- homebrew-command-not-found started displaying error on loading on macOS HOT 4
- Path given in README does not work for `/opt/homebrew` installations on M1 Macs
- prompt if not in PATH? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homebrew-command-not-found.