thefuck icon indicating copy to clipboard operation
thefuck copied to clipboard

fuck takes about 10s to show corrected commands, annoying. why fuck so slow? ubuntu18, pip3 install

Open AstroShen opened this issue 3 years ago • 4 comments

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

FILL THIS IN

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

FILL THIS IN

How to reproduce the bug:

FILL THIS IN

The output of The Fuck with THEFUCK_DEBUG=true exported (typically execute export THEFUCK_DEBUG=true in your shell before The Fuck):

FILL THIS IN

If the bug only appears with a specific application, the output of that application and its version:

FILL THIS IN

Anything else you think is relevant:

FILL THIS IN

AstroShen avatar Sep 05 '21 01:09 AstroShen

Hi! :wave:

I'm sorry that you're having slowness issues with The Fuck.

It may be quite tricky to find out why it's slow. Especially when there's no information whatsoever. Could you please fill in those sections in your message? Please, try and fill as much FILL THIS IN sections as you can. Otherwise there's little chance we can help you.

Worth checking #1036 out, maybe it's the same issue which is addressed in Troubleshooting.

scorphus avatar Sep 05 '21 11:09 scorphus

I'm also experiencing this.

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.31 using Python 3.10.0 and Bash 5.0.17(1)-release

I installed via Homebrew.

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

Ubuntu 20.04.3 LTS running in WSL2 on Windows 11

How to reproduce the bug:

git checkout -b new_branch
git push
fuck

Fuck thinks for about 9 seconds before offering:

git push --no-verify [enter/↑/↓/ctrl+c]

The output of The Fuck with THEFUCK_DEBUG=true exported (typically execute export THEFUCK_DEBUG=true in your shell before The Fuck):

** fuck hangs for ~7 seconds after printing the settings dict, but before printing the next line "Received output" **

tco@bros-gold:~/open/sqlfmt$ git push
fatal: The current branch feature/sc-139/fix-merging-sub-statements has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin feature/sc-139/fix-merging-sub-statements

tco@bros-gold:~/open/sqlfmt$ THEFUCK_DEBUG=true fuck
DEBUG: Run with settings: {'alter_history': True,
 'debug': True,
 'env': {'GIT_TRACE': '1', 'LANG': 'C', 'LC_ALL': 'C'},
 'exclude_rules': [],
 'excluded_search_path_prefixes': [],
 'history_limit': None,
 'instant_mode': False,
 'no_colors': False,
 'num_close_matches': 3,
 'priority': {},
 'repeat': False,
 'require_confirmation': True,
 'rules': [<const: All rules enabled>],
 'slow_commands': ['lein', 'react-native', 'gradle', './gradlew', 'vagrant'],
 'user_dir': PosixPath('/home/tco/.config/thefuck'),
 'wait_command': 3,
 'wait_slow_command': 15}
[[ ~~~~NB: HANGS HERE~~~]]
DEBUG: Received output: 11:32:36.299671 git.c:439               trace: built-in: git push
fatal: The current branch feature/sc-139/fix-merging-sub-statements has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin feature/sc-139/fix-merging-sub-statements


DEBUG: Call: git push; with env: {'THEFUCK_DEBUG': 'true', 'SHELL': '/bin/bash', 'TF_SHELL': 'bash', 'PYENV_SHELL': 'bash', 'WSL_DISTRO_NAME': 'Ubuntu', 'WT_SESSION': '13a1717a-09c5-485e-98ee-c3e739563be6', 'HOMEBREW_PREFIX': '/home/linuxbrew/.linuxbrew', 'HOMEBREW_SHELLENV_PREFIX': '/home/linuxbrew/.linuxbrew', 'NAME': 'bros-gold', 'PWD': '/home/tco/open/sqlfmt', 'LOGNAME': 'tco', 'MANPATH': '/home/linuxbrew/.linuxbrew/share/man:', 'MOTD_SHOWN': 'update-motd', 'HOME': '/home/tco', 'LANG': 'C', 'WSL_INTEROP': '/run/WSL/8_interop', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:', 'WAYLAND_DISPLAY': 'wayland-0', 'TF_ALIAS': 'fuck', 'INFOPATH': '/home/linuxbrew/.linuxbrew/share/info:', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'TERM': 'xterm-256color', 'TF_HISTORY': '\t git commit -m "fix: restore compatibility with py37"\n\t poetry shell\n\t pytest tests/unit_tests/test_merger.py::test_merge_lines_split_by_operators\n\t poetry shell\n\t git push\n\t fuck\n\t THEFUCK_DEBUG=true fuck\n\t git push\n\t fuck\n\t git push', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'USER': 'tco', 'PYTHONIOENCODING': 'utf-8', 'TF_SHELL_ALIASES': 'alias alert=\'notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e \'\\\'\'s/^\\s*[0-9]\\+\\s*//;s/[;&|]\\s*alert$//\'\\\'\')"\'\nalias egrep=\'egrep --color=auto\'\nalias fgrep=\'fgrep --color=auto\'\nalias grep=\'grep --color=auto\'\nalias l=\'ls -CF\'\nalias la=\'ls -A\'\nalias ll=\'ls -alF\'\nalias ls=\'ls --color=auto\'', 'HOMEBREW_CELLAR': '/home/linuxbrew/.linuxbrew/Cellar', 'DISPLAY': ':0', 'SHLVL': '1', 'HOMEBREW_REPOSITORY': '/home/linuxbrew/.linuxbrew/Homebrew', 'XDG_RUNTIME_DIR': '/mnt/wslg/runtime-dir', 'PYENV_ROOT': '/home/tco/.pyenv', 'WSLENV': 'WT_SESSION::WT_PROFILE_ID', 'XDG_DATA_DIRS': '/usr/local/share:/usr/share:/var/lib/snapd/desktop', 'PATH': '/home/tco/.pyenv/shims:/home/tco/.pyenv/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/tco/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/windows/system32:/mnt/c/windows:/mnt/c/windows/System32/Wbem:/mnt/c/windows/System32/WindowsPowerShell/v1.0/:/mnt/c/windows/System32/OpenSSH/:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/ProgramData/DockerDesktop/version-bin:/mnt/c/Users/tedco/.poetry/bin:/mnt/c/Users/tedco/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/tedco/AppData/Local/Programs/Microsoft VS Code/bin:/snap/bin', 'HOSTTYPE': 'x86_64', 'PULSE_SERVER': '/mnt/wslg/PulseServer', 'WT_PROFILE_ID': '{2c4de342-38b7-51cf-b940-2309a097f518}', 'OLDPWD': '/home/tco', '_': '/home/linuxbrew/.linuxbrew/bin/thefuck', 'LC_ALL': 'C', 'GIT_TRACE': '1'}; is slow: False took: 0:00:00.002546
DEBUG: Importing rule: adb_unknown_command; took: 0:00:00.000221
DEBUG: Importing rule: ag_literal; took: 0:00:00.000259
DEBUG: Importing rule: apt_get; took: 0:00:00.000846
DEBUG: Importing rule: apt_get_search; took: 0:00:00.000313
DEBUG: Importing rule: apt_invalid_operation; took: 0:00:00.000325
DEBUG: Importing rule: apt_list_upgradable; took: 0:00:00.000147
DEBUG: Importing rule: apt_upgrade; took: 0:00:00.000372
DEBUG: Importing rule: aws_cli; took: 0:00:00.000184
DEBUG: Importing rule: az_cli; took: 0:00:00.000154
DEBUG: Importing rule: brew_cask_dependency; took: 0:00:00.000421
DEBUG: Importing rule: brew_install; took: 0:00:00.000125
DEBUG: Importing rule: brew_link; took: 0:00:00.000154
DEBUG: Importing rule: brew_reinstall; took: 0:00:00.000383
DEBUG: Importing rule: brew_uninstall; took: 0:00:00.000151
DEBUG: Importing rule: brew_unknown_command; took: 0:00:00.000127
DEBUG: Importing rule: brew_update_formula; took: 0:00:00.000152
DEBUG: Importing rule: cargo; took: 0:00:00.000097
DEBUG: Importing rule: cargo_no_command; took: 0:00:00.000144
DEBUG: Importing rule: cat_dir; took: 0:00:00.000141
DEBUG: Importing rule: cd_correction; took: 0:00:00.000511
DEBUG: Importing rule: cd_cs; took: 0:00:00.000093
DEBUG: Importing rule: cd_mkdir; took: 0:00:00.000219
DEBUG: Importing rule: cd_parent; took: 0:00:00.000110
DEBUG: Importing rule: chmod_x; took: 0:00:00.000101
DEBUG: Importing rule: choco_install; took: 0:00:00.069614
DEBUG: Importing rule: composer_not_command; took: 0:00:00.000406
DEBUG: Importing rule: conda_mistype; took: 0:00:00.000403
DEBUG: Importing rule: cp_create_destination; took: 0:00:00.000224
DEBUG: Importing rule: cp_omitting_directory; took: 0:00:00.000263
DEBUG: Importing rule: cpp11; took: 0:00:00.000148
DEBUG: Importing rule: dirty_untar; took: 0:00:00.001321
DEBUG: Importing rule: dirty_unzip; took: 0:00:00.001087
DEBUG: Importing rule: django_south_ghost; took: 0:00:00.000144
DEBUG: Importing rule: django_south_merge; took: 0:00:00.000132
DEBUG: Importing rule: dnf_no_such_command; took: 0:00:00.039740
DEBUG: Importing rule: docker_image_being_used_by_container; took: 0:00:00.000250
DEBUG: Importing rule: docker_login; took: 0:00:00.000169
DEBUG: Importing rule: docker_not_command; took: 0:00:00.049702
DEBUG: Importing rule: dry; took: 0:00:00.000186
DEBUG: Importing rule: fab_command_not_found; took: 0:00:00.000265
DEBUG: Importing rule: fix_alt_space; took: 0:00:00.000244
DEBUG: Importing rule: fix_file; took: 0:00:00.001960
DEBUG: Importing rule: gem_unknown_command; took: 0:00:00.000302
DEBUG: Importing rule: git_add; took: 0:00:00.000379
DEBUG: Importing rule: git_add_force; took: 0:00:00.000158
DEBUG: Importing rule: git_bisect_usage; took: 0:00:00.000180
DEBUG: Importing rule: git_branch_delete; took: 0:00:00.000148
DEBUG: Importing rule: git_branch_delete_checked_out; took: 0:00:00.000175
DEBUG: Importing rule: git_branch_exists; took: 0:00:00.000153
DEBUG: Importing rule: git_branch_list; took: 0:00:00.000130
DEBUG: Importing rule: git_checkout; took: 0:00:00.000128
DEBUG: Importing rule: git_clone_git_clone; took: 0:00:00.000120
DEBUG: Importing rule: git_commit_amend; took: 0:00:00.000109
DEBUG: Importing rule: git_commit_reset; took: 0:00:00.000121
DEBUG: Importing rule: git_diff_no_index; took: 0:00:00.000115
DEBUG: Importing rule: git_diff_staged; took: 0:00:00.000166
DEBUG: Importing rule: git_fix_stash; took: 0:00:00.000147
DEBUG: Importing rule: git_flag_after_filename; took: 0:00:00.000145
DEBUG: Importing rule: git_help_aliased; took: 0:00:00.000111
DEBUG: Importing rule: git_hook_bypass; took: 0:00:00.000115
DEBUG: Importing rule: git_lfs_mistype; took: 0:00:00.000149
DEBUG: Importing rule: git_merge; took: 0:00:00.000127
DEBUG: Importing rule: git_merge_unrelated; took: 0:00:00.000141
DEBUG: Importing rule: git_not_command; took: 0:00:00.000171
DEBUG: Importing rule: git_pull; took: 0:00:00.000115
DEBUG: Importing rule: git_pull_clone; took: 0:00:00.000124
DEBUG: Importing rule: git_pull_uncommitted_changes; took: 0:00:00.000163
DEBUG: Importing rule: git_push; took: 0:00:00.000144
DEBUG: Importing rule: git_push_different_branch_names; took: 0:00:00.000140
DEBUG: Importing rule: git_push_force; took: 0:00:00.000129
DEBUG: Importing rule: git_push_pull; took: 0:00:00.000108
DEBUG: Importing rule: git_push_without_commits; took: 0:00:00.000291
DEBUG: Importing rule: git_rebase_merge_dir; took: 0:00:00.000120
DEBUG: Importing rule: git_rebase_no_changes; took: 0:00:00.000183
DEBUG: Importing rule: git_remote_delete; took: 0:00:00.000135
DEBUG: Importing rule: git_remote_seturl_add; took: 0:00:00.000098
DEBUG: Importing rule: git_rm_local_modifications; took: 0:00:00.000134
DEBUG: Importing rule: git_rm_recursive; took: 0:00:00.000223
DEBUG: Importing rule: git_rm_staged; took: 0:00:00.000127
DEBUG: Importing rule: git_stash; took: 0:00:00.000141
DEBUG: Importing rule: git_stash_pop; took: 0:00:00.000129
DEBUG: Importing rule: git_tag_force; took: 0:00:00.000136
DEBUG: Importing rule: git_two_dashes; took: 0:00:00.000145
DEBUG: Importing rule: go_run; took: 0:00:00.000140
DEBUG: Importing rule: go_unknown_command; took: 0:00:00.040680
DEBUG: Importing rule: gradle_no_task; took: 0:00:00.000687
DEBUG: Importing rule: gradle_wrapper; took: 0:00:00.000348
DEBUG: Importing rule: grep_arguments_order; took: 0:00:00.000186
DEBUG: Importing rule: grep_recursive; took: 0:00:00.000226
DEBUG: Importing rule: grunt_task_not_found; took: 0:00:00.000304
DEBUG: Importing rule: gulp_not_task; took: 0:00:00.000169
DEBUG: Importing rule: has_exists_script; took: 0:00:00.000195
DEBUG: Importing rule: heroku_multiple_apps; took: 0:00:00.000195
DEBUG: Importing rule: heroku_not_command; took: 0:00:00.000170
DEBUG: Importing rule: history; took: 0:00:00.000096
DEBUG: Importing rule: hostscli; took: 0:00:00.000214
DEBUG: Importing rule: ifconfig_device_not_found; took: 0:00:00.000198
DEBUG: Importing rule: java; took: 0:00:00.000164
DEBUG: Importing rule: javac; took: 0:00:00.000155
DEBUG: Importing rule: lein_not_task; took: 0:00:00.000166
DEBUG: Importing rule: ln_no_hard_link; took: 0:00:00.000131
DEBUG: Importing rule: ln_s_order; took: 0:00:00.000178
DEBUG: Importing rule: long_form_help; took: 0:00:00.000098
DEBUG: Importing rule: ls_all; took: 0:00:00.000212
DEBUG: Importing rule: ls_lah; took: 0:00:00.000130
DEBUG: Importing rule: man; took: 0:00:00.000165
DEBUG: Importing rule: man_no_space; took: 0:00:00.000095
DEBUG: Importing rule: mercurial; took: 0:00:00.000124
DEBUG: Importing rule: missing_space_before_subcommand; took: 0:00:00.000093
DEBUG: Importing rule: mkdir_p; took: 0:00:00.000134
DEBUG: Importing rule: mvn_no_command; took: 0:00:00.000154
DEBUG: Importing rule: mvn_unknown_lifecycle_phase; took: 0:00:00.000180
DEBUG: Importing rule: nixos_cmd_not_found; took: 0:00:00.040774
DEBUG: Importing rule: no_command; took: 0:00:00.000359
DEBUG: Importing rule: no_such_file; took: 0:00:00.000140
DEBUG: Importing rule: npm_missing_script; took: 0:00:00.000383
DEBUG: Importing rule: npm_run_script; took: 0:00:00.000196
DEBUG: Importing rule: npm_wrong_command; took: 0:00:00.000265
DEBUG: Importing rule: omnienv_no_such_command; took: 0:00:00.058200
DEBUG: Importing rule: open; took: 0:00:00.000554
DEBUG: Importing rule: pacman; took: 0:00:00.112514
DEBUG: Importing rule: pacman_invalid_option; took: 0:00:00.000408
DEBUG: Importing rule: pacman_not_found; took: 0:00:00.000158
DEBUG: Importing rule: path_from_history; took: 0:00:00.000186
DEBUG: Importing rule: php_s; took: 0:00:00.000203
DEBUG: Importing rule: pip_install; took: 0:00:00.000242
DEBUG: Importing rule: pip_unknown_command; took: 0:00:00.000185
DEBUG: Importing rule: port_already_in_use; took: 0:00:00.000229
DEBUG: Importing rule: prove_recursively; took: 0:00:00.000239
DEBUG: Importing rule: python_command; took: 0:00:00.000163
DEBUG: Importing rule: python_execute; took: 0:00:00.000147
DEBUG: Importing rule: python_module_error; took: 0:00:00.000108
DEBUG: Importing rule: quotation_marks; took: 0:00:00.000122
DEBUG: Importing rule: react_native_command_unrecognized; took: 0:00:00.000234
DEBUG: Importing rule: remove_shell_prompt_literal; took: 0:00:00.000106
DEBUG: Importing rule: remove_trailing_cedilla; took: 0:00:00.000100
DEBUG: Importing rule: rm_dir; took: 0:00:00.000183
DEBUG: Importing rule: rm_root; took: 0:00:00.000165
DEBUG: Importing rule: scm_correction; took: 0:00:00.000373
DEBUG: Importing rule: sed_unterminated_s; took: 0:00:00.000148
DEBUG: Importing rule: sl_ls; took: 0:00:00.000106
DEBUG: Importing rule: ssh_known_hosts; took: 0:00:00.000182
DEBUG: Importing rule: sudo; took: 0:00:00.000117
DEBUG: Importing rule: sudo_command_from_user_path; took: 0:00:00.000207
DEBUG: Importing rule: switch_lang; took: 0:00:00.000188
DEBUG: Importing rule: systemctl; took: 0:00:00.000202
DEBUG: Importing rule: terraform_init; took: 0:00:00.000151
DEBUG: Importing rule: test.py; took: 0:00:00.000066
DEBUG: Importing rule: tmux; took: 0:00:00.000158
DEBUG: Importing rule: touch; took: 0:00:00.000147
DEBUG: Importing rule: tsuru_login; took: 0:00:00.000153
DEBUG: Importing rule: tsuru_not_command; took: 0:00:00.000182
DEBUG: Importing rule: unknown_command; took: 0:00:00.000133
DEBUG: Importing rule: unsudo; took: 0:00:00.000126
DEBUG: Importing rule: vagrant_up; took: 0:00:00.000194
DEBUG: Importing rule: whois; took: 0:00:00.000321
DEBUG: Importing rule: workon_doesnt_exists; took: 0:00:00.000255
DEBUG: Importing rule: yarn_alias; took: 0:00:00.000244
DEBUG: Importing rule: yarn_command_not_found; took: 0:00:00.043336
DEBUG: Importing rule: yarn_command_replaced; took: 0:00:00.000466
DEBUG: Importing rule: yarn_help; took: 0:00:00.000252
DEBUG: Importing rule: yum_invalid_operation; took: 0:00:00.042513
DEBUG: Trying rule: path_from_history; took: 0:00:00.000566
DEBUG: Trying rule: cd_cs; took: 0:00:00.000047
DEBUG: Trying rule: dry; took: 0:00:00.000002
DEBUG: Trying rule: git_hook_bypass; took: 0:00:00.000087
git push --no-verify [enter/↑/↓/ctrl+c]
Aborted
DEBUG: Total took: 0:00:12.891838

tconbeer avatar Dec 10 '21 18:12 tconbeer

Worth checking #1036 out, maybe it's the same issue which is addressed in Troubleshooting.

scorphus avatar Dec 19 '21 20:12 scorphus

Not OP, but confirming that excluding the /mnt/ search path worked for me. Thanks -- didn't see the Troubleshooting page

tconbeer avatar Dec 20 '21 15:12 tconbeer