Skip to content

Images do not appear when TIOCGWINSZ returns zero for screen size #331

@db-fodor

Description

@db-fodor

I am using Fedora Silverblue with Ghostty and neovim in a toolbox container to allow dnf installs, and due to this somewhat unusual setup I've found that images simply do not appear as they should. I'd be curious if this problem also occurs when using neovim in a server through ssh since the conditions are theoretically similar.

After a bit of debugging I believe the issue to be due to how window size is calculated in term.lua, as the get_win_size function consistently returned zero for screen_x and screen_y, therefore also setting cell_width and cell_height to zero. I have provided log files of the issue below.

Currently a temporary fix for anyone else who encounters this would be to set sz.xpixel and sz.ypixel to a constant, though I believe this would prevent image scaling in the meantime.

image.nvim.log

Sorry for the lackluster bug report, and hopefully this will be useful if anyone else encounters this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions