Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Saul Wold <sgw@linux.intel.com>
To: Hongxu Jia <hongxu.jia@windriver.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 1/2] python: fix importing readline with probably escape sequence output
Date: Fri, 19 Jul 2013 11:26:39 -0700	[thread overview]
Message-ID: <51E984DF.2030207@linux.intel.com> (raw)
In-Reply-To: <dce62f416d4a1d8f0acb0f18545868932aff45c9.1374224424.git.hongxu.jia@windriver.com>

On 07/19/2013 02:13 AM, Hongxu Jia wrote:
> While imports readline in python, if TERM in terminfo is available and
> it contains the variable 'km' and 'smm', the readline initialization will
> output the value of 'smm' which is the escape sequence '\E[?1034h'.
>
> 'km' means the terminal has a meta key which is a special key on MIT keyboards
> such as the space-cadet keyboard, and on Sun Microsystems keyboards, marked
> as a solid diamond. It almost doesn't exist in our keyboard, so it has no side
> effect to disable it.
> 'smm' means turn on the meta key if this terminal has one.
>
> Explicitly set meta key off to avoid probable escape sequence output
> while gnu readline library initialization.
>
I am still not sure about this change, there was some discussion that 
the readline library would do be making a similar change and we should 
back port that change.  I contacted the readline maintainer to find out 
about that.

I am going to hold off until I hear from him.

Sau!

> [YOCTO #4835]
> [YOCTO #4732]
>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
>   meta/recipes-devtools/python/python.inc            |  4 +-
>   ...-to-avoid-probable-escape-sequence-output.patch | 43 ++++++++++++++++++++++
>   2 files changed, 46 insertions(+), 1 deletion(-)
>   create mode 100644 meta/recipes-devtools/python/python/readline-set-meta-key-off-to-avoid-probable-escape-sequence-output.patch
>
> diff --git a/meta/recipes-devtools/python/python.inc b/meta/recipes-devtools/python/python.inc
> index 80609a8..9f787c9 100644
> --- a/meta/recipes-devtools/python/python.inc
> +++ b/meta/recipes-devtools/python/python.inc
> @@ -7,7 +7,9 @@ INC_PR = "r0"
>
>   LIC_FILES_CHKSUM = "file://LICENSE;md5=ed3abfd1059e2d3a36a8cff3986f9bb6"
>
> -SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2"
> +SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \
> +           file://readline-set-meta-key-off-to-avoid-probable-escape-sequence-output.patch \
> +"
>
>   SRC_URI[md5sum] = "c57477edd6d18bd9eeca2f21add73919"
>   SRC_URI[sha256sum] = "726457e11cb153adc3f428aaf1901fc561a374c30e5e7da6742c0742a338663c"
> diff --git a/meta/recipes-devtools/python/python/readline-set-meta-key-off-to-avoid-probable-escape-sequence-output.patch b/meta/recipes-devtools/python/python/readline-set-meta-key-off-to-avoid-probable-escape-sequence-output.patch
> new file mode 100644
> index 0000000..104fc36
> --- /dev/null
> +++ b/meta/recipes-devtools/python/python/readline-set-meta-key-off-to-avoid-probable-escape-sequence-output.patch
> @@ -0,0 +1,43 @@
> +readline:explicitly set meta key off to avoid probable escape sequence output
> +
> +While imports readline in python, if TERM in terminfo is available and
> +it contains the variable 'km' and 'smm', the readline initialization will
> +output the value of 'smm' which is the escape sequence '\E[?1034h'.
> +
> +'km' means the terminal has a meta key which is a special key on MIT keyboards
> +such as the space-cadet keyboard, and on Sun Microsystems keyboards, marked
> +as a solid diamond. It almost doesn't exist in our keyboard, so it has no side
> +effect to disable it.
> +'smm' means turn on the meta key if this terminal has one.
> +
> +Explicitly set meta key off to avoid probable escape sequence output
> +while gnu readline library initialization.
> +
> +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> +Upstream-Status: inappropriate [oe specific]
> +---
> + Modules/readline.c | 9 +++++++++
> + 1 file changed, 9 insertions(+)
> +
> +diff --git a/Modules/readline.c b/Modules/readline.c
> +--- a/Modules/readline.c
> ++++ b/Modules/readline.c
> +@@ -909,6 +909,15 @@ setup_readline(void)
> + 	rl_read_init_file(NULL);
> +     else
> + #endif /* __APPLE__ */
> ++
> ++    /* Explicitly set meta key off to avoid probable escape sequence output
> ++     * while gnu readline library initialization. The meta key is a special
> ++     * key in MIT keyboards such as the space-cadet keyboard, and on Sun
> ++     * Microsystems keyboards, marked as a solid diamond. It almost doesn't
> ++     * exist in our keyboards, so it has no side effect to disable it.
> ++     */
> ++    rl_variable_bind("enable-meta-key", "off");
> ++
> +         rl_initialize();
> +
> +     RESTORE_LOCALE(saved_locale)
> +--
> +1.8.1.2
> +
>


  reply	other threads:[~2013-07-19 18:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-19  9:13 [PATCH V2 0/2] python: fix importing readline with probably escape sequence output Hongxu Jia
2013-07-19  9:13 ` [PATCH 1/2] " Hongxu Jia
2013-07-19 18:26   ` Saul Wold [this message]
2013-07-22  5:18     ` Saul Wold
2013-07-22  5:20       ` Hongxu Jia
2013-07-19  9:13 ` [PATCH 2/2] python-native: remove unused and duplicated sitecustomize.py Hongxu Jia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51E984DF.2030207@linux.intel.com \
    --to=sgw@linux.intel.com \
    --cc=hongxu.jia@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox