nvbn / thefuck

Magnificent app which corrects your previous console command.
MIT License
84.95k stars 3.43k forks source link

Last history contained "\", and get fatal error #1392

Closed badcast closed 1 year ago

badcast commented 1 year ago

The output of thefuck --version (something like The Fuck 3.1 using Python 3.5.0 and Bash 4.4.12(1)-release):

The Fuck 3.32 using Python 3.11.3 and ZSH 5.9

Your system (Debian 7, ArchLinux, Windows, etc.):

ArchLinux

How to reproduce the bug:

bug on command

any command in Linux with \ 

for example

git commut -a -m "commit message"  \ <-- last on position 

next the fuck: fuck

Traceback (most recent call last):
  File "/usr/bin/thefuck", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/thefuck/entrypoints/main.py", line 31, in main
    fix_command(known_args)
  File "/usr/lib/python3.11/site-packages/thefuck/entrypoints/fix_command.py", line 37, in fix_command
    command = types.Command.from_raw_script(raw_command)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/thefuck/types.py", line 82, in from_raw_script
    output = get_output(script, expanded)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/thefuck/output_readers/__init__.py", line 20, in get_output
    return rerun.get_output(script, expanded)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/thefuck/output_readers/rerun.py", line 66, in get_output
    if _wait_output(result, is_slow):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/thefuck/output_readers/rerun.py", line 36, in _wait_output
    proc.wait(settings.wait_slow_command if is_slow
  File "/usr/lib/python3.11/site-packages/psutil/__init__.py", line 1270, in wait
    self._exitcode = self._proc.wait(timeout)
                     ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/psutil/_pslinux.py", line 1653, in wrapper
    return fun(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/psutil/_pslinux.py", line 1859, in wait
    return _psposix.wait_pid(self.pid, timeout, self._name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/psutil/_psposix.py", line 137, in wait_pid
    interval = sleep(interval)
               ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/psutil/_psposix.py", line 115, in sleep
    _sleep(interval)
KeyboardInterrupt
Rom1deTroyes commented 1 year ago

Not replicable on my Debian 11 box : note that I pressed Enter a second time after first line, to get the command executed.

❯ git commut -a -m "commit message"  \
> 
git : 'commut' n'est pas une commande git. Voir 'git --help'.

La commande la plus ressemblante est
    commit
❯ fuck
git commit -a -m "commit message"  \\n [enter/↑/↓/ctrl+c]

❯ fuck --version
The Fuck 3.31 using Python 3.9.2 and ZSH 5.8

And same thing after upgrading thefuck :

❯ fuck --version
The Fuck 3.32 using Python 3.9.2 and ZSH 5.8
❯ git commut -a -m "commit message"  \

git : 'commut' n'est pas une commande git. Voir 'git --help'.

La commande la plus ressemblante est
    commit
❯ fuck
git commit -a -m "commit message"  \\n [enter/↑/↓/ctrl+c]
badcast commented 1 year ago

Hi! The problem is solved in the new version. I'm fine now. Issue resolved in The Fuck 3.32 using Python 3.11.5 and ZSH 5.9