Skip to content

Implement escape sequence to query terminal size in pixels ('\e[14t'). #581

@dylanaraps

Description

@dylanaraps

This escape sequence outputs the current terminal's window size in pixels.
The output appears as user input in the prompt and requires a read
command to store it’s output.

This is supported in all VTE based terminals, XTerm, URxvt, iTerm2 and
many others so it makes sense for Kitty to support it as well.

Neofetch uses this escape sequence to correctly size and place the image
inside of the terminal window (Neofetch has fallbacks for when this
sequence isn’t supported but they depend on an X server
).

Neofetch recently added support for kitty icat and this works when an X
server is running (thanks to the fallbacks above). However it fails on
macOS as the escape sequence is not supported.

There is a way of using osascript on macOS to query the window size but
this requires the user to accept a dialog that appears on first run. Kitty
supporting the sequence directly would make this feature transparent for
users.

Cheers 👍

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