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).
Describe the bug
In
imageRows()(view/html.go:274-278),cellHeightfromgetCellHeightFromFd()could return 0 if the terminal doesn't support the ioctl query. The division(h + cellHeight - 1) / cellHeightwould then panic with division by zero.To reproduce
Expected behavior
Check
cellHeight > 0before dividing, default to a reasonable fallback (e.g. 16px).