Closed papanito closed 2 years ago
Unable to reproduce the issue as the given configuration passes tests and loads. Seems that functions.zsh
, and aliases.zsh
are missing.
It indicates that the issue with the functions.zsh
file while adding the function hooks:
add-zsh-hook preexec pre_validation
and also related with:
https://github.com/z-shell/zi/blob/76cfe8ebaf893b916e81aa7c4ece4700da252907/zi.zsh#L2745
You can use docker run --rm -it -h zd@docker ghcr.io/z-shell/zd:zsh-5.9
to help reproduce the issue. (image: vim editor, alpine linux)
Well the function is defined in ~/.functions
, which is sourced before the hook
if [ -f ~/.functions ]; then . ~/.functions ; fi
if [ -f ~/.azure_completion ]; then . ~/.azure_completion ; fi
autoload -U add-zsh-hook # Load the zsh hook module.
add-zsh-hook preexec pre_validation # Adds the hook
Well the function is defined in
~/.functions
, which is sourced before the hookif [ -f ~/.functions ]; then . ~/.functions ; fi if [ -f ~/.azure_completion ]; then . ~/.azure_completion ; fi autoload -U add-zsh-hook # Load the zsh hook module. add-zsh-hook preexec pre_validation # Adds the hook
Your configuration has quite a few issues, and bad practices. For this specific issue you have a function:
# finds all functions defined in any shell script secified, including .bashrc
function functions() {
read -p $1; sort -d $REPLY | grep "() {" | sed -e 's/() {//g' | less;
}
It is a shell built-in command and has to be removed/renamed to solve this issue (check: which functions
).
I recommend updating/fixing all dotfiles. Here are some references to take into consideration:
https://github.com/z-shell/playground/tree/main/profiles https://z.digitalclouds.dev/community/zsh_handbook https://z.digitalclouds.dev/community/zsh_plugin_standard#preventing-function-pollution
It is possible to create dotfiles (zi create
) as a zsh-plugin and simply load it with ZI (zi light papanito/<your-repo-name>
).
Example dotfiles.plugin.zsh:
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
#
#https://z.digitalclouds.dev/community/zsh_plugin_standard#zero-handling
0="${ZERO:-${${0:#$ZSH_ARGZERO}:-${(%):-%N}}}"
0="${${(M)0:#/*}:-$PWD/$0}"
# Autoload personal functions
fpath=("${0:h}/functions" "${fpath[@]}")
autoload -Uz $fpath[1]/*(.:t)
typeset -gA Local
Local[CONFIG_DIR]="${0:h}"
Local[THEMES_DIR]="${0:h}/themes"
Local[COMPLETIONS_DIR]="${0:h}/completions"
Local[COOL_STUFF_HERE_DIR]="${0:h}/some_cool_stuff"
thanks for having a look, will read through the links you provided and adjust my dotfiles.
the doc is amazing and really helps me better understand zsh.
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍 Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions!
Issue closed and locked due to lack of activity. If you encounter this same issue, please open a new issue and refer to this closed one.
Environment
OSTYPE=linux-gnu CPUTYPE=x86_64 / MACHINE_TYPE=x86_64 ZSH_VERSION=5.9
Expected behavior
Zsh starts without problems
Current behavior
When starting zsh, never finishes and prompt is not shown unless aborted. I run zsh -i -x -c exit and then press Ctrl+C to abort it seems to stuck here
Steps to reproduce
Simply run zsh with given config.
Code snippet
You can find my config and sources aliases etc. [here][https://github.com/papanito/dot-files/tree/0dde680e4e7da40e976795ee5d3b52d781abb843/personal/shell). This
.zshrc
is not working.Aditional information
Moving the sourcing of
.aliases
and.functions
solved the issue for meSelf-service
Have you read the Contributing Guidelines?
Are you familiar with Contributor Covenant Code of Conduct?
Contact Details
papanito@wyssmann.com