term.has_borders

term

has_borders(read1) -> supported

Check whether the terminal draws borders on cell edges

Asks for private mode 5154 (CSI ? 5154 $ p) with a Primary Device Attributes request (CSI c) behind it. Reads to the end of DA1's answer, so no byte of either answer reaches get(). Answers true when mode 5154 answered 1 (set) or 3 (permanently set). A terminal without cell borders answers 0 or nothing, and DA1 then comes alone. Five empty reads in a row, about half a second, count as no answer.

Must be called in raw mode: outside it the probe writes nothing and answers false, unless a custom read1 is supplied. The first answer is cached, and later calls return it without asking again.