From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Akib Azmain Turja via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs 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 Message-ID: <87zgf6475h.fsf@disroot.org> References: <87wnakl5md.fsf@disroot.org> <87o7vt3s58.fsf@disroot.org> <87ilm04xzl.fsf@disroot.org> <875yi0v8r6.fsf@disroot.org> <874jxjhz9l.fsf@disroot.org> <87tu5i9kbg.fsf@disroot.org> <87y1ut9b3b.fsf@disroot.org> Reply-To: Akib Azmain Turja Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28902"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57607@debbugs.gnu.org To: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 11 11:06:00 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXIue-0007HV-4y for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Sep 2022 11:06:00 +0200 Original-Received: from localhost ([::1]:56590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXIud-0000L9-3e for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Sep 2022 05:05:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXIti-0000KB-Rk for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2022 05:05:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52018) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oXIti-0007Lx-Gd for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2022 05:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oXIti-0005me-6W for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2022 05:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Akib Azmain Turja Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Sep 2022 09:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57607 X-GNU-PR-Package: emacs Original-Received: via spool by 57607-submit@debbugs.gnu.org id=B57607.166288706522182 (code B ref 57607); Sun, 11 Sep 2022 09:05:02 +0000 Original-Received: (at 57607) by debbugs.gnu.org; 11 Sep 2022 09:04:25 +0000 Original-Received: from localhost ([127.0.0.1]:40717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXIt7-0005lh-0l for submit@debbugs.gnu.org; Sun, 11 Sep 2022 05:04:25 -0400 Original-Received: from knopi.disroot.org ([178.21.23.139]:56986) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXIt2-0005lW-Jz for 57607@debbugs.gnu.org; Sun, 11 Sep 2022 05:04:23 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id B55E04A01B; Sun, 11 Sep 2022 11:04:18 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Original-Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id If2yZhTFRxwr; Sun, 11 Sep 2022 11:04:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1662887057; bh=rkoBeMeJlTuRiZd33fFM9b3mgWLa9RUqwiAk0WnSErw=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=mmwlNcPHm7xbiBamQkVlPYjh+bUfEjIFyPscve3BOifiuZoTH08jU3x9Kqe/JKLq6 hunZvjF3LoFs1UK3DWww67O5fefyw1yHVIDNXJfPqbnVHkfz5/qPRMTfLYcEfhGekP efctPpHW2AOWnaT+ojaExrJOPxFvGHYl3eWMTNFF97+amY1+rUi6Y9P/XriYCtaK+W y4+d66ZxmEH8cZtziy59zxZpF25ebaHomHZR0U/O3vRGsCN61vqF8cVyqBXkL0GzHV PveiwDLFzDPsCUmmq8tL37Lo9lnCsIuuPLkgj2d8d3CZH9ye5KW5r57c+gs2NbjkAU cEBeESaN2MRTg== In-Reply-To: <87y1ut9b3b.fsf@disroot.org> (Akib Azmain Turja's message of "Thu, 08 Sep 2022 20:47:52 +0600") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:242131 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Akib Azmain Turja writes: > Gerd M=C3=B6llmann writes: > >> Akib Azmain Turja 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? =2D-=20 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmMdo8sACgkQVTX89U2I YWsjwQ/9GyVFcq4J/F64EIPoMYHGMmWeRUgKljqSvlg1QAQHlph7ghhCodeoKlQo H/8Jqc0RdUolqQ+V3jB19UF49BTqyhVAiAftKwTyqSoFd1wLLD4pV7pDbn7tZ0pP 8yjPjm/Zq1ZIbulgoQR8ayPnI46J02AOJKc/b/bt8bCV3xXeRSkRov/xYGOuGN36 d4e/gVd7TpPjNcjJu0XrMBVXRIyld6mlKwRO5tBXjYTVNB3nXzOEmLZ1iUWj92u0 8NOohB6m8xzQQWMDAiJQF+Qftoxz9EC0i2fcIazM6lyl5fgHouEpcDo0BAmrazTp BuwcHr+5X02bOagqkaS+U7wZEEOtdQfN6G1n5R+9pqy4EuvsszsrUZolO2+CbUlh OPau7usjtiqRJPzo+H8JKV+M5YJePX9Iq9SvVtfO0StbWKNvbeqi74XKviDia46X fyuPivK1q8nknQLCqYXgAVruXAgL/HZ9z3s58VmUJD4RwqJVuJUI90yP2P8gVEjl +1suLUSpeF7yafEYexjS2sg848I3nvDe0J5VsdnbxaQcaQTV2wIzmf6hf2nS7AFa m5oO9E8783+Me/jOzsKJk8yqssICuYXsOqbItoiJzhzfiBERjz0xx3uduqPnNPVo adWppzkrZBBqEVnG8Wz/xGgCY+wfroS5eIRaWcWMqXGW1xmdGYQ= =OXne -----END PGP SIGNATURE----- --=-=-=--