From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 073C0260C6 for ; Fri, 10 May 2024 20:58:24 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1715367504; b=G+nhz1xJ1xcO+Ycu4OujmQyhGwHQv16WgIE+OEqgD5DQpkxAZYOhnviZsxle1nolNBPTj7Y6jp VWe5AMf3DkHYPQhw1kOijFI5VYgpvvzmL6/DUfUOgmG69cC8ESvZYbdMKb6GbDMm+DmyD/zd9v PmcKgXaBV/gIEJXUUSlHIxRZ25tQDiefzLfzjuAQSVwFHOIOuQtn7cOR24nBRVVhhVbo5CqyWn uD9XZxKy6JdvqcH/uRWNIvQQNWdaFiIUA0oGn/+zkGcPgb7jTiBOCuYFDlRB+t6tdgmpa26zyH FbY3PRC1jVmlMsTCQYryb2vBpOaYEmit3muGYcngmsYYfQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lf1-f45.google.com) smtp.remote-ip=209.85.167.45; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1715367504; bh=hfUo8lc9jRFKhSdR897LvOMcd7PXO04XroLbWdEDa9U=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=Hq2Uy3J5uJvyo23ely0Y4s3b6o8l/tM2HjhjJcZC3ExFrqLgaeJQCqlIwrNh92OIXzP4ZHFPK3 TUHSNX1A77vTBQIKsjt/IKkjrpRfOSdwmIbGBu4c6V+8yD5YIqIntOoHH9LQ2UCoiNXtuKrzUW tofov0tk+BEM5WOlywKhapy6p510KebP+K9JpFH5hycAn3aTdxleAKd7rCmhywSWSnzmSVNpDn yj5Jnu0slenxYYd1Ua46v45UY6vrM9fbod/b+OEe000kB7q1E4oZrQ3w/tVz5s5oTZx4FD6SzP E6w8GSROcYSCuFRTHogx5dIrUJItUENzbf5O8WUZqXw15Q==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=hfUo8lc9jRFKhSdR897LvOMcd7PXO04XroLbWdEDa9U=; b=KdBVnwu0GbA7IHR6CndgIMLVOS 0UYpv8C9Ufa+OCJE7pcTyoKICw1R0CDO77gbMAHt32kklf3zPEW2Ej+seWqF7Zlb3K8lJxPid+SKu 8Y39OhAhAvyFSHsM9H8LxvQlRbHNK8Iafg9ZEV5PtBbL6pmhlQBk6mnCiupm2mLUn5gCkgFfA1mkZ /31Zi83CCS0cij0motr0SdzqWvgGJ1UoXidGErEqhsBRxJCe3eYk5Tx8wHkCvRS3Y+zrpedjbUB0w awsB5qVka2ftZH6C5xz+swicyJ6lZLH5bmpT/WOof3EZCSbrI7+RlApWZgf5aYUQvNxuw8oTi3QEc SmoyNcgg==; Received: by zero.zsh.org with local id 1s5VRn-000K0H-I4; Fri, 10 May 2024 18:58:23 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lf1-f45.google.com) smtp.remote-ip=209.85.167.45; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lf1-f45.google.com ([209.85.167.45]:56573) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1s5VR0-000JgU-O2; Fri, 10 May 2024 18:57:36 +0000 Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-51fc01b6fe7so2523121e87.0 for ; Fri, 10 May 2024 11:57:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715367454; x=1715972254; darn=zsh.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hfUo8lc9jRFKhSdR897LvOMcd7PXO04XroLbWdEDa9U=; b=flyrYOS2JYDLJh7f0P/ViDStZwSbtNCEg/UPXRVpnO8T2yOoarrZv6bSruVlNFUJjo qeuXZnpedfsc4ojez/ZOHAxtW1PCXlLuhkTXWtz8AhWDT8A/KMBpXy1IYwHNt57RO7w3 PGj5dEOoRTEIAmZsmfUqrS6LCArV2uHpP0R1RqUbxqLKF4aEa+UYasYVJ+FnjpFZxWgF DS/hf6A9gJwV+ToJWvbsOK5S6A37RG2OwEvtRmCVl9RbxpOCHgMBTkKbV2+1zl/1o7Ep Nohs1oBF+3K5A14qbhKsDN4e8MRpPqN8vKdZMcLc880G63H+Lh8W9dm6wUyQPVYLolK/ Z3sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715367454; x=1715972254; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hfUo8lc9jRFKhSdR897LvOMcd7PXO04XroLbWdEDa9U=; b=Yq0+JIaJZcx27F91tWWpGqd2DmvzhZPFGia7vmQrvkBG7Hc4sshQ8jXyfx/1IfXgba NxB0TOq79rbvISy5mxRPVkv6vVLgswju4nLKiMC8A5s4s3w6Vy9l31RuJGqs6/c/XirD nXghhM/yuZq2pzz+0ewLFssHCTuf/LbvpDnytR7Gh5E+8f7HXSZuiR/BKqq52qy/qI6F kH5qQqFQtyohLkmZTkp6hFZ+hrV692hk0j1ZtV3C7G0OfpNm0JnAABPyLSlu8W+mSovo UkGiAUaVNvOelZlPy97cNBrrQ/Ux9fugjBuagBVUXJk5knS9+Mrso4BVj1j5r8Ia6RUg blbw== X-Gm-Message-State: AOJu0Yx9cqkv6cXDF6U0pACleeJBa1B2C77ypHQYo6u4Cmb2toXtw3V2 cDO9T+iloNcxYAf44kUpmDQUuyk9ees47gWyi2zFok1LegH7JaVTNuAgqMTrCaO6Ke8ZDDshoY5 Xwuvwca1hyJzwiRkkz7LtRCVM1k0= X-Google-Smtp-Source: AGHT+IFdwsUQVHOeRWu2nvbhUL5GhoZ4RTF6DOuJXFk9lT5siTCJuZm55iNhoZl1V4m0f/rnZluDM/hymVRqaE/hjOQ= X-Received: by 2002:a19:e04c:0:b0:51f:128:4cd2 with SMTP id 2adb3069b0e04-5221006f7a9mr2327684e87.22.1715367453153; Fri, 10 May 2024 11:57:33 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Mikael Magnusson Date: Fri, 10 May 2024 20:57:19 +0200 Message-ID: Subject: Re: [BUG] ZLE character width with emoji presentation variation selectors in Unicode To: Advait Maybhate Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52926 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On Fri, May 10, 2024 at 7:12=E2=80=AFPM Advait Maybhate w= rote: > > Gotcha, thanks for the context! Combining emojis are weird :) > > Hmm, agreed that it won't be possible to use the same standard across all= terminals - hence, I was thinking terminfo would allow the terminal to ind= icate whether it supports these variation selectors with wide characters? > > Yep, I was referencing TR51 from Unicode as well (emoji presentation sele= ctors). >From what I could tell (I'm not an expert), there is no phrasing that implies the width should be different for the emoji presentation form and the text presentation form. > From looking a bit into wcwidth, it seems like it doesn't inherently supp= ort width for a sequence of code points. I just tried this out in C++ with = ICU (International Components for Unicode library) and grapheme clusters to= demonstrate the width calculation as 2 with this sequence: gist.github.com= /Advait-M/a326cd2e474b9520dc893765ec4cb2c4. Yes, normal compose sequences are a base character with a width, and composing characters with 0 width (but effectively rendering to the left of the insertion point, on top of the base character.) --=20 Mikael Magnusson