edit icon indicating copy to clipboard operation
edit copied to clipboard

[BUG]Panic: "chunk size must be non-zero" when using 'edit' over multiple SSH sessions

Open ha7v opened this issue 3 months ago • 2 comments

Bug Description

edit panics with a chunk size must be non-zero error. This is reliably reproducible when connected to a Termux instance via two or more concurrent SSH sessions. The issue seems related to framebuffer initialization when multiple pseudo-terminals (TTYs) are active.

Steps to Reproduce

  1. Start sshd on Termux.
  2. Establish two or more concurrent SSH connections from any client.
  3. In one of the sessions, run edit <any-file>.
  4. The program panics. (May require a few attempts).

Actual Behavior

The program panics and crashes immediately, returning the shell prompt with a "zsh: abort" message. The following is the full stack backtrace captured with the RUST_BACKTRACE=full environment variable:

Image

Environment

  • Server: Termux v0.118.3(1002)
  • Client: Windows PowerShell (and likely any other SSH client)
  • Connection Protocol: OpenSSH_10.2p1, OpenSSL 3.5.2 5 Aug 2025 (sshd running on Termux)
  • Crashing Program: edit v1.2.1

ha7v avatar Nov 09 '25 03:11 ha7v

multiple pseudo-terminals

An application can categorically not have more than one PTY hooked up to standard input. Judging by the spill on the prompt, I somewhat suspect that your multiplexer of choice is returning a corrupt response to one of the queries edit runs on startup. We should be robust, but also, it should not do that.

DHowett avatar Nov 10 '25 19:11 DHowett

Thanks for the reply! I am new here, so I'll give tmux a try.

ha7v avatar Nov 11 '25 01:11 ha7v