From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31421 invoked from network); 24 Oct 2022 10:50:50 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 24 Oct 2022 10:50:50 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1666608650; b=Jcsug8zHkJqN/y2G8IQlbty8afjKDJIJbXMndvr+9g7DeM214UBvQTBWuJdsgEtbT8s2wt7FKm vomoW2tc71Ztgs2kjhsmO3YSjlk+HGN/KD4LqGCWofoJtxEnh8hjbPob+TgHxLHuKtPcPldi79 V0gRuHUeLLbOaYpgHj+FzQBloxq6B3Uf93268ZJkhd7LuyY1J+5Hj3DXffwk5Ckyyc9wj4uiNw o2Sf9kUv8sX5X48cBpYjGAgLMABzjFnJ+V0JilTSQMLLWUWx6rw0I7fGRRfZ7ikaKcAxCItlOP PzMOoljqMgqgIkXUTVr/sFOHUV3a+NhaBzx79UFK+IN7Hw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yb1-f170.google.com) smtp.remote-ip=209.85.219.170; dkim=pass header.d=gmail.com header.s=20210112 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=1666608650; bh=/4a4cawMPIbLEUUjdif42QAwtpHMpIAn9xeH1HHzz0U=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=MN6xtwdFo5sDm1MYAbuHTKeM4vIqtLiFxcmpqDKTSK+KxjzYuBSXQKtbONADcqao99NsmXa7vj Dl0PvwyUlaMWseTae1xkQ0tep6+COq0SOcuAHPDZVQdFSN81Sin3hR6x/STmBhD2AmtLoKeH2b lzgnpAZp9gf5YbqVFotks4Et91MFbQV5LkW5ZnhRdEheDWQtyceK5HfyWUOXN2I1+kyma7/Xt0 y9tmfGi1+TpIHA3JaxexZEZUW5Z54cmNHzNz3ne1m/jkyvENir3ornpV6UsMdVNxIcTH1Uwgto 8o82FAZRAkDX7YQto3f08wVZ+oey5U0yy8WNY/4OMQPdSg==; 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-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=pycLLYCMcrGCzj4pflGzcPY4Wi/H00Hle3hQyYL3Gyg=; b=nA7js9/hWkzv2Zfz1SjElsoM2c nYK9S4cB9Rqlsz/0HY1MweebF/AyAYx4csJJWXEydK9b+fr1ZQaw97oaR5N46E8U7aLk/oumvgu73 hCROw3Jp3Ac/wIc/kdeMl9Hn7dWlB5p9oyPbH7EOqIuCnw3Q2hq94ZqGVUI5qULC1jBPn4okM8seY uPrxxgK1qIABIyKYPVRLcviat+lHqhBWunTd1iA/n+zmc+D5hFDQkjysO+5PRqgE/eE8GzXcnCa7s IomJSzy5mnrxAtDJxbQaxa+/wjvEJJY+7Z4j07cjDCXAlF9I47cfBaNzlA0x2/mRbOZaRo8WuHyfM U7KHgJxA==; Received: by zero.zsh.org with local id 1omv2g-000PFD-8s; Mon, 24 Oct 2022 10:50:50 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yb1-f170.google.com) smtp.remote-ip=209.85.219.170; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-yb1-f170.google.com ([209.85.219.170]:35358) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1omv2K-000Osq-OU; Mon, 24 Oct 2022 10:50:29 +0000 Received: by mail-yb1-f170.google.com with SMTP id f205so10601046yba.2 for ; Mon, 24 Oct 2022 03:50:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=pycLLYCMcrGCzj4pflGzcPY4Wi/H00Hle3hQyYL3Gyg=; b=hP1214HMLLfhSnGgPBvjoYmwobDtFpQhqWmCJPjkkJbtx7uagEOk+XeBpiMN7ZRBNK Aavg52io4SDppcEcow/2flV95LYIOZ+MoBoQnljkSWWNMefE9kWG1+svu58VMGjDbXim ttSwal1OtZ+V+ZaQWO51F/ZSpnLarQ8Xcgyns5oAHKw0rECW3okmE0Bf6SWn7QrQOR62 bon852gIkOydvMezEpdJBHJeXx3mCLjrIpl16aab4rEiH6V+/8kCa0sGuZbWYaDMXKAT 7sD+AqTrDCs5n+yvLBsL3toAxIfsdHyIERf7joShz3pt1UKKTthwiYcyRg9VVNKEXz7G TU/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=pycLLYCMcrGCzj4pflGzcPY4Wi/H00Hle3hQyYL3Gyg=; b=Tuz+B/0XmIjA6b2SfNaDCyz29tZikxhueIMLb8hHgwU/IZZjHmjgdzF6Xv9wzHDZKM wIbIxZUeFJISqUPs8S4Gb/ikRFQZvvIXgohVj0ai6oEHjdT5fmP5lw6cI0PgzFYWpMhT EcEcQRksvxAvk1ADzUQkacjEHp9OxEZn9H2uqoh4m1qVP+K4KgXx1N9fsE7NqA6J0vGL EYp1f26ijH5TVUgYuEOdhKYXcP2lRA0pHcYx2ANpdWphl4I0m3w+aIKSzYb+wKKgd307 VYdixzN1g3REuIl6AW7HFga4WztCjnOjH7oTcir5d9Vin4pfPnOyu9DVLu5cNMK0YcGn CqQA== X-Gm-Message-State: ACrzQf0TwDFCV7Rdf5DUA1RyvEFHY07VHiri4Bhkbb4roZ7/AoVyicPE dFj0hWmc44AQQgKLbjhLRd7KxjiT7qD7jW2WGhc= X-Google-Smtp-Source: AMsMyM7xFAoZ8HxITqJ1cGMxAksOccfFMs04zkn1VmqXdXYCuA9rydKRWyJpp1/q7vUu0dSk7ZxkscyMIA/Dt0owCg8= X-Received: by 2002:a25:3407:0:b0:6ca:88e8:6f63 with SMTP id b7-20020a253407000000b006ca88e86f63mr12120344yba.175.1666608627403; Mon, 24 Oct 2022 03:50:27 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Roman Perepelitsa Date: Mon, 24 Oct 2022 12:50:14 +0200 Message-ID: Subject: Re: UNICODE Private Use Area characters in BUFFER To: Bart Schaefer Cc: Mikael Magnusson , Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 50834 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 Mon, Oct 24, 2022 at 3:44 AM Bart Schaefer wrote: > > On Sun, Oct 23, 2022 at 6:27 PM Mikael Magnusson wrote: > > > > I think if we should do anything with wcwidth9.h, it's remove it. > > I must be missing something. If glibc already supports unicode9, then > isn't the right thing just for Roman to NOT --enable-unicode9? The behavior w.r.t. Prive Use Area characters in BUFFER is the same whether or not --enable-unicode9 is used. In other words, iswprint() returns false. On Mon, Oct 24, 2022 at 1:36 AM Bart Schaefer wrote: > > On Sun, Oct 23, 2022 at 4:22 PM Roman Perepelitsa > wrote: > > > > This code shows how zsh treats characters from Private Use Area. The > > output doesn't depend on or require a terminal. I wanted to show that > > zsh handles characters from Private Use Area just fine. The only place > > I know of where zsh cannot handle them is BUFFER. > > That's sort of the point? BUFFER does depend on and require a > terminal. Asserting that zsh "handles" those characters in other > contexts isn't indicative of anything beyond demonstrating that > terminal "handling" is a special case. The fact that Private Use Area characters work in PS1 is informative here, as is the expansion of ${(m)#foo}. In both contexts zsh assumes that Private Use Area characters occupy one column. I went ahead and checked how other shells behave if you paste U+E0B0 into the command line. They all output the character as-is. Shells that need to keep track of the cursor position all assume that U+E0B0 is narrow. The shells I tried are: bash, csh, mksh, ash and dash. There is one thing I didn't mention that is relevant. There is at least one terminal (iTerm2) that has an option to treat Private Use Area characters as wide. This option is off by default. Roman.