Thefuck: exception while "run fuck second time for configuring it automatically."

Created on 8 Jun 2017  路  9Comments  路  Source: nvbn/thefuck

luca@g550jk ~> fuck
Seems like fuck alias isn't configured!
Please put eval (thefuck --alias | tr '
' ';') in your ~/.config/fish/config.fish and apply changes with fish or restart your shell.
Or run fuck second time for configuring it automatically.
More details - https://github.com/nvbn/thefuck#manual-installation
luca@g550jk ~> fuck
Traceback (most recent call last):
  File "/usr/bin/fuck", line 11, in <module>
    load_entry_point('thefuck==3.18', 'console_scripts', 'fuck')()
  File "/usr/lib/python3.6/site-packages/thefuck/not_configured.py", line 80, in main
    elif _is_second_run():
  File "/usr/lib/python3.6/site-packages/thefuck/not_configured.py", line 40, in _is_second_run
    if not tracker_path.exists() or not shell.get_history()[-1] == 'fuck':
IndexError: list index out of range
luca@g550jk ~> thefuck --version
The Fuck 3.18 using Python 3.6.1
luca@g550jk ~> lsb_release -d
Description:    Arch Linux
luca@g550jk ~> echo $SHELL
/usr/bin/fish
luca@g550jk ~> fish --version
fish, version 2.5.0
hacktoberfest

Most helpful comment

The history file for fish is no longer located in .config/fish, It's been moved to .local/share/fish. See this commit.

All 9 comments

The history file for fish is no longer located in .config/fish, It's been moved to .local/share/fish. See this commit.

same error

Fixed in 3.20

Confirmed it's fixed. Thanks, @nvbn

Why does the script add

eval (thefuck --alias | tr '
' ';')

to the fish config when the wiki says something else:

thefuck --alias | source 

?

But yes, adding works again fine.

It should be eval (thefuck --alias | tr '\n' ';') but the \n wasn't escaped. This can be easily fixed.

Are you interested? hint: https://hacktoberfest.digitalocean.com/

@scorphus And what's the reason it's not thefuck --alias | source as it 1. looks nicer and 2. is shorter and works the same way?
And yes, I will do a PR for this :)

Because that nice and short trick of yours didn't occur to me at all! And now, after reading eval's source code more closely, I can see that, in the end, it pipes to source.

Good job!

LGTM 馃憤

Also kudos for the commit message! 馃槈

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pizzathief picture pizzathief  路  6Comments

zixuanweeei picture zixuanweeei  路  5Comments

sbrl picture sbrl  路  3Comments

cuwaters picture cuwaters  路  4Comments

griffinqiu picture griffinqiu  路  4Comments