Repository: thefuck
Issue: Commands with variable definition are not matched by most rules
Labels: enhancement,help wanted,hacktoberfest,HackIllinois

I have tried using Kitty Terminal Emulator and Termite Terminal Emulator. Both of these modify the terminfo significantly, and therefore SSH necessitates creating an alias to maintain full terminal functionality when ssh'ing into servers that don't have these terminal emulators installed. For both terminal emulators, a simple alias for `alias ssh=TERM='xterm-256color' ssh` sets the terminal type such that you get color support. But Kitty additionally has a special feature to make the terminal even smarter over SSH. Whenever I define any of there ssh-aliases, the `ssh_known_hosts` rule stops functioning.

<!-- If you have any issue with The Fuck, sorry about that, but we will do what we
can to fix that. Actually, maybe we already have, so first thing to do is to
update The Fuck and see if the bug is still there. -->

<!-- If it is (sorry again), check if the problem has not already been reported and
if not, just open an issue on [GitHub](https://github.com/nvbn/thefuck) with
the following basic information: -->

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.30 using Python 3.9.2 and ZSH 5.8

Your system (Debian 7, ArchLinux, Windows, etc.):

    Manjaro Linux, Kitty Terminal Emulator, zsh

How to reproduce the bug:

1. Create an alias for `ssh`. I created the recommended ssh alias for kitty: `alias ssh=kitty +kitten ssh`. But also saw the same problem with a simpler fallback alias for ssh: `alias ssh=TERM='xterm-256color' ssh` which should work in any terminal emulator.
2. SSH to a server where the host key has changed.
3. Receive the "REMOTE HOST IDENTIFICATION HAS CHANGED!" warning.
4. Run `fuck`.
5. `ssh_known_hosts` doesn't match, and thefuck instead simply recommends the exact same ssh command I just typed, without any side-effect.

If I remove the alias, then `ssh_known_hosts` starts working as expected again.

The output of The Fuck with `THEFUCK_DEBUG=true` exported (typically execute `export THEFUCK_DEBUG=true` in your shell before The Fuck):

    DEBUG: Run with settings: {'alter_history': True,
    'debug': True,
    'env': {'GIT_TRACE': '1', 'LANG': 'C', 'LC_ALL': 'C'},
    'exclude_rules': [],
    '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/frederiknjs/.config/thefuck'),
    'wait_command': 3,
    'wait_slow_command': 15}
    DEBUG: Received output: Pseudo-terminal will not be allocated because stdin is not a terminal.
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
    Someone could be eavesdropping on you right now (man-in-the-middle attack)!
    It is also possible that a host key has just been changed.
    The fingerprint for the ECDSA key sent by the remote host is
    SHA256:<REDACTED>.
    Please contact your system administrator.
    Add correct host key in /home/frederiknjs/.ssh/known_hosts to get rid of this message.
    Offending ECDSA key in /home/frederiknjs/.ssh/known_hosts:162
    ECDSA host key for <REDACTED> has changed and you have requested strict checking.
    Host key verification failed.

    DEBUG: Call: ssh fns@<REDACTED>; with env: {'SHELL': '/bin/zsh', 'XDG_SESSION_PATH': '/org/freedesktop/DisplayManager/Session0', 'I3SOCK': '/run/user/1000/i3/ipc-socket.1992', 'LC_ADDRESS': 'en_DK.UTF-8', 'LC_NAME': 'en_DK.UTF-8', 'SSH_AUTH_SOCK': '/run/user/1000/ssh-agent.socket', 'DESKTOP_SESSION': 'i3', 'LC_MONETARY': 'en_DK.UTF-8', 'EDITOR': 'nano', 'GTK_MODULES': 'canberra-gtk-module', 'XDG_SEAT': 'seat0', 'PWD': '/home/frederiknjs', 'LOGNAME': 'frederiknjs', 'XDG_SESSION_DESKTOP': 'i3', 'QT_QPA_PLATFORMTHEME': 'qt5ct', 'XDG_SESSION_TYPE': 'x11', 'XAUTHORITY': '/home/frederiknjs/.Xauthority', 'DESKTOP_STARTUP_ID': 'i3/kitty/1992-97-frederiknjs-pc_TIME197808711', 'XDG_GREETER_DATA_DIR': '/var/lib/lightdm-data/frederiknjs', 'MOTD_SHOWN': 'pam', 'GTK2_RC_FILES': '/home/frederiknjs/.gtkrc-2.0', 'HOME': '/home/frederiknjs', 'LC_PAPER': 'en_DK.UTF-8', 'LANG': 'C', 'XDG_CURRENT_DESKTOP': 'i3', 'XDG_SEAT_PATH': '/org/freedesktop/DisplayManager/Seat0', 'XDG_SESSION_CLASS': 'user', 'LC_IDENTIFICATION': 'en_DK.UTF-8', 'USER': 'frederiknjs', 'DISPLAY': ':0', 'SHLVL': '1', 'LC_TELEPHONE': 'en_DK.UTF-8', 'LC_MEASUREMENT': 'en_DK.UTF-8', 'XDG_VTNR': '7', 'XDG_SESSION_ID': '2', 'MSF_DATABASE_CONFIG': '/home/frederiknjs/.msf4/database.yml', 'XDG_RUNTIME_DIR': '/run/user/1000', 'LC_TIME': 'en_DK.UTF-8', 'XDG_DATA_DIRS': '/home/frederiknjs/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop', 'BROWSER': '/usr/bin/palemoon', 'PATH': '/home/frederiknjs/.rvm/gems/ruby-2.6.3/bin:/home/frederiknjs/.rvm/gems/ruby-2.6.3@global/bin:/home/frederiknjs/.rvm/rubies/ruby-2.6.3/bin:/home/frederiknjs/.asdf/shims:/home/frederiknjs/.asdf/bin:/home/frederiknjs/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin:/home/frederiknjs/code/siteimprove/coreinfra-scripts:/var/lib/snapd/snap/bin:/home/frederiknjs/.local/bin:/home/frederiknjs/.cargo/bin:/home/frederiknjs/code/go/bin:/home/frederiknjs/.krew/bin:/home/frederiknjs/.local/opt/android-sdk/platform-tools:/home/frederiknjs/.local/opt/android-sdk/tools:/home/frederiknjs/.yarn/bin:/home/frederiknjs/.rvm/bin', 'GDMSESSION': 'i3', 'DBUS_SESSION_BUS_ADDRESS': 'unix:path=/run/user/1000/bus', 'MAIL': '/var/spool/mail/frederiknjs', 'LC_NUMERIC': 'en_DK.UTF-8', '_': '/usr/bin/thefuck', 'KITTY_WINDOW_ID': '1', 'WINDOWID': '106954766', 'TERM': 'xterm-kitty', 'COLORTERM': 'truecolor', 'TERMINFO': '/usr/lib/kitty/terminfo', 'OLDPWD': '/home/frederiknjs', 'P9K_TTY': 'old', '_P9K_TTY': '/dev/pts/0', 'ASDF_DIR': '/home/frederiknjs/.asdf', 'XDG_CACHE_HOME': '/home/frederiknjs/.cache', 'GOPATH': '/home/frederiknjs/code/go', 'AWS_PROFILE': 'default', 'FIREFOX_DEVELOPER_BIN': '/opt/firefox-dev/firefox', 'MOZ_USE_XINPUT2': '1', 'WORDCHARS': '*?_[]~=&;!#$%^(){}<>', 'P9K_SSH': '0', 'rvm_prefix': '/home/frederiknjs', 'rvm_path': '/home/frederiknjs/.rvm', 'rvm_bin_path': '/home/frederiknjs/.rvm/bin', 'rvm_version': '1.29.9 (latest)', 'GEM_HOME': '/home/frederiknjs/.rvm/gems/ruby-2.6.3', 'GEM_PATH': '/home/frederiknjs/.rvm/gems/ruby-2.6.3:/home/frederiknjs/.rvm/gems/ruby-2.6.3@global', 'MY_RUBY_HOME': '/home/frederiknjs/.rvm/rubies/ruby-2.6.3', 'IRBRC': '/home/frederiknjs/.rvm/rubies/ruby-2.6.3/.irbrc', 'RUBY_VERSION': 'ruby-2.6.3', 'TF_SHELL': 'zsh', 'TF_ALIAS': 'fuck', 'TF_SHELL_ALIASES': "_cnf_print='echo -e 1>&2'\n_complete=_bash_comp\n_expand=_bash_expand\narst=asdf\nconfig='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'\nhistory='fc -l 1'\nmktmp='cd $(mktemp -d)'\nrun-help=man\nrvm-restart='rvm_reload_flag=1 source '\\''/home/frederiknjs/.rvm/scripts/rvm'\\'\nshopt=:\nssh='kitty +kitten ssh'\ntmp='cd $(mktemp -d)'\nwhich-command=whence", 'PYTHONIOENCODING': 'utf-8', 'THEFUCK_DEBUG': 'true', 'TF_HISTORY': 'ssh fns@<REDACTED>\ncode --new-window\nnano .zshrc\nthefuck --version\nkitty --help\nkitty --version\nwhich ssh\nfuck\nexport THEFUCK_DEBUG=true\nssh fns@<REDACTED>', 'LC_ALL': 'C', 'GIT_TRACE': '1'}; is slow: False took: 0:00:00.215601
    DEBUG: Importing rule: adb_unknown_command; took: 0:00:00.000892
    DEBUG: Importing rule: ag_literal; took: 0:00:00.001865
    DEBUG: Importing rule: apt_get; took: 0:00:00.003070
    DEBUG: Importing rule: apt_get_search; took: 0:00:00.001221
    DEBUG: Importing rule: apt_invalid_operation; took: 0:00:00.003231
    DEBUG: Importing rule: apt_list_upgradable; took: 0:00:00.001760
    DEBUG: Importing rule: apt_upgrade; took: 0:00:00.002260
    DEBUG: Importing rule: aws_cli; took: 0:00:00.001192
    DEBUG: Importing rule: az_cli; took: 0:00:00.001184
    DEBUG: Importing rule: brew_cask_dependency; took: 0:00:00.002747
    DEBUG: Importing rule: brew_install; took: 0:00:00.000542
    DEBUG: Importing rule: brew_link; took: 0:00:00.001304
    DEBUG: Importing rule: brew_reinstall; took: 0:00:00.002155
    DEBUG: Importing rule: brew_uninstall; took: 0:00:00.001128
    DEBUG: Importing rule: brew_unknown_command; took: 0:00:00.000536
    DEBUG: Importing rule: brew_update_formula; took: 0:00:00.001076
    DEBUG: Importing rule: cargo; took: 0:00:00.000488
    DEBUG: Importing rule: cargo_no_command; took: 0:00:00.001091
    DEBUG: Importing rule: cat_dir; took: 0:00:00.001082
    DEBUG: Importing rule: cd_correction; took: 0:00:00.004140
    DEBUG: Importing rule: cd_mkdir; took: 0:00:00.001718
    DEBUG: Importing rule: cd_parent; took: 0:00:00.000500
    DEBUG: Importing rule: chmod_x; took: 0:00:00.000493
    DEBUG: Importing rule: choco_install; took: 0:00:00.002440
    DEBUG: Importing rule: composer_not_command; took: 0:00:00.001218
    DEBUG: Importing rule: cp_create_destination; took: 0:00:00.001111
    DEBUG: Importing rule: cp_omitting_directory; took: 0:00:00.001694
    DEBUG: Importing rule: cpp11; took: 0:00:00.001131
    DEBUG: Importing rule: dirty_untar; took: 0:00:00.004224
    DEBUG: Importing rule: dirty_unzip; took: 0:00:00.004193
    DEBUG: Importing rule: django_south_ghost; took: 0:00:00.000557
    DEBUG: Importing rule: django_south_merge; took: 0:00:00.000409
    DEBUG: Importing rule: dnf_no_such_command; took: 0:00:00.003438
    DEBUG: Importing rule: docker_image_being_used_by_container; took: 0:00:00.001109
    DEBUG: Importing rule: docker_login; took: 0:00:00.001132
    DEBUG: Importing rule: docker_not_command; took: 0:00:00.002131
    DEBUG: Importing rule: dry; took: 0:00:00.000477
    DEBUG: Importing rule: fab_command_not_found; took: 0:00:00.001430
    DEBUG: Importing rule: fix_alt_space; took: 0:00:00.001155
    DEBUG: Importing rule: fix_file; took: 0:00:00.007502
    DEBUG: Importing rule: gem_unknown_command; took: 0:00:00.001711
    DEBUG: Importing rule: git_add; took: 0:00:00.002192
    DEBUG: Importing rule: git_add_force; took: 0:00:00.001084
    DEBUG: Importing rule: git_bisect_usage; took: 0:00:00.001047
    DEBUG: Importing rule: git_branch_delete; took: 0:00:00.001025
    DEBUG: Importing rule: git_branch_delete_checked_out; took: 0:00:00.001084
    DEBUG: Importing rule: git_branch_exists; took: 0:00:00.001360
    DEBUG: Importing rule: git_branch_list; took: 0:00:00.001564
    DEBUG: Importing rule: git_checkout; took: 0:00:00.001494
    DEBUG: Importing rule: git_commit_amend; took: 0:00:00.001078
    DEBUG: Importing rule: git_commit_reset; took: 0:00:00.001078
    DEBUG: Importing rule: git_diff_no_index; took: 0:00:00.001041
    DEBUG: Importing rule: git_diff_staged; took: 0:00:00.001035
    DEBUG: Importing rule: git_fix_stash; took: 0:00:00.001349
    DEBUG: Importing rule: git_flag_after_filename; took: 0:00:00.001063
    DEBUG: Importing rule: git_help_aliased; took: 0:00:00.001050
    DEBUG: Importing rule: git_merge; took: 0:00:00.001019
    DEBUG: Importing rule: git_merge_unrelated; took: 0:00:00.001003
    DEBUG: Importing rule: git_not_command; took: 0:00:00.001124
    DEBUG: Importing rule: git_pull; took: 0:00:00.001154
    DEBUG: Importing rule: git_pull_clone; took: 0:00:00.001415
    DEBUG: Importing rule: git_pull_uncommitted_changes; took: 0:00:00.000776
    DEBUG: Importing rule: git_push; took: 0:00:00.000731
    DEBUG: Importing rule: git_push_different_branch_names; took: 0:00:00.000688
    DEBUG: Importing rule: git_push_force; took: 0:00:00.000728
    DEBUG: Importing rule: git_push_pull; took: 0:00:00.000832
    DEBUG: Importing rule: git_push_without_commits; took: 0:00:00.000813
    DEBUG: Importing rule: git_rebase_merge_dir; took: 0:00:00.000715
    DEBUG: Importing rule: git_rebase_no_changes; took: 0:00:00.000500
    DEBUG: Importing rule: git_remote_delete; took: 0:00:00.000843
    DEBUG: Importing rule: git_remote_seturl_add; took: 0:00:00.000534
    DEBUG: Importing rule: git_rm_local_modifications; took: 0:00:00.000666
    DEBUG: Importing rule: git_rm_recursive; took: 0:00:00.000616
    DEBUG: Importing rule: git_rm_staged; took: 0:00:00.000584
    DEBUG: Importing rule: git_stash; took: 0:00:00.000533
    DEBUG: Importing rule: git_stash_pop; took: 0:00:00.000516
    DEBUG: Importing rule: git_tag_force; took: 0:00:00.000520
    DEBUG: Importing rule: git_two_dashes; took: 0:00:00.000516
    DEBUG: Importing rule: go_run; took: 0:00:00.000546
    DEBUG: Importing rule: go_unknown_command; took: 0:00:00.000859
    DEBUG: Importing rule: gradle_no_task; took: 0:00:00.001015
    DEBUG: Importing rule: gradle_wrapper; took: 0:00:00.000725
    DEBUG: Importing rule: grep_arguments_order; took: 0:00:00.000608
    DEBUG: Importing rule: grep_recursive; took: 0:00:00.000651
    DEBUG: Importing rule: grunt_task_not_found; took: 0:00:00.000835
    DEBUG: Importing rule: gulp_not_task; took: 0:00:00.000467
    DEBUG: Importing rule: has_exists_script; took: 0:00:00.000428
    DEBUG: Importing rule: heroku_multiple_apps; took: 0:00:00.000440
    DEBUG: Importing rule: heroku_not_command; took: 0:00:00.000469
    DEBUG: Importing rule: history; took: 0:00:00.000179
    DEBUG: Importing rule: hostscli; took: 0:00:00.001329
    DEBUG: Importing rule: ifconfig_device_not_found; took: 0:00:00.000568
    DEBUG: Importing rule: java; took: 0:00:00.000444
    DEBUG: Importing rule: javac; took: 0:00:00.000463
    DEBUG: Importing rule: lein_not_task; took: 0:00:00.000683
    DEBUG: Importing rule: ln_no_hard_link; took: 0:00:00.000424
    DEBUG: Importing rule: ln_s_order; took: 0:00:00.000424
    DEBUG: Importing rule: long_form_help; took: 0:00:00.000177
    DEBUG: Importing rule: ls_all; took: 0:00:00.000458
    DEBUG: Importing rule: ls_lah; took: 0:00:00.000438
    DEBUG: Importing rule: man; took: 0:00:00.000449
    DEBUG: Importing rule: man_no_space; took: 0:00:00.000156
    DEBUG: Importing rule: mercurial; took: 0:00:00.000400
    DEBUG: Importing rule: missing_space_before_subcommand; took: 0:00:00.000176
    DEBUG: Importing rule: mkdir_p; took: 0:00:00.000396
    DEBUG: Importing rule: mvn_no_command; took: 0:00:00.000411
    DEBUG: Importing rule: mvn_unknown_lifecycle_phase; took: 0:00:00.000412
    DEBUG: Importing rule: nixos_cmd_not_found; took: 0:00:00.000747
    DEBUG: Importing rule: no_command; took: 0:00:00.000426
    DEBUG: Importing rule: no_such_file; took: 0:00:00.000168
    DEBUG: Importing rule: npm_missing_script; took: 0:00:00.000900
    DEBUG: Importing rule: npm_run_script; took: 0:00:00.000484
    DEBUG: Importing rule: npm_wrong_command; took: 0:00:00.000644
    DEBUG: Importing rule: open; took: 0:00:00.000563
    DEBUG: Importing rule: pacman; took: 0:00:00.000709
    DEBUG: Importing rule: pacman_not_found; took: 0:00:00.000172
    DEBUG: Importing rule: path_from_history; took: 0:00:00.000195
    DEBUG: Importing rule: php_s; took: 0:00:00.000428
    DEBUG: Importing rule: pip_install; took: 0:00:00.000516
    DEBUG: Importing rule: pip_unknown_command; took: 0:00:00.000513
    DEBUG: Importing rule: port_already_in_use; took: 0:00:00.000336
    DEBUG: Importing rule: prove_recursively; took: 0:00:00.000430
    DEBUG: Importing rule: pyenv_no_such_command; took: 0:00:00.000834
    DEBUG: Importing rule: python_command; took: 0:00:00.000394
    DEBUG: Importing rule: python_execute; took: 0:00:00.000410
    DEBUG: Importing rule: quotation_marks; took: 0:00:00.000155
    DEBUG: Importing rule: react_native_command_unrecognized; took: 0:00:00.000507
    DEBUG: Importing rule: remove_shell_prompt_literal; took: 0:00:00.000163
    DEBUG: Importing rule: remove_trailing_cedilla; took: 0:00:00.000171
    DEBUG: Importing rule: rm_dir; took: 0:00:00.000566
    DEBUG: Importing rule: rm_root; took: 0:00:00.000411
    DEBUG: Importing rule: scm_correction; took: 0:00:00.000426
    DEBUG: Importing rule: sed_unterminated_s; took: 0:00:00.000419
    DEBUG: Importing rule: sl_ls; took: 0:00:00.000162
    DEBUG: Importing rule: ssh_known_hosts; took: 0:00:00.000814
    DEBUG: Importing rule: sudo; took: 0:00:00.000175
    DEBUG: Importing rule: sudo_command_from_user_path; took: 0:00:00.000575
    DEBUG: Importing rule: switch_lang; took: 0:00:00.000342
    DEBUG: Importing rule: systemctl; took: 0:00:00.000850
    DEBUG: Importing rule: terraform_init; took: 0:00:00.000647
    DEBUG: Importing rule: test.py; took: 0:00:00.000161
    DEBUG: Importing rule: tmux; took: 0:00:00.000443
    DEBUG: Importing rule: touch; took: 0:00:00.000429
    DEBUG: Importing rule: tsuru_login; took: 0:00:00.000422
    DEBUG: Importing rule: tsuru_not_command; took: 0:00:00.000423
    DEBUG: Importing rule: unknown_command; took: 0:00:00.000185
    DEBUG: Importing rule: unsudo; took: 0:00:00.000170
    DEBUG: Importing rule: vagrant_up; took: 0:00:00.000526
    DEBUG: Importing rule: whois; took: 0:00:00.000909
    DEBUG: Importing rule: workon_doesnt_exists; took: 0:00:00.000625
    DEBUG: Importing rule: yarn_alias; took: 0:00:00.000411
    DEBUG: Importing rule: yarn_command_not_found; took: 0:00:00.000855
    DEBUG: Importing rule: yarn_command_replaced; took: 0:00:00.000542
    DEBUG: Importing rule: yarn_help; took: 0:00:00.000448
    DEBUG: Importing rule: yum_invalid_operation; took: 0:00:00.001104
    DEBUG: Trying rule: path_from_history; took: 0:00:00.000564
    DEBUG: Trying rule: dry; took: 0:00:00.000107
    DEBUG: Trying rule: git_stash_pop; took: 0:00:00.000028
    DEBUG: Trying rule: test.py; took: 0:00:00.000003
    DEBUG: Trying rule: adb_unknown_command; took: 0:00:00.000016
    DEBUG: Trying rule: ag_literal; took: 0:00:00.000015
    DEBUG: Trying rule: aws_cli; took: 0:00:00.000013
    DEBUG: Trying rule: az_cli; took: 0:00:00.000012
    DEBUG: Trying rule: brew_link; took: 0:00:00.000013
    DEBUG: Trying rule: brew_reinstall; took: 0:00:00.000011
    DEBUG: Trying rule: brew_uninstall; took: 0:00:00.000010
    DEBUG: Trying rule: brew_update_formula; took: 0:00:00.000010
    DEBUG: Trying rule: cargo; took: 0:00:00.000002
    DEBUG: Trying rule: cargo_no_command; took: 0:00:00.000012
    DEBUG: Trying rule: cat_dir; took: 0:00:00.000011
    DEBUG: Trying rule: cd_correction; took: 0:00:00.000013
    DEBUG: Trying rule: cd_mkdir; took: 0:00:00.000011
    DEBUG: Trying rule: cd_parent; took: 0:00:00.000002
    DEBUG: Trying rule: chmod_x; took: 0:00:00.000002
    DEBUG: Trying rule: composer_not_command; took: 0:00:00.000011
    DEBUG: Trying rule: cp_create_destination; took: 0:00:00.000012
    DEBUG: Trying rule: cp_omitting_directory; took: 0:00:00.000012
    DEBUG: Trying rule: cpp11; took: 0:00:00.000011
    DEBUG: Trying rule: dirty_untar; took: 0:00:00.000011
    DEBUG: Trying rule: dirty_unzip; took: 0:00:00.000010
    DEBUG: Trying rule: django_south_ghost; took: 0:00:00.000002
    DEBUG: Trying rule: django_south_merge; took: 0:00:00.000001
    DEBUG: Trying rule: docker_image_being_used_by_container; took: 0:00:00.000010
    DEBUG: Trying rule: docker_login; took: 0:00:00.000010
    DEBUG: Trying rule: docker_not_command; took: 0:00:00.000010
    DEBUG: Trying rule: fab_command_not_found; took: 0:00:00.000011
    DEBUG: Trying rule: fix_alt_space; took: 0:00:00.000006
    DEBUG: Trying rule: fix_file; took: 0:00:00.000204
    DEBUG: Trying rule: gem_unknown_command; took: 0:00:00.000013
    DEBUG: Trying rule: git_add; took: 0:00:00.000011
    DEBUG: Trying rule: git_add_force; took: 0:00:00.000027
    DEBUG: Trying rule: git_bisect_usage; took: 0:00:00.000008
    DEBUG: Trying rule: git_branch_delete; took: 0:00:00.000009
    DEBUG: Trying rule: git_branch_delete_checked_out; took: 0:00:00.000009
    DEBUG: Trying rule: git_branch_exists; took: 0:00:00.000010
    DEBUG: Trying rule: git_branch_list; took: 0:00:00.000010
    DEBUG: Trying rule: git_checkout; took: 0:00:00.000013
    DEBUG: Trying rule: git_commit_amend; took: 0:00:00.000009
    DEBUG: Trying rule: git_commit_reset; took: 0:00:00.000010
    DEBUG: Trying rule: git_diff_no_index; took: 0:00:00.000010
    DEBUG: Trying rule: git_diff_staged; took: 0:00:00.000015
    DEBUG: Trying rule: git_fix_stash; took: 0:00:00.000009
    DEBUG: Trying rule: git_flag_after_filename; took: 0:00:00.000008
    DEBUG: Trying rule: git_help_aliased; took: 0:00:00.000009
    DEBUG: Trying rule: git_merge; took: 0:00:00.000015
    DEBUG: Trying rule: git_merge_unrelated; took: 0:00:00.000009
    DEBUG: Trying rule: git_not_command; took: 0:00:00.000008
    DEBUG: Trying rule: git_pull; took: 0:00:00.000008
    DEBUG: Trying rule: git_pull_clone; took: 0:00:00.000008
    DEBUG: Trying rule: git_pull_uncommitted_changes; took: 0:00:00.000012
    DEBUG: Trying rule: git_push; took: 0:00:00.000009
    DEBUG: Trying rule: git_push_different_branch_names; took: 0:00:00.000009
    DEBUG: Trying rule: git_push_pull; took: 0:00:00.000008
    DEBUG: Trying rule: git_push_without_commits; took: 0:00:00.000012
    DEBUG: Trying rule: git_rebase_merge_dir; took: 0:00:00.000009
    DEBUG: Trying rule: git_rebase_no_changes; took: 0:00:00.000008
    DEBUG: Trying rule: git_remote_delete; took: 0:00:00.000009
    DEBUG: Trying rule: git_remote_seturl_add; took: 0:00:00.000009
    DEBUG: Trying rule: git_rm_local_modifications; took: 0:00:00.000008
    DEBUG: Trying rule: git_rm_recursive; took: 0:00:00.000008
    DEBUG: Trying rule: git_rm_staged; took: 0:00:00.000008
    DEBUG: Trying rule: git_stash; took: 0:00:00.000009
    DEBUG: Trying rule: git_tag_force; took: 0:00:00.000012
    DEBUG: Trying rule: git_two_dashes; took: 0:00:00.000008
    DEBUG: Trying rule: go_run; took: 0:00:00.000012
    DEBUG: Trying rule: go_unknown_command; took: 0:00:00.000010
    DEBUG: Trying rule: gradle_no_task; took: 0:00:00.000011
    DEBUG: Trying rule: gradle_wrapper; took: 0:00:00.000011
    DEBUG: Trying rule: grep_arguments_order; took: 0:00:00.000013
    DEBUG: Trying rule: grep_recursive; took: 0:00:00.000011
    DEBUG: Trying rule: grunt_task_not_found; took: 0:00:00.000010
    DEBUG: Trying rule: gulp_not_task; took: 0:00:00.000016
    DEBUG: Trying rule: has_exists_script; took: 0:00:00.000017
    DEBUG: Trying rule: heroku_multiple_apps; took: 0:00:00.000011
    DEBUG: Trying rule: heroku_not_command; took: 0:00:00.000009
    DEBUG: Trying rule: hostscli; took: 0:00:00.000011
    DEBUG: Trying rule: ifconfig_device_not_found; took: 0:00:00.000011
    DEBUG: Trying rule: java; took: 0:00:00.000010
    DEBUG: Trying rule: javac; took: 0:00:00.000010
    DEBUG: Trying rule: lein_not_task; took: 0:00:00.000015
    DEBUG: Trying rule: ln_no_hard_link; took: 0:00:00.000004
    DEBUG: Trying rule: ln_s_order; took: 0:00:00.000004
    DEBUG: Trying rule: ls_all; took: 0:00:00.000010
    DEBUG: Trying rule: ls_lah; took: 0:00:00.000010
    DEBUG: Trying rule: man; took: 0:00:00.000012
    DEBUG: Trying rule: mercurial; took: 0:00:00.000016
    DEBUG: Trying rule: mkdir_p; took: 0:00:00.000004
    DEBUG: Trying rule: mvn_no_command; took: 0:00:00.000011
    DEBUG: Trying rule: mvn_unknown_lifecycle_phase; took: 0:00:00.000009
    DEBUG: Trying rule: no_such_file; took: 0:00:00.000748
    DEBUG: Trying rule: npm_missing_script; took: 0:00:00.000020
    DEBUG: Trying rule: npm_run_script; took: 0:00:00.000013
    DEBUG: Trying rule: npm_wrong_command; took: 0:00:00.000012
    DEBUG: Trying rule: open; took: 0:00:00.000020
    DEBUG: Trying rule: php_s; took: 0:00:00.000014
    DEBUG: Trying rule: pip_install; took: 0:00:00.000016
    DEBUG: Trying rule: pip_unknown_command; took: 0:00:00.000013
    DEBUG: Trying rule: port_already_in_use; took: 0:00:00.000570
    DEBUG: Trying rule: prove_recursively; took: 0:00:00.000024
    DEBUG: Trying rule: pyenv_no_such_command; took: 0:00:00.000014
    DEBUG: Trying rule: python_command; took: 0:00:00.000005
    DEBUG: Trying rule: python_execute; took: 0:00:00.000014
    DEBUG: Trying rule: quotation_marks; took: 0:00:00.000003
    DEBUG: Trying rule: react_native_command_unrecognized; took: 0:00:00.000015
    DEBUG: Trying rule: remove_shell_prompt_literal; took: 0:00:00.000003
    DEBUG: Trying rule: remove_trailing_cedilla; took: 0:00:00.000002
    DEBUG: Trying rule: rm_dir; took: 0:00:00.000006
    DEBUG: Trying rule: scm_correction; took: 0:00:00.000013
    DEBUG: Trying rule: sed_unterminated_s; took: 0:00:00.000041
    DEBUG: Trying rule: sl_ls; took: 0:00:00.000002
    DEBUG: Trying rule: ssh_known_hosts; took: 0:00:00.000026
    DEBUG: Trying rule: sudo; took: 0:00:00.000045
    DEBUG: Trying rule: sudo_command_from_user_path; took: 0:00:00.000012
    DEBUG: Trying rule: switch_lang; took: 0:00:00.000003
    DEBUG: Trying rule: systemctl; took: 0:00:00.000015
    DEBUG: Trying rule: terraform_init; took: 0:00:00.000014
    DEBUG: Trying rule: tmux; took: 0:00:00.000011
    DEBUG: Trying rule: touch; took: 0:00:00.000010
    DEBUG: Trying rule: tsuru_login; took: 0:00:00.000013
    DEBUG: Trying rule: tsuru_not_command; took: 0:00:00.000009
    DEBUG: Trying rule: unknown_command; took: 0:00:00.001732
    DEBUG: Trying rule: unsudo; took: 0:00:00.000004
    DEBUG: Trying rule: vagrant_up; took: 0:00:00.000017
    DEBUG: Trying rule: whois; took: 0:00:00.000014
    DEBUG: Trying rule: workon_doesnt_exists; took: 0:00:00.000011
    DEBUG: Trying rule: yarn_alias; took: 0:00:00.000016
    DEBUG: Trying rule: yarn_command_not_found; took: 0:00:00.000010
    DEBUG: Trying rule: yarn_command_replaced; took: 0:00:00.000010
    DEBUG: Trying rule: yarn_help; took: 0:00:00.000017
    DEBUG: Trying rule: man_no_space; took: 0:00:00.000003
    DEBUG: Trying rule: no_command; took: 0:00:00.000115
    DEBUG: Trying rule: missing_space_before_subcommand; took: 0:00:00.000231
    DEBUG: Trying rule: long_form_help; took: 0:00:00.000333
    DEBUG: Trying rule: history; took: 0:00:00.097725
    ssh fns@<REDACTED> [enter/↑/↓/ctrl+c]

If the bug only appears with a specific application, the output of that application and its version:

    I have seen this behaviour in both Kitty Terminal Emulator, as well as in Termite Terminal Emulator, both using zsh.

Anything else you think is relevant:

    Not really

<!-- It's only with enough information that we can do something to fix the problem. -->