unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Evgenii Klimov <eugene.dev@lipklim.org>, kobarity <kobarity@gmail.com>
Cc: 45938@debbugs.gnu.org
Subject: bug#45938: [PATCH] Avoid ANSI escape characters (bug#45938)
Date: Wed, 28 Aug 2024 15:00:06 +0300	[thread overview]
Message-ID: <861q28j1rt.fsf@gnu.org> (raw)
In-Reply-To: <87zfoxocyu.fsf@lipklim.org> (bug-gnu-emacs@gnu.org)

> Date: Tue, 27 Aug 2024 22:47:05 +0100
> From:  Evgenii Klimov via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> GNU Readline variables (colored-completion-prefix and colored-stats) set
> in .inputrc file by the user to improve GNU Readline output lead to
> corrupted completion candidates during native completion setup.
> 
> Like this:
> 
> ^[[01;35m0^[[0m^[[K__dummy_completion__  ^[[01;35m1^[[0m^[[K__dummy_completion__  
> 
> However this is expected:
> 
> 0__dummy_completion__  1__dummy_completion__  

kobarity, any comments to the suggested patch?

> diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
> index a00289d6de9..7193cc19425 100644
> --- a/lisp/progmodes/python.el
> +++ b/lisp/progmodes/python.el
> @@ -4549,6 +4549,9 @@ (defun python-shell-completion-native-setup ()
>              readline.parse_and_bind('tab: complete')
>              # Require just one tab to send output.
>              readline.parse_and_bind('set show-all-if-ambiguous on')
> +            # Avoid ANSI escape characters in the output
> +            readline.parse_and_bind('set colored-completion-prefix off')
> +            readline.parse_and_bind('set colored-stats off')
>              # Avoid replacing common prefix with ellipsis.
>              readline.parse_and_bind('set completion-prefix-display-length 0')
>  

Are these commands available in every version of Python?





  reply	other threads:[~2024-08-28 12:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-17 16:20 bug#45938: 28.0.50; python native completion fails with fancier readline settings Zoltán Vandrus
2022-06-07 14:05 ` Lars Ingebrigtsen
2024-08-27 21:47 ` bug#45938: [PATCH] Avoid ANSI escape characters (bug#45938) Evgenii Klimov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-28 12:00   ` Eli Zaretskii [this message]
2024-08-28 16:28     ` Evgenii Klimov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-28 17:55       ` Eli Zaretskii
2024-08-28 20:39         ` Evgenii Klimov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-29  4:47           ` Eli Zaretskii
2024-08-29 12:20             ` kobarity
2024-08-31 10:14               ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=861q28j1rt.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=45938@debbugs.gnu.org \
    --cc=eugene.dev@lipklim.org \
    --cc=kobarity@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).