nvbn / thefuck

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

When using Windows Terminal to ssh to a remote server with Zsh/OMZ/powerlevel10k, and instant mode in ~/.zshrc, sometimes crash on start up. #1431

Open qzhsjz opened 5 months ago

qzhsjz commented 5 months 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.29 using Python 3.11.2 and ZSH 5.9

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

Windows Terminal ssh to Debian 12

How to reproduce the bug:

- add eval $(thefuck --alias --enable-experimental-instant-mode) to ~/.zshrc
- on the connection established.

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

the bug is not always presents.

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

Powershell 7.3.10, Windows Terminal 1.18.3181.0

Anything else you think is relevant:

Traceback (most recent call last):
  File "/usr/bin/thefuck", line 13, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/share/thefuck/thefuck/entrypoints/main.py", line 35, in main
    shell_logger(known_args.shell_logger)
  File "/usr/share/thefuck/thefuck/entrypoints/shell_logger.py", line 77, in shell_logger
    return_code = _spawn(os.environ['SHELL'], partial(_read, buffer))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/thefuck/thefuck/entrypoints/shell_logger.py", line 51, in _spawn
    _set_pty_size(master_fd)
  File "/usr/share/thefuck/thefuck/entrypoints/shell_logger.py", line 29, in _set_pty_size
    fcntl.ioctl(pty.STDOUT_FILENO, termios.TIOCGWINSZ, buf, True)
OSError: [Errno 25] Inappropriate ioctl for device