Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query window pixel size #166

Merged
merged 2 commits into from
Oct 16, 2020
Merged

Query window pixel size #166

merged 2 commits into from
Oct 16, 2020

Commits on Oct 16, 2020

  1. Query window pixel size on Unix

    mdcat needs the window size in pixels to correctly draw images in some
    terminals.  Unfortunately term_size doesn't expose ws_xpixel/ws_ypixel
    from the winsize struct so we now do the ioctl ourselves.
    
    This effectively gets rid of term_size on Unix system which has the
    added benefit that we can now freely choose which device to query
    instead of being limited to stdin, stdout and stderr.
    
    We use this opportunity to query the controlling terminal directly, via
    ctermid.  This implies that mdcat correctly detects the terminal size
    even when all standard streams are redirected.
    swsnr committed Oct 16, 2020
    Configuration menu
    Copy the full SHA
    cf06ab1 View commit details
    Browse the repository at this point in the history
  2. Use window size from settings in kitty

    No longer run kitty icat --print-window-size to determine the window
    size in pixels; instead rely on what we've got from the terminal
    directly (kitty icat --print-window-size does nothing different).
    
    This is simpler, faster and, above all, works over SSH connections.
    swsnr committed Oct 16, 2020
    Configuration menu
    Copy the full SHA
    4335fc6 View commit details
    Browse the repository at this point in the history