bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#57607: Feature request: Use the character cell on bottom-right corne


From: Akib Azmain Turja
Subject: bug#57607: Feature request: Use the character cell on bottom-right corner of a terminal
Date: Sun, 11 Sep 2022 15:00:58 +0600

Akib Azmain Turja <akib@disroot.org> writes:

> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>
>> Akib Azmain Turja <akib@disroot.org> writes:
>>
>>> Yes, I'm interested, because I think it would help me understand how
>>> Emacs renders text in terminal, which would help me to implement child
>>> frame in terminal.  But I don't have the time to do it right now.  I
>>> hope I can start doing this by late October.
>>
>> Great!  I've re-opened this issue.
>>
>>>
>>>>
>>>> The places you mention sound right.  It's probably all in term.c.  But
>>>> I'd like to add, that in principle all places writing to the terminal
>>>> have to be checked at least.
>>>>
>>>> And corner cases have to be taken into consideration :-).  Pulling
>>>> something out of thin air: What happens if we write RGRG to the
>>>> bottom-right corner, where R is one red char, and G is 1 green char,
>>>> say.
>>>
>>> I think you meant the following in Bash:
>>>
>>> printf "%$((COLUMNS - 4))s\e[31mr\e[32mg\e7\e[32mg\e8\e[@\e[31mr\e[m" "" ; 
>>> sleep 1 ; printf '\n'
>>>
>>> And it works on St, Kitty, Coterm, Term, etc.
>>
>> What I was thinking of is the Emacs side of things, i.e. can we always
>> do our magic locally in tty_write... etc., or is it sometimes necessary
>> to reorder writes at the caller.
>
> We would need to remember the glyph in the character cell before the
> last one, because modifying the last character cell needs to rewrite to
> that cell.

Just to add, terminal is with 'smam' (enable automatic margin) and
'rmam' (disable automatic margin) can disable automatic margin, thus can
write the last character cell.

And, Emacs currently often writes to the last character possibly by
mistake.  I'm not sure whether this is a bug or not.  To reproduce, run
emacs -Q, hit M-: (eval-expression), write some garbage until the
minibuffer window scrolls (I used (+ (% (random) 26) ?a) to generate
the garbage), and hit C-p until you scroll down a line.  You should now
see that the last character cell contains a continuation ('\') glyph.  I
think this is probably due to the use of 'il' or 'il1' or 'rin'
capability.  Should I report this as a bug?

-- 
Akib Azmain Turja

Find me on Mastodon at @akib@hostux.social.

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]