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

exception while "run fuck second time for configuring it automatically." #658

Closed
z3ntu opened this issue Jun 8, 2017 · 9 comments
Closed

Comments

@z3ntu
Copy link
Contributor

z3ntu commented Jun 8, 2017

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
@MelvIsntNormal
Copy link

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

@babakness
Copy link

same error

@nvbn
Copy link
Owner

nvbn commented Aug 16, 2017

Fixed in 3.20

@scorphus
Copy link
Collaborator

scorphus commented Oct 4, 2017

Confirmed it's fixed. Thanks, @nvbn

@z3ntu
Copy link
Contributor Author

z3ntu commented Oct 4, 2017

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.

@scorphus
Copy link
Collaborator

scorphus commented Oct 4, 2017

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/

@z3ntu
Copy link
Contributor Author

z3ntu commented Oct 5, 2017

@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 :)

@scorphus
Copy link
Collaborator

scorphus commented Oct 6, 2017

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 👍

@scorphus
Copy link
Collaborator

scorphus commented Oct 6, 2017

Also kudos for the commit message! 😉

@nvbn nvbn closed this as completed in #704 Oct 8, 2017
nvbn added a commit that referenced this issue Oct 8, 2017
#658: Change configuration code for fish shell
riley-martine pushed a commit to riley-martine/thefuck that referenced this issue Dec 7, 2023
riley-martine pushed a commit to riley-martine/thefuck that referenced this issue Dec 7, 2023
riley-martine pushed a commit to riley-martine/thefuck that referenced this issue Dec 7, 2023
nvbn#658: Change configuration code for fish shell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants