matcha
matcha copied to clipboard
BUG: Division by zero potential in imageRows when cellHeight is 0
Describe the bug
In imageRows() (view/html.go:274-278), cellHeight from getCellHeightFromFd() could return 0 if the terminal doesn't support the ioctl query. The division (h + cellHeight - 1) / cellHeight would then panic with division by zero.
To reproduce
- Run matcha in a terminal that doesn't report cell size via ioctl
- Open an email with an inline image
- Observe division by zero panic
Expected behavior
Check cellHeight > 0 before dividing, default to a reasonable fallback (e.g. 16px).
/assign