From owner-freebsd-stable@freebsd.org Tue Dec 22 02:17:51 2020 Return-Path: Delivered-To: freebsd-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CB194AC836 for ; Tue, 22 Dec 2020 02:17:51 +0000 (UTC) (envelope-from yuripv@yuripv.dev) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D0Kk60zTWz4qxM for ; Tue, 22 Dec 2020 02:17:49 +0000 (UTC) (envelope-from yuripv@yuripv.dev) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 65E555C01DA; Mon, 21 Dec 2020 21:17:49 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 21 Dec 2020 21:17:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yuripv.dev; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=w v8zrWGRuUSxZGrOnzC0wWh3ocm2jwS1eCn6bhj51zs=; b=NyPtz+OZTuVqubCPu nxuUIChPUd+Z/bRZwlSl0IAVPMJ9IBu5YRvl85o1QBLnrkdmYIKo+kweLUVBgUYC G7f4Tg8J+oLtMLVmp4MqCvdRetizEg7LzQ1xd+WiPbpYQ8WKe233WuN7x/VpyaGh LT66o7UF1mwCFfTMqufGCL/dEA3TB6zbveqJzk8gCw8uYoWTq7UfUHe9goI2iQEd xqB9e51+hi8O43fzk6Mkb2+Dn7rv+BuJ8iFUdXOQfrvq/XjeCGSXW1xMkSLGVCTb E1jK7kSkpf+nWRc9V2dUHqu2Hg/CombFSTcTD8UK38oZIPI07vNa8aTEV3Oq6c/M glyyw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=wv8zrWGRuUSxZGrOnzC0wWh3ocm2jwS1eCn6bhj51 zs=; b=IRhcPyqYrGMkdEhngtlvtFGggg/gwpfocF6qV4VPmdWuPzMHRxviwN3hj rFJfaEgE77qxIWV+z8jZYzXkoRUtoas85mzNarf8N4s0L52TZuxzaJ3jBJOJbEmz TWJEV8aeUa2DlAaxxvmOcBbpek7jrOaTMIeg+wVusjxTm+7rDdDdIeMMY2Fsi+HD mPIgwntGzs/GOWD6Lk8B93V3vkuF76oLiVu6qtmVFgwaUKOc27UTvmi0Haqjommg fJ263H09WapuKrFvhfWmTjx9O+lfLi/RN6aQ3M1s8CPYsjLeYOtC/P0JEC2qlQeB 83u5BLPdz43e9j8vS8n4RwTtxPH3A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvddtfedggeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtje ertddtfeejnecuhfhrohhmpegjuhhrihcurfgrnhhkohhvuceohihurhhiphhvseihuhhr ihhpvhdruggvvheqnecuggftrfgrthhtvghrnhepieekteeftdeftdekhfffueeljeefff fgffffuefhhefgheejvdegfeehieevudfgnecuffhomhgrihhnpehfrhgvvggsshgurdho rhhgnecukfhppeeluddrvdegtddruddvgedrudehjeenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeihuhhrihhpvheshihurhhiphhvrdguvghv X-ME-Proxy: Received: from [192.168.1.6] (unknown [91.240.124.157]) by mail.messagingengine.com (Postfix) with ESMTPA id 7A2B6108005B; Mon, 21 Dec 2020 21:17:48 -0500 (EST) Subject: Re: 12.2-STABLE: Something has broken the bash prompt To: Christian Weisgerber , freebsd-stable@freebsd.org References: From: Yuri Pankov Message-ID: <9560e43c-6da4-e90b-d579-b7bbd9b46902@yuripv.dev> Date: Tue, 22 Dec 2020 05:17:46 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4D0Kk60zTWz4qxM X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yuripv.dev header.s=fm1 header.b=NyPtz+OZ; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=IRhcPyqY; dmarc=none; spf=pass (mx1.freebsd.org: domain of yuripv@yuripv.dev designates 66.111.4.27 as permitted sender) smtp.mailfrom=yuripv@yuripv.dev X-Spamd-Result: default: False [-3.60 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:66.111.4.27]; RWL_MAILSPIKE_GOOD(0.00)[66.111.4.27:from]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[yuripv.dev:+,messagingengine.com:+]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[66.111.4.27:from]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[66.111.4.27:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[yuripv.dev:s=fm1,messagingengine.com:s=fm1]; FREEFALL_USER(0.00)[yuripv]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[yuripv.dev]; SPAMHAUS_ZRD(0.00)[66.111.4.27:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MAILMAN_DEST(0.00)[freebsd-stable] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2020 02:17:51 -0000 Christian Weisgerber wrote: > I updated my 12.2-STABLE system from circa December 10 to the last > stable/12 SVN commit and now my bash prompt is broken. > > I use a prompt with properly delineated non-printing characters: > > PS1="\[$(tput so)\]\u@\h\[$(tput se)\][\w] " > > Suddenly bash is very confused about the size of the prompt. To > reproduce the problem, set PS1 as above, type a few characters, hit > ^A to go to the beginning of the line, type some more, see the mess. > > A prompt without non-printing characters is perfectly fine. > The problem is evident with LC_CTYPE=C.UTF-8, but LC_CTYPE=C is > fine. > > Yes, there have been recent updates to the bash port. But I checked > several versions, and 5.0.18, 5.1, and 5.1.4 are equally affected. > And I was already running 5.1 before the problem appeared after I > updated base. > > So I have reason to suspect that the breakage originates in base. > I've looked over the stable/12 commits starting December 10 and I > am very suspicious of yuripv's locale changes, in particular > "update wcwidth data from utf8proc" looks like a potential culprit. > > Any insights? Correct, my mistake -- I failed to see the (not so) subtle difference between values returned by wcwidth() and utf8proc_charwidth() for non-printable characters. Will fix once the repos are back; for the moment you can drop the following file to tools/tools/locale/etc/final-maps/ and rebuild/reinstall ctype data in share/ctypedef/ (don't forget `make clean` there first, known issue): https://people.freebsd.org/~yuripv/widths.txt