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_EF,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 C252023D55 for ; Fri, 10 May 2024 22:41:11 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1715373671; b=XKJ11QKolgOs1c5kFyjTMtOHpuLjedCak5KLJdl9YKB/xnj7p1L5ZF4o163soEktMxmox7enK1 B3O9AIdQfA+2th4P1qCi+4mSsTAvpef+44BWoHPuIhXltq5JcmoqSg5Si72/Vn4gMWiPIhn4E9 tejGSf9Mg/Ku5Y8C4XvSgquOqlwiZf609ONQjlH1Y7NATiWQSeTTg3Fux+9S1n9ecORTeKLFDs ljqNpI4tU9gs+dHBiAjmUgBMOiQnMoGUmDdaLp2SztvJTSd1cv5PrsBIWefYx25EvFvCnca8en gZqoPdBqn7B/x2jtQrRVDmyDQ4/kcFviOldouKthc88mmA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lf1-f51.google.com) smtp.remote-ip=209.85.167.51; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1715373671; bh=EJEbwbCgKe8dAjNMsMKA4Ksxr292IlRa9uf2U6Jy6Ic=; 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=E3O7v3pt8p7OXGMe+3Muo9Ai3inbEYuPjYwRa1LUQt3LUIoYX985l+JNnx5gWGnU9r3R2UBwz1 LrD2qg+6YJBN2DelVhOmzDkop5NmqGvgddp+668nYBSEG/OO+29frqeBG9zolJB0zrq3O6Sr2g vfTbG2mTkmX1150nm50p+QZPGmJ7Ijr7d2i2R/DvGUj0Q4F0MYOjIlJTQnqUvN5i6kKx6t8a4Z wzCJMarIy6ZnZozTuBK6bmIHZyiVLLzbALVgkbSQunhPgDPUE29sAoK9aR1CusP7msnAa5r5hQ rx+MjAOUqudvF4uOe6/kC8NG/fhFXcXaO+e0jmeLJRi/xA==; 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=l5ex4vpyxpXYIK/UsdjXaOI87lk1NEbCy/zERBmYeNg=; b=LJaWUOw4Y4nqYRy8VSo0tdVp9w ZuYnGbIRvoWVpq/qYCcIKlu8R+W7JWPvWgXtmdsAvVjysnSOGzmGrkT4y+/NYsUhqWI3yN1H1vwVF YzXlVVHqziEES7QydVorOwLDNpMCYPFTsqZl+iZkIGarQr1qibVGJQI9m6vzYip/o8XWO3RexUzSY 7QKvnLH6JHOExx29HQccc2mOtSntVXKVkvCaCCgOUPJ4zFd6zjLfvUp5CBY7AkJ70HqTR/rppgC9W kSGECfZO/X4V6HFiUdnJb+DXR4K3ZU7FVf9jcKaBnuy8zROMwTKAezxL4GxRgws16wIpgBcUhn+6e 2rJQS7zg==; Received: by zero.zsh.org with local id 1s5X3G-000Mz0-7Z; Fri, 10 May 2024 20:41:10 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lf1-f51.google.com) smtp.remote-ip=209.85.167.51; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-lf1-f51.google.com ([209.85.167.51]:49641) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1s5X2T-000MfL-Fs; Fri, 10 May 2024 20:40:22 +0000 Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-518931f8d23so2534135e87.3 for ; Fri, 10 May 2024 13:40:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1715373620; x=1715978420; 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=l5ex4vpyxpXYIK/UsdjXaOI87lk1NEbCy/zERBmYeNg=; b=1quKYNEQvZZM7zkKAMgeCE041WV36omQ21UYMfwpYZi7zO2P5qEVJd5S7AmHV3IJjj uN4SBLYPv/9iGAjrN8PNKR6TFURP/cVtA4ZsAlcGZMzlRq3ibeMvzGeGBbTo1bWfTkNp qs+chKxQiqkUk8b1k4Uo6QXOySbRTBQHEYiJvEQ2dgNH4Ss71OHlXRnGpK9bFB016yzj FieriWEYwWRtD2e5FfNJJszFaN1HDlhXIC47BJB07eGgV9rOs9orVl+raeb/dYYWxwqU oxo9cf+FJNNBjs3fYWxeEDSUflpX1gO6yw5KB9B9SCCwYJP/Ubnv8wrKinkIqPdJHP5x Qcsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715373620; x=1715978420; 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=l5ex4vpyxpXYIK/UsdjXaOI87lk1NEbCy/zERBmYeNg=; b=gbESIhjTkvO4nzWkyAzNgAoo5fDscZjOdavDeqFKPanrLxFvEINuNF4L34eriy4PVu YOSacHSmNUX/OXF1qGoI9SEhWTKGfCw6qR/l3wnXcp56pBRwz3i3GSAlcNaPtyNHHifN 7xplCpG1yry0WnXBgj1zZt5arD83i7uoD029Kp5UA3RV+QM4xtWpVtKv6/0r5Y8hgCEZ 8mK/t9k/lknFmR/QzNu+sUqSQYXnACDssHIh47UL3gG/ZQvn+zrVUXGsbAQWivOJWtxs VHKXe3QpgEDjCWiNbSgbfjaQztmmBzEM3tSUbpugqd0fPBR9twNrS2/lgZkfkieGH1vo GSHQ== X-Gm-Message-State: AOJu0Ywh1/JuuXtAFYNHwEdRRFWVvV4YMUkM7loUB8xXaDksxLqp/GpQ dx5wwf16bs/gahz2F3HqY1FmaOlcodLmW7dqJMasuP/0gHbT4QeScVyB2k9c7QCBFEQgCcNCeKQ uKVoxmjSYsYjgM6gi0iBbTOCKBgf7fRoMCSQh X-Google-Smtp-Source: AGHT+IExjiF3N51cNTKJeXNa3T6JG/IfpJ/r1/dKRwmBqcQ7D6xReVM1oDYFyOuilh7VtqdX+wJCl+kwTajwSO9PuQo= X-Received: by 2002:ac2:44d8:0:b0:518:b144:9020 with SMTP id 2adb3069b0e04-522102729a0mr2321597e87.61.1715373619895; Fri, 10 May 2024 13:40:19 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Fri, 10 May 2024 13:40:08 -0700 Message-ID: Subject: Re: [BUG] ZLE character width with emoji presentation variation selectors in Unicode To: Advait Maybhate Cc: zsh-workers@zsh.org, Aloke Desai , Zach Bai Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52927 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 10:12=E2=80=AFAM Advait Maybhate = wrote: > > In fish's case, I believe they use ridiculousfish/widecharwidth which doe= s seem to handle emoji presentation selectors. unicode-width, part of the R= ust stdlib, recently added support for correctly reporting the width of the= se sequences as well: unicode-width/pull/41. Note that if your primary concern is emojis in prompts (rather than in text typed as command input), zsh has the %G (for "glitch") prompt sequence. So if you write e.g. PS1=3D"Cloudy %{=E2=98=81=EF=B8=8F%2G%}% " then zsh will correctly reserve 2 positions for the glyph when calculating the prompt. (Note gmail may have messed up the copy-paste of the emoji; do it right and it works).