Date: Tue, 24 Dec 2013 18:42:27 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259830 - head/sys/kern Message-ID: <201312241842.rBOIgRWh021243@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312241842.rBOIgRWh021243>