nvbn / thefuck

Magnificent app which corrects your previous console command.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

qzhsjz opened this issue · comments

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

Here's the text with corrected grammar:

I have the same issue. The first time I open a terminal, it immediately crashes. If I then reopen a new terminal, it works. So, for every terminal I want to open, it crashes the first time. Then, if I reopen it, it behaves as expected.