Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I get this error: omz_history:fc:13: no such event: 1 #8360

Closed
thomasd3 opened this issue Nov 6, 2019 · 4 comments
Closed

I get this error: omz_history:fc:13: no such event: 1 #8360

thomasd3 opened this issue Nov 6, 2019 · 4 comments
Labels
Resolution: not our issue Issue or pull request not related to Oh My Zsh Support Request for support

Comments

@thomasd3
Copy link

thomasd3 commented Nov 6, 2019

This is a new install on a brand new AWS CentOS.

Upon logging in to the system, I get this error.

I have done a search and there are a few posts and some old bugs dating a few years back but I can't find anything 'modern' about it. There were some discussions about fc being an alias, but again, these are old discussions, so I would assume whatever the problem was, it must have been sorted out.

I have no clue where this comes from.

How can I troubleshoot this?

@mcornella mcornella added the Area: core Issue or PR related to core parts of the project label Nov 6, 2019
@mcornella
Copy link
Member

You could capture a trace of the zsh initialization (the command that runs exit) and grep the error there to see where it was called. I can help you with that if you post the trace file.

@thomasd3
Copy link
Author

thomasd3 commented Nov 6, 2019

I just did:
zsh -xvic exit &> ~/omz-debug.log

and put the result here: REDACTED

@mcornella
Copy link
Member

The call comes from /etc/bashrc:

+/etc/bashrc:38> omz_history -a
+omz_history:1> local clear list
+omz_history:2> zparseopts -E 'c=clear' 'l=list'
+omz_history:4> [[ -n '' ]]
+omz_history:8> [[ -n '' ]]
+omz_history:13> [[ -a = *[0-9]* ]]
+omz_history:13> fc -l -a 1
omz_history:fc:13: no such event: 1

which is sourced from /root/.bashrc:

# Source global definitions
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi
+/root/.bashrc:10> [ -f /etc/bashrc ']'
+/root/.bashrc:11> . /etc/bashrc

which is sourced in .zshrc:

source ~/.bashrc
+/root/.zshrc:101> source /root/.bashrc

There is something wrong about your loading process. /etc/* files should be sourced before user rc files, and bashrc shouldn't be sourced in zshrc. If you want to share settings between bash and zsh, put it in a separate file and source it from bashrc and zshrc.

@mcornella mcornella added Resolution: not our issue Issue or pull request not related to Oh My Zsh Support Request for support and removed Area: core Issue or PR related to core parts of the project labels Nov 6, 2019
@joytry1
Copy link

joytry1 commented May 14, 2023

The call comes from /etc/bashrc:

+/etc/bashrc:38> omz_history -a
+omz_history:1> local clear list
+omz_history:2> zparseopts -E 'c=clear' 'l=list'
+omz_history:4> [[ -n '' ]]
+omz_history:8> [[ -n '' ]]
+omz_history:13> [[ -a = *[0-9]* ]]
+omz_history:13> fc -l -a 1
omz_history:fc:13: no such event: 1

which is sourced from /root/.bashrc:

# Source global definitions
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi
+/root/.bashrc:10> [ -f /etc/bashrc ']'
+/root/.bashrc:11> . /etc/bashrc

which is sourced in .zshrc:

source ~/.bashrc
+/root/.zshrc:101> source /root/.bashrc

There is something wrong about your loading process. /etc/* files should be sourced before user rc files, and bashrc shouldn't be sourced in zshrc. If you want to share settings between bash and zsh, put it in a separate file and source it from bashrc and zshrc.

Great! I solved this annoying problem by remove source ~/.bash_profile in ~/.zshrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: not our issue Issue or pull request not related to Oh My Zsh Support Request for support
Projects
None yet
Development

No branches or pull requests

3 participants