From owner-svn-src-all@FreeBSD.ORG Tue Dec 24 18:42:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B67ACA1; Tue, 24 Dec 2013 18:42:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 77ED71723; Tue, 24 Dec 2013 18:42:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBOIgRrA021244; Tue, 24 Dec 2013 18:42:27 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBOIgRWh021243; Tue, 24 Dec 2013 18:42:27 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201312241842.rBOIgRWh021243@svn.freebsd.org> From: Ed Schouten Date: Tue, 24 Dec 2013 18:42:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259830 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 18:42:27 -0000 Author: ed Date: Tue Dec 24 18:42:26 2013 New Revision: 259830 URL: http://svnweb.freebsd.org/changeset/base/259830 Log: Fix copy-pasting of CJK fullwidth characters. They are stored as two separate characters in the vtbuf, so copy-pasting will cause them to be passed to terminal_input_char() twice. Extend terminal_input_char() to explicitly discard characters with TF_CJK_RIGHT set. This causes only the left part to generate input. Modified: head/sys/kern/subr_terminal.c Modified: head/sys/kern/subr_terminal.c ============================================================================== --- head/sys/kern/subr_terminal.c Tue Dec 24 18:41:17 2013 (r259829) +++ head/sys/kern/subr_terminal.c Tue Dec 24 18:42:26 2013 (r259830) @@ -249,7 +249,13 @@ terminal_input_char(struct terminal *tm, if (tp == NULL) return; - /* Strip off any attributes. */ + /* + * Strip off any attributes. Also ignore input of second part of + * CJK fullwidth characters, as we don't want to return these + * characters twice. + */ + if (TCHAR_FORMAT(c) & TF_CJK_RIGHT) + return; c = TCHAR_CHARACTER(c); tty_lock(tp);