From nobody Wed Jun 22 12:53:01 2022 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 17F9885F65E for ; Wed, 22 Jun 2022 12:53:06 +0000 (UTC) (envelope-from tezeka@hotmail.com) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02olkn2074.outbound.protection.outlook.com [40.92.44.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LSjwd0wGWz3P2j for ; Wed, 22 Jun 2022 12:53:05 +0000 (UTC) (envelope-from tezeka@hotmail.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BWeLHL+0q6vAZ8ZyogbdJJDCClw1MS5cxGnvdrFdK2xaBBpbxF7urQfq8g7dgdRbHQCmeF4GTdGO8467hSiH4xl4UdoODCA7qZ6yxUZ/e0VAhrsIz40TdPdQ8hUhDv29iIr/1ZX1ijSD60WRIqMGO61PrTOmZjdV4fFaqxNmS/zhDB+OnGfB8dQUcaB4/hDKMKhiC1cqgZDiRGLS2QjdP7a/qDcGGlN+SlKyi7pbaukDSj/NTCXixsSCj0pX8VScMczA2K+rvWdhIi/drJ9p1V2DtzgeedX2/77Q7jkiPbL9X3VN1ZqUqEvZac73cYRgHrPqZAYX2w1YuHFuxN3SRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bLdCcW6zvcs00dYVeQRltit19kF2MfbBcgYpr6CwPbE=; b=j3eXzdl9hTKzEj7c6sSASYSOJk4YxRwZk8LKr9nOT78o8OHGTQPreThyHg+k7m8tMOGc+64jKXzv97TO7RzI8ZghyoDBSqlVOXh5umhvpodkMmxHk3yEVK3kuoX3zeD7oVwDBHYbd+HsBc92LwSJuSzH6cSAArQRnmEJKyb4GbsEqbS+xDPaXUMnaK2VRRtiVmnZTaDRLwWJA/qmFcFN3ghPsja9xynAAQ4iYCsF7anYYEj2MIGRCka5gdZFfAeNeLtKyyiv/sG7xOupvfoc+0Bp2LUnVk4es8pbT3oFIpiMFR76aoRfI6upl92S5DhwqvCmxzYsZB9O9EZou5Gj5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bLdCcW6zvcs00dYVeQRltit19kF2MfbBcgYpr6CwPbE=; b=PMp7y44w7dIPIi8DJYP5o02YC2TFInwvJnKszk5jvfdNnhiwtVOVym+YWWQjSuYazvDKXeWFLA0Qobx0UELBv4/Bqv+q9rf/ZsFAiIGf67vs5TMIjcSNC+y5GeF+WKyankaoZQjdOj5IM7n9zRsy0wGA/sf6Nzqliok7u+GHxg0oqUdRyHhbrtw0KJq0djei/6VqjyEKtNziAGnaHa+Fgeos8IiNhUAHPzOt/5eZ/jhEbkuHWUIE6vFd6Sud2LNcSoBtC2EFNyy2Dr9deNo748ufUekZS5m6bicILrrIKb20jIAsral98wJINFkgvgO/1HQOG2HbVUYsDTKsfSR8Aw== Received: from CP6P284MB1900.BRAP284.PROD.OUTLOOK.COM (2603:10d6:103:118::12) by FRBP284MB0649.BRAP284.PROD.OUTLOOK.COM (2603:10d6:203:30::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.16; Wed, 22 Jun 2022 12:53:03 +0000 Received: from CP6P284MB1900.BRAP284.PROD.OUTLOOK.COM ([fe80::9d3d:d0fe:1196:ff34]) by CP6P284MB1900.BRAP284.PROD.OUTLOOK.COM ([fe80::9d3d:d0fe:1196:ff34%7]) with mapi id 15.20.5353.022; Wed, 22 Jun 2022 12:53:03 +0000 Date: Wed, 22 Jun 2022 09:53:01 -0300 (-03) From: Ivan Quitschal To: freebsd-current@freebsd.org Subject: vt newcons mouse paste issue FIXED Message-ID: Content-Type: multipart/mixed; boundary="3432851520-594251130-1655902382=:1623" X-TMN: [wZQx5lCSHDBF6tlWoGBKI5A/4KqALRSP] X-ClientProxiedBy: CP4P284CA0006.BRAP284.PROD.OUTLOOK.COM (2603:10d6:103:128::6) To CP6P284MB1900.BRAP284.PROD.OUTLOOK.COM (2603:10d6:103:118::12) X-Microsoft-Original-Message-ID: <9d52fa3-2e2d-90fc-42a-1ab0e9baec@hotmail.com> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 017ff130-27e0-466c-4a5b-08da544e24ae X-MS-TrafficTypeDiagnostic: FRBP284MB0649:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DbOOmyLsVI4BWr6KnUv25eAW0Sth8t1XXVKpoV2eSkciVq8Kk4CEo4k1rr1Lp4EoywO6pPe9CiThxg8g+zTYDptCT+NuVJPehqlXnF8AokAdMCTyYVL9hqdjKxxInTgXieDhuSVAHwadr1dURSkLLrLM+Lbh+Zm/G+om/ZH2YBL2V5ZBdt4aDs4JUC6Scim7viXXUfbKadb+uS5SZITd+WRqZ1CPHWzvLIcMYZwmCX4nTsENtCwrzANsBcWpt0YxKbeevKpdh8OzZqXL+Zgn7a7A9iyZgtOMuGimT8TQP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EQIUBNO6sg+mI0ZvePg9Bi30WmPYSrOB3Q/8s66mQOhTb0?= =?us-ascii?Q?KrHMrkkSj10=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-7dc52.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 017ff130-27e0-466c-4a5b-08da544e24ae X-MS-Exchange-CrossTenant-AuthSource: CP6P284MB1900.BRAP284.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2022 12:53:02.9992 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: FRBP284MB0649 X-Rspamd-Queue-Id: 4LSjwd0wGWz3P2j X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hotmail.com header.s=selector1 header.b=PMp7y44w; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=hotmail.com; spf=pass (mx1.freebsd.org: domain of tezeka@hotmail.com designates 40.92.44.74 as permitted sender) smtp.mailfrom=tezeka@hotmail.com X-Spamd-Result: default: False [-2.85 / 15.00]; FREEMAIL_FROM(0.00)[hotmail.com]; R_SPF_ALLOW(-0.20)[+ip4:40.92.0.0/15]; HAS_ATTACHMENT(0.00)[]; TO_DN_NONE(0.00)[]; MIME_BASE64_TEXT_BOGUS(1.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[hotmail.com:+]; MIME_BASE64_TEXT(0.10)[]; CTYPE_MIXED_BOGUS(1.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[hotmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; ASN(0.00)[asn:8075, ipnet:40.80.0.0/12, country:US]; FREEMAIL_ENVFROM(0.00)[hotmail.com]; DWL_DNSWL_NONE(0.00)[hotmail.com:dkim]; NEURAL_HAM_MEDIUM(-0.95)[-0.954]; R_DKIM_ALLOW(-0.20)[hotmail.com:s=selector1]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/mixed,text/plain]; RCPT_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[40.92.44.74:from]; MLMMJ_DEST(0.00)[freebsd-current] X-ThisMailContainsUnwantedMimeParts: N --3432851520-594251130-1655902382=:1623 Content-Type: text/plain; format=flowed; charset=US-ASCII Hi All About this anoying paste error we still have in vt console, I looked it up and couldnt find any fix regarding this, so i did it. Please find attached the fixed version of /usr/src/sys/dev/vt/vt_buf.c with trim spaces and aligned to the console size. I've tested with other fonts and looks fine in here. I hope this can help other ppl which finds this terminal mouse paste issue a pain in the neck. thanks --tzk --3432851520-594251130-1655902382=:1623 Content-Type: text/plain; charset=US-ASCII; name=vt_buf.c Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: vt_buf.c Content-Disposition: attachment; filename=vt_buf.c LyotDQogKiBTUERYLUxpY2Vuc2UtSWRlbnRpZmllcjogQlNELTItQ2xhdXNlLUZyZWVCU0QNCiAq DQogKiBDb3B5cmlnaHQgKGMpIDIwMDksIDIwMTMgVGhlIEZyZWVCU0QgRm91bmRhdGlvbg0KICoN CiAqIFRoaXMgc29mdHdhcmUgd2FzIGRldmVsb3BlZCBieSBFZCBTY2hvdXRlbiB1bmRlciBzcG9u c29yc2hpcCBmcm9tIHRoZQ0KICogRnJlZUJTRCBGb3VuZGF0aW9uLg0KICoNCiAqIFBvcnRpb25z IG9mIHRo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