You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The only thing that’d make it better is to have no need to call it directly. I’m on macOS Mojave, but manually installed and am using the latest bash shell using Homebrew, which allows you to configure your own function to run when commands aren’t found, command_not_found_handle().
Doing this produces the following output, as if fuck isn’t set up:
**Seems like fuck alias isn't configured!Please put eval $(thefuck --alias) in your ~/.bashrc and apply changes with source ~/.bashrc or restart your shell.Or run fuck second time for configuring it automatically.More details - https://github.com/nvbn/thefuck#manual-installation**
I do have the eval $(thefuck --alias) line in my bash profile. It just seems that when run from the command_not_found_handle() bash isn’t using that. fuck does work as expected when run directly.
Is there any way I can get this to work as desired? Or does this need fixing in fuck itself? Not sure if this is a fuck bug, bash bug, or just something that I need help to configure correctly.
The output of fuck -v as it is requested:
The Fuck 3.28 using Python 3.7.2 and Bash 5.0.0(1)-release
The text was updated successfully, but these errors were encountered:
Ok, so I’ve done some more digging. If I run /usr/local/bin/thefuck $@ in my handler it will run. However, it in turn will not run the selected command. So, my command_not_found_handle() will produce this output:
d /usr/local/
id /usr/local/ [enter/↑/↓/ctrl+c]
id /usr/local/
It will run thefuck, but the command I pick there only gets printed out, not run. Whereas, running fuck myself right afterwards I get what is expected:
fuck
id /usr/local/ [enter/↑/↓/ctrl+c]
id: /usr/local/: no such user
It has run the command selected via fuck. But my handler, for some reason, is not running the command, but rather just printing it.
First of all,
fuck
is genius. Thanks a lot.The only thing that’d make it better is to have no need to call it directly. I’m on macOS Mojave, but manually installed and am using the latest
bash
shell using Homebrew, which allows you to configure your own function to run when commands aren’t found,command_not_found_handle()
.My version of this, that I’d like to work is:
command_not_found_handle() { /usr/local/bin/fuck }
Doing this produces the following output, as if
fuck
isn’t set up:I do have the
eval $(thefuck --alias)
line in my bash profile. It just seems that when run from thecommand_not_found_handle()
bash isn’t using that.fuck
does work as expected when run directly.Is there any way I can get this to work as desired? Or does this need fixing in
fuck
itself? Not sure if this is afuck
bug,bash
bug, or just something that I need help to configure correctly.The output of
fuck -v
as it is requested:The text was updated successfully, but these errors were encountered: