From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aura Kelloniemi Newsgroups: gmane.emacs.bugs Subject: bug#50865: 28.0.50; Emoji with emoji modifier in Linux console garbles emacs display Date: Mon, 04 Oct 2021 15:25:23 +0300 Message-ID: <87v92d564s.fsf@sange.fi> References: <87y27cdglm.fsf@sange.fi> <83czooeulj.fsf@gnu.org> <87v92gddcg.fsf@sange.fi> <83bl48eoqk.fsf@gnu.org> <87sfxkd976.fsf@sange.fi> <8335pkeivj.fsf@gnu.org> <831r53d764.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3748"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50865@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 04 14:38:40 2021 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 1mXNEt-0000hZ-Ly for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Oct 2021 14:38:39 +0200 Original-Received: from localhost ([::1]:47586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXNEs-0006lV-J9 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Oct 2021 08:38:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXN2g-0006YR-6T for bug-gnu-emacs@gnu.org; Mon, 04 Oct 2021 08:26:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52537) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXN2f-0003qo-Ta for bug-gnu-emacs@gnu.org; Mon, 04 Oct 2021 08:26:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mXN2f-0001gU-LD for bug-gnu-emacs@gnu.org; Mon, 04 Oct 2021 08:26:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Aura Kelloniemi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Oct 2021 12:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50865 X-GNU-PR-Package: emacs Original-Received: via spool by 50865-submit@debbugs.gnu.org id=B50865.16333503336436 (code B ref 50865); Mon, 04 Oct 2021 12:26:01 +0000 Original-Received: (at 50865) by debbugs.gnu.org; 4 Oct 2021 12:25:33 +0000 Original-Received: from localhost ([127.0.0.1]:35850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mXN2D-0001fk-25 for submit@debbugs.gnu.org; Mon, 04 Oct 2021 08:25:33 -0400 Original-Received: from smtp.sange.fi ([185.87.108.151]:53235) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mXN2A-0001fa-LJ for 50865@debbugs.gnu.org; Mon, 04 Oct 2021 08:25:31 -0400 Original-Received: from 88-114-110-12.elisa-laajakaista.fi ([88.114.110.12] helo=solaria) by oiva.sange.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1mXN25-0006wt-N0; Mon, 04 Oct 2021 15:25:28 +0300 In-Reply-To: <831r53d764.fsf@gnu.org> 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:216348 Archived-At: Hi, On 2021-10-02 at 13:58 +0300, Eli Zaretskii wrote: > > Are you sure they don't? what do the developers say about that? I am actually a bit confused about the fact that Linux console doesn't seem to be well known on this list. I am not blaming, just wondering. I would think it would be very easy for all GNU/Linux users to reproduce this bug any time. Anyhow, here I provide a proof that Linux really does not understand two-column characters. This is again a Bash session in a bare Linu console: $ echo $'ab\U0001F64Fxy\rabc' abcxy This prints letters a and b followed by a wide emoji, followed by letters x and y. Then it moves the cursor back to the beginning of line with \r and writes letters a b and c. These should override the first two letters and the first half of the emoji. This leaves the letters x and y in tact. But as you see, the c letter here overrides the whole emoji. If the emoji really was wide, then the output would be $ echo $'ab\U0001F64Fxy\rabc' abc xy Here the space represents the right half of the broken emoji. This later example is run in a VTE-based terminal that supports Unicode properly. > If indeed the Linux console doesn't support double-width characters, > or at least enough of them to cause trouble with Emacs display, my > suggestion would be to use this setting: > M-x set-terminal-coding-system RET latin-1 RET As Andreas pointed out, this would not work. Using only ASCII would be a horrible regression. My native language uses many letters outside the ascii range. Nowadays even programming becomes difficult without Unicode. This is not a feasible solution. > This will display characters outside the Latin-1 range as \uNNNN or > \U0nnnnn (depending on the codepoint), with an underline attribute to > make it easier to tell where the character's code ends and the > following text begins (in case it begins with a digit). Linux console does not support the underline attribute. See man 4 console_codes. It talks about simulating the attributes. > This should allow you to read the rest of the text without messing up the > display. I don't really see a better solution for such problematic > terminals. The solution of modifying char-width-table at least worked very well for me. Of course I am intetrested in the things that will break, if I use it, but most likely those will be smaller annoyances than a garbled display. I can document this hack on emacs wiki, if nothing else can be done. > Emacs relies on the terminal to display characters correctly, using 2 > columns (with padding by empty space) when the character is > double-width. If the terminal doesn't live up to these expectations, > the display will become garbled. Couldn't emacs add a padding space after every two-column character. This would fix the alignment/garbling issues altogether. This setting could be controlled by a terminal-local variable and it could be automatically set for terminals that don't support multi-column characters. Emacs already kind of adds a padding space if I type characters one at a time (because it repositions the cursor after every command), but this does not happen if the text is sent to the terminal in a batch (e.g. when drawing the contents of a buffer, or when doing a redraw). -- Aura