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

init shell failed? #413

Closed
4t8dd opened this issue May 14, 2024 · 5 comments
Closed

init shell failed? #413

4t8dd opened this issue May 14, 2024 · 5 comments

Comments

@4t8dd
Copy link

4t8dd commented May 14, 2024

I use fish shell. But when I execute the initiation and nothing writtent to fish config file.
And when try to dump and there is a panic. But I can search with mcfly.

And also ini bash, nothing written to .bashrc and when I exit bash and return with a dump.
Panics happened too.

Is this a bug or I missed anything?

I installed with brew and my os is Mac m2.

@cantino
Copy link
Owner

cantino commented May 14, 2024

Did you add mcfly init fish | source to your fish config file?

@4t8dd
Copy link
Author

4t8dd commented May 14, 2024

Did you add mcfly init fish | source to your fish config file?

yes, but nothing got written as I inspected.
Something wrong here? But the key bingding works and I can search.

@4t8dd
Copy link
Author

4t8dd commented May 14, 2024

should I paste all the init shell to config.fish manually?

EDIT:

@cantino sorry, I missed the line and I should have add the init result to config.fish

But even so, I still got a panic with mcfly dump in fish.

McFly error: Please ensure that MCFLY_HISTORY is set (environment variable not found)

but I found one line in the mcfly init shell:

# We don't need a MCFLY_HISTORY file because we can get the last command in fish_postexec. 
set -g __MCFLY_CMD $MCFLY_PATH --mcfly_history /dev/null --history_format fish             

But in settiings.rs: if MCFLY_HISTORY not found there will be panic. Why? Is this a bug? Or I missed the config.
But I did not see any config like this in readme.

And what would the config.toml file look like? And it should be in XDG_DATA_DIR in MAC where locates
the history.db by default. But I did not find this config file too.

I think I figure it out here.
When to search, the MCFLY_PATH is set to /dev/null, because __MCFLY_COMMAND is set to
`
set -g __MCFLY_CMD $MCFLY_PATH --mcfly_history /dev/null --history_format fish

Then search and add are good from this init shell. But if I just usemcfly dump` or any other command it just failed.
because MCFLY_HISTORY is not set.

So the simplest fix is add line set -g MCFLY_HISTORY /dev/null and it is fix then.

@4t8dd
Copy link
Author

4t8dd commented May 16, 2024

PR: #414

@cantino
Copy link
Owner

cantino commented May 17, 2024

Good fix, thank you!

@cantino cantino closed this as completed May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants