Closed EsDmitrii closed 1 year ago
How does it fail? Could you provide a description? Or a screen capture might be helpful.
@akinomyoga hi! I updated the issue, missclicked and created an issue instead of describe something:)
When I installed it, it worked until I restarted my terminal.
when I run bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"
first time, it start oh-my-bash session. When I restart terminal (changed theme or something else), it starts send this error -bash: fork: retry: Resource temporarily unavailable
Thanks for the description. I don't have an idea how this could happen.
One possibility is that there is an infinite loop somewhere in the Bash configuration, so the chain of Bash processes eats up the computational resource. Could you give us the full content of your .bash_profile
?
yep, sure
# Set PATH, MANPATH, etc., for Homebrew.
eval "$(/opt/homebrew/bin/brew shellenv)"
[[ -r "$(brew --prefix)/etc/profile.d/bash_completion.sh" ]] && . "$(brew --prefix)/etc/profile.d/bash_completion.sh"
PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"
complete -C /opt/homebrew/Cellar/tfenv/3.0.0/versions/1.3.7/terraform terraform
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
OK. I don't see the problem here. Next question:
~/.bashrc
after the installation of oh-my-bash (other than the mentioned theme change)? For example, did you add some source <another-file>
or . <another-file>
? What did you exactly added to your .bashrc
?If it doesn't matter, maybe you can also paste the full contents of your .bashrc
.
Yep, I just changed OSH_THEME to "agnoster". Nothing that could break something :)
# Enable the subsequent settings only in interactive sessions
case $- in
*i*) ;;
*) return;;
esac
# Path to your oh-my-bash installation.
export OSH='/Users/dmitriiesin/.oh-my-bash'
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-bash is loaded.
OSH_THEME="agnoster"
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_OSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output. One of the following values can
# be used to specify the timestamp format.
# * 'mm/dd/yyyy' # mm/dd/yyyy + time
# * 'dd.mm.yyyy' # dd.mm.yyyy + time
# * 'yyyy-mm-dd' # yyyy-mm-dd + time
# * '[mm/dd/yyyy]' # [mm/dd/yyyy] + [time] with colors
# * '[dd.mm.yyyy]' # [dd.mm.yyyy] + [time] with colors
# * '[yyyy-mm-dd]' # [yyyy-mm-dd] + [time] with colors
# If not set, the default value is 'yyyy-mm-dd'.
# HIST_STAMPS='yyyy-mm-dd'
# Uncomment the following line if you do not want OMB to overwrite the existing
# aliases by the default OMB aliases defined in lib/*.sh
# OMB_DEFAULT_ALIASES="check"
# Would you like to use another custom folder than $OSH/custom?
# OSH_CUSTOM=/path/to/new-custom-folder
# To disable the uses of "sudo" by oh-my-bash, please set "false" to
# this variable. The default behavior for the empty value is "true".
OMB_USE_SUDO=true
# Which completions would you like to load? (completions can be found in ~/.oh-my-bash/completions/*)
# Custom completions may be added to ~/.oh-my-bash/custom/completions/
# Example format: completions=(ssh git bundler gem pip pip3)
# Add wisely, as too many completions slow down shell startup.
completions=(
git
composer
ssh
)
# Which aliases would you like to load? (aliases can be found in ~/.oh-my-bash/aliases/*)
# Custom aliases may be added to ~/.oh-my-bash/custom/aliases/
# Example format: aliases=(vagrant composer git-avh)
# Add wisely, as too many aliases slow down shell startup.
aliases=(
general
)
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-bash/plugins/*)
# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
bashmarks
)
# Which plugins would you like to conditionally load? (plugins can be found in ~/.oh-my-bash/plugins/*)
# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/
# Example format:
# if [ "$DISPLAY" ] || [ "$SSH" ]; then
# plugins+=(tmux-autoattach)
# fi
source "$OSH"/oh-my-bash.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
# Set personal aliases, overriding those provided by oh-my-bash libs,
# plugins, and themes. Aliases can be placed here, though oh-my-bash
# users are encouraged to define aliases within the OSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias bashconfig="mate ~/.bashrc"
# alias ohmybash="mate ~/.oh-my-bash"
oh-my-bash created .bashrc
itself, I used .bash_profile
all the time
OK, your .bashrc
seems to be OK. Maybe it is related to some submodule.
completions
, aliases
, and plugins
in .bashrc
to see if anything changes? edit: I mean, e.g, --- a.bashrc^I2023-02-09 23:35:21.763047687 +0900
+++ b.bashrc^I2023-02-09 23:35:43.674059793 +0900
@@ -69,9 +69,9 @@
# Example format: completions=(ssh git bundler gem pip pip3)
# Add wisely, as too many completions slow down shell startup.
completions=(
- git
- composer
- ssh
+ # git
+ # composer
+ # ssh
)
# Which aliases would you like to load? (aliases can be found in ~/.oh-my-bash/aliases/*)
@@ -79,7 +79,7 @@
# Example format: aliases=(vagrant composer git-avh)
# Add wisely, as too many aliases slow down shell startup.
aliases=(
- general
+ # general
)
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-bash/plugins/*)
@@ -87,8 +87,8 @@
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
- git
- bashmarks
+ # git
+ # bashmarks
)
# Which plugins would you like to conditionally load? (plugins can be found in ~/.oh-my-bash/plugins/*)
nah, the same
# Enable the subsequent settings only in interactive sessions
case $- in
*i*) ;;
*) return;;
esac
# Path to your oh-my-bash installation.
export OSH='/Users/dmitriiesin/.oh-my-bash'
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-bash is loaded.
OSH_THEME="agnoster"
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_OSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output. One of the following values can
# be used to specify the timestamp format.
# * 'mm/dd/yyyy' # mm/dd/yyyy + time
# * 'dd.mm.yyyy' # dd.mm.yyyy + time
# * 'yyyy-mm-dd' # yyyy-mm-dd + time
# * '[mm/dd/yyyy]' # [mm/dd/yyyy] + [time] with colors
# * '[dd.mm.yyyy]' # [dd.mm.yyyy] + [time] with colors
# * '[yyyy-mm-dd]' # [yyyy-mm-dd] + [time] with colors
# If not set, the default value is 'yyyy-mm-dd'.
# HIST_STAMPS='yyyy-mm-dd'
# Uncomment the following line if you do not want OMB to overwrite the existing
# aliases by the default OMB aliases defined in lib/*.sh
# OMB_DEFAULT_ALIASES="check"
# Would you like to use another custom folder than $OSH/custom?
# OSH_CUSTOM=/path/to/new-custom-folder
# To disable the uses of "sudo" by oh-my-bash, please set "false" to
# this variable. The default behavior for the empty value is "true".
OMB_USE_SUDO=true
# Which completions would you like to load? (completions can be found in ~/.oh-my-bash/completions/*)
# Custom completions may be added to ~/.oh-my-bash/custom/completions/
# Example format: completions=(ssh git bundler gem pip pip3)
# Add wisely, as too many completions slow down shell startup.
#completions=(
# git
# composer
# ssh
#)
# Which aliases would you like to load? (aliases can be found in ~/.oh-my-bash/aliases/*)
# Custom aliases may be added to ~/.oh-my-bash/custom/aliases/
# Example format: aliases=(vagrant composer git-avh)
# Add wisely, as too many aliases slow down shell startup.
#aliases=(
# general
#)
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-bash/plugins/*)
# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
#plugins=(
# git
# bashmarks
#)
# Which plugins would you like to conditionally load? (plugins can be found in ~/.oh-my-bash/plugins/*)
# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/
# Example format:
# if [ "$DISPLAY" ] || [ "$SSH" ]; then
# plugins+=(tmux-autoattach)
# fi
source "$OSH"/oh-my-bash.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
# Set personal aliases, overriding those provided by oh-my-bash libs,
# plugins, and themes. Aliases can be placed here, though oh-my-bash
# users are encouraged to define aliases within the OSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias bashconfig="mate ~/.bashrc"
# alias ohmybash="mate ~/.oh-my-bash"
Thanks for checking. Then, the agnoster
theme might be related.
OSH_THEME="agnoster"
and see if it changes?nope the same now all stuff commented
now all stuff commented
Does it mean you also commented out source "$OSH"/oh-my-bash.sh
? I actually wanted to ask that next:
source "$OSH"/oh-my-bash.sh
and try again?yep, this command cause the issue
OK! There seems to be an infinite loop somewhere.
$ PS4='+${FUNCNAME-(global)}: '; set -x
$ source "$OSH"/oh-my-bash.sh
Wow...
$ PS4='+${FUNCNAME-(global)}: '; set -x
$ source "$OSH"/oh-my-bash.sh |& cat -v
Q5
edit by @akinomyoga: I put the long output in the <details>
tag to fold it.
related to Q5
and this repeats infinitely
+++++++++++++++++++++++echoecho 1
+++++++++++++++++++++++echolocal i pass length=1
++++++++++++++++++++++++++echoeval echo '{1..1}'
Q6 the same as in Q5 but without colors:)
Thanks! Hmm, this seems to imply that echo
is overwritten somewhere, which causes the infinite loop.
$ type -a echo
$ (shopt -s extdebug; declare -F echo)
dmitriiesin@Dmitriis-MacBook-Pro:~$ type -a echo
echo is a function
echo ()
{
local i pass length=${1:-4};
pass=$(echo $(for i in $(eval echo "{1..$length}");
do
pickfrom /usr/share/dict/words;
done));
echo "With spaces (easier to memorize): $pass";
echo "Without (use this as the password): $(echo $pass | tr -d ' ')"
}
echo is a shell builtin
echo is /opt/homebrew/opt/coreutils/libexec/gnubin/echo
echo is /bin/echo
dmitriiesin@Dmitriis-MacBook-Pro:~$ (shopt -s extdebug; declare -F echo)
echo 293 /Users/dmitriiesin/.oh-my-bash/lib/base.sh
dmitriiesin@Dmitriis-MacBook-Pro:~$
OK.
dmitriiesin@Dmitriis-MacBook-Pro:~$ (shopt -s extdebug; declare -F echo) echo 293 /Users/dmitriiesin/.oh-my-bash/lib/base.sh
This line (.oh-my-bash/lib/base.sh:293) corresponds to the function definition of passgen
.
$ alias passgen
ha!
I use my own alias passgen in .bash_profile
, to generate random passwords, forgot to mention that.
I commented out it and now all seems well.
I see! Thanks for the information. We actually have experienced similar cases in the past. I now searched for them: there seem to be two cases, #211 and #364. Maybe we should consider a general way to avoid that, e.g. converting all the function declarations to the form function ...
.
@akinomyoga thank you so much for your help and time! I really appreciate it! <3
Thanks! I now switched all the function declarations to use the form function NAME
instead of NAME()
in commit 59f6ef1.
@akinomyoga the last one question what should I do with this? my mac or terminal (?) doesn't know symbols?
FYI I insatalled https://github.com/powerline/fonts
and no luck
what should I do with this? my mac or terminal (?) doesn't know symbols? FYI I insatalled
https://github.com/powerline/fonts
and no luck
So, according to the neofetch
image in your first report, you are using iTerm2 and the selected font is Monaco, right? The font settings in iTerm2 seems to be described in the following page:
FYI I insatalled
https://github.com/powerline/fonts
and no luck
I don't think just installing the font into the system is sufficient, but you need to specify it for iTerm2 in its settings.
By the way, after updating to the latest version of oh-my-bash, now I think you can restore your alias, passgen
, safely.
YOU ARE AWESOME I restored my alias and all works like a charm:) Thank you billion times!
So, according to the
neofetch
image in your first report, you are using iTerm2 and the selected font is Monaco, right? The font settings in iTerm2 seems to be described in the following page:
Sorry, I have carefully looked at it and noticed that this is not the right page. I think you can reference the following page instead:
Yeah, I found this option in settings:)
Oh, great!
Thank you again!
You're the best:)
Thanks
Hi! I installed https://ohmybash.nntoan.com/ using command from the website. I modified by bash_profile as it described in manual. my sys parameters
I also use iTerm2 error is