Comments (18)
I just created #144, to wrap up this subject and avoid any further confusion. Afterwards, yeah, let's just close it.
from geometry.
It seems you have loading geometry twice. What's your zshrc/zplug configuration?
from geometry.
I actually have a suggestion regarding this but I'm afraid I'm nitpicking. I have on my dotfiles alias reload="source ~/.zshrc"
to reload configs when I change them and that always sets me off because of the "Error". It always seems like I screwed up something. At the very least can we change it to "Warning" or equivalent?
from geometry.
Yes I agree. I haven't put much though on the "Error:" string.
from geometry.
My .zshrc
TERM=xterm-256color
# shortcut to this dotfiles path is $ZSH
export ZSH=$HOME/.dotfiles
# your project folder that we can `c [tab]` to
export PROJECTS=~/Documents/Development
# Stash your environment variables in ~/.localrc. This means they'll stay out
# of your main dotfiles repository (which may be public, like this one), but
# you'll have access to them in your scripts.
if [[ -a ~/.localrc ]]
then
source ~/.localrc
fi
# all of our zsh files
typeset -U config_files
config_files=($ZSH/**/*.zsh)
# load the path files
for file in ${(M)config_files:#*/path.zsh}
do
source $file
done
# load everything but the path and completion files
for file in ${${config_files:#*/path.zsh}:#*/completion.zsh}
do
source $file
done
# initialize autocomplete here, otherwise functions won't be loaded
autoload -Uz compinit && compinit
# load every completion after autocomplete loads
for file in ${(M)config_files:#*/completion.zsh}
do
source $file
done
unset config_files
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
Which sources .localrc
export LSCOLORS="ExFxCxDxBxegedabaggcad"
autoload -U colors && colors
autoload -U promptinit
# Customize geometry
GEOMETRY_COLOR_GIT_DIRTY=9
GEOMETRY_COLOR_GIT_BRANCH=6
GEOMETRY_COLOR_EXIT_VALUE=9
GEOMETRY_COLOR_DIR=242
GEOMETRY_SYMBOL_EXIT_VALUE="▲"
PROMPT_GEOMETRY_GIT_CONFLICTS=true
and all shell scripts from .dotfiles
directory including zplug.zsh
#!/bin/zsh
source ~/.zplug/init.zsh
has_plugin() {
(( $+functions[zplug] )) || return 1
zplug check "${1:?too few arguments}"
return $status
}
# Remote plugins
zplug "glidenote/hub-zsh-completion"
zplug "frmendes/geometry"
zplug "zsh-users/zsh-completions"
zplug "zsh-users/zsh-history-substring-search"
if ! zplug check --verbose; then
printf "Install? [y/N]: "
if read -q; then
echo; zplug install
else
echo
fi
fi
# Source plugins and add commands to $PATH
zplug load # --verbose
from geometry.
I didn't tried the whole config just the zplug part and it worked without issues. Can you provide a minimal config where the issue still reproduces?
from geometry.
I couldn't figure out why it did it. I tried without loading any other files but zplug and it still wrote those warnings. I also tried only to load zplug + geometry without luck.
I have changed the line for loading zplug plugins to
zplug load > /dev/null
It isn't fixing the issue, but this will prevent it from showing up in stdout.
from geometry.
# load everything but the path and completion files
for file in ${${config_files:#*/path.zsh}:#*/completion.zsh}
do
source $file
done
Are you sure this isn't loading geometry again?
from geometry.
Yeah I tried to comment out individual loops, and even echo
the $file
. It only loads zplug.zsh
once and only within the loop you specified. I also tried without loops and sourcing zplug manually, same result.
from geometry.
Can you try a more minimal .zshrc
, like:
export ZSH=$HOME/.dotfiles
typeset -U config_files
config_files=($ZSH/**/*.zsh)
for file in ${(M)config_files:#*/path.zsh}
do
source $file
done
for file in ${${config_files:#*/path.zsh}:#*/completion.zsh}
do
source $file
done
unset config_files
Its pretty tough for us to reproduce, because we would need the entire contents of your $HOME/.dotfiles
to see if any of them are re-loading geometry...
from geometry.
I have same issue.
My .zshrc:
# zgen
source ~/.zgen/zgen.zsh
if ! zgen saved; then
zgen load frmendes/geometry
zgen save
fi
When I open my console it's ok. First time, second time and further.
But if manually source ~/.zshrc
then I got:
Warning: Plugin exec_time already registered.
Warning: Plugin git already registered.
But if before source ~/.zshrc
perform zgen reset
than it doesn't give any warning.
zgen reset
delete ~/.zgen/init.zsh
.
My ~/.zgen/init.zsh
(autogenerated):
# {{{
# Generated by zgen.
# This file will be overwritten the next time you run zgen save!
ZSH=/home/kreedz/.zgen/robbyrussell/oh-my-zsh-master
# ### General modules
source "/home/kreedz/.zgen/frmendes/geometry-master/geometry.plugin.zsh"
# ### Plugins & Completions
fpath=(/home/kreedz/.zgen/frmendes/geometry-master ${fpath})
autoload -Uz compinit && \
compinit -C
# }}}
And I noticed that ${fpath} starts to repeat (equal to the number of sourcing) the paths that mentioned in the ~/.zgen/init.zsh
. It's normal?
Other plugins (zsh-users/zsh-autosuggestions, zsh-users/zsh-syntax-highlighting, oh-my-zsh plugins/{git,sudo}) works without warnings
I don't know it's zgen or geometry problem. Or even my problem that I'm doing something wrong.
But on the main page of zgen there a nothing about doing zgen reset
before source ~/.zshrc
from geometry.
Manually sourcing .zshrc
does give that error because you are effectively loading geometry again. As far as I can tell, this doesn't cause any issues and you should be clear to just ignore it. The error message was intended as a warning in case of faulty configuration but it's normal to happen when you reload all your shell configs.
from geometry.
How would we feel about unloading then reloading a plugin, instead of warning?
from geometry.
Is it worth it, though? It's the intended behaviour based on how shells work. If you put PATH=$HOME/.bin:$PATH
in your .zshrc
and then source it again, the PATH
variable will contain $HOME/.bin
twice. It doesn't clear the environment. Because of that, I'm not keen on doing it by hand. Especially since we would be adding code to handle a very specific issue which isn't really an issue and doesn't break anything. It's more of a consequence of external code (the shell) acting like it's supposed to.
Maybe change the warning message? But even that, it's supposed to inform users when they do something wrong while building a custom plugin. There's not a clear way to distinguish errors while making custom plugins and a source .zshrc
.
from geometry.
Yeah I think as long as we are writing to stderr, it's a good idea to keep the current behaviour. The warning is helpful and harmless, made for humans.
from geometry.
@frmendes @jedahan I think the actionable now is to better handle error/warning messages. Currently we have writing everything to stdout, ex: https://github.com/frmendes/geometry/blob/master/lib/plugin.zsh#L30
I'm gonna create a new issue for this.
I believe we can close this for now then, @frmendes Should I?
from geometry.
The git
plugin stops working whenever I re-source my zshrc. Can I stop Geometry from loading again if it's already loaded?
(Gif: https://jmp.sh/AynbK0p)
My .zshrc
: https://github.com/sheharyarn/dotfiles/blob/master/Zsh/zshrc.symlink
from geometry.
@sheharyarn unfortunately since you are sourcing geometry from oh-my-zsh, I am not sure how to tell OMZ how to not source geometry.zsh.
In addition these are warnings that can be safely ignored. We will soon be releasing a version of geometry that will no longer have these warnings.
from geometry.
Related Issues (20)
- possibility to deactivate `hostname` HOT 12
- command not found: geometry_plugin_register when installing plugins both manually and with antigen HOT 5
- Explicit args for default plugins HOT 3
- Investigate supporting gitstatus
- Git reports errors in git submodules HOT 5
- clobber ASYNC_FD HOT 2
- Update async prompt functions independently
- Holding enter crashes on macOS HOT 7
- Prompt displays hostname after empty command HOT 1
- geometry::wrap prints unneeded space if output of called function is empty or single-space HOT 1
- GEOMETRY_INFO is surprising HOT 2
- Custom git GEOMETRY_RPROMPT spews to stderr
- GEOMETRY_CMDTITLE has issues with escape codes HOT 1
- git init produces an error: fatal: ambiguous argument 'HEAD' HOT 2
- geometry swallows output without trailing \n HOT 2
- Request - Add install tool Oh-My-Zsh HOT 3
- Newlines being removed from custom command in magic enter
- Request: Python Virtualenv as a prompt element HOT 1
- Make new gifs using vhs
- Unexpected behavior when geometry_git is in GEOMETRY_PROMPT instead of GEOMETRY_RPROMPT HOT 1
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 geometry.