all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Evgenii Klimov via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 45938@debbugs.gnu.org
Subject: bug#45938: [PATCH] Avoid ANSI escape characters (bug#45938)
Date: Tue, 27 Aug 2024 22:47:05 +0100	[thread overview]
Message-ID: <87zfoxocyu.fsf@lipklim.org> (raw)
In-Reply-To: <87v9bvwn63.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 984 bytes --]

Tags: patch

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__  



In GNU Emacs 30.0.60 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.41, cairo version 1.18.0)
Windowing system distributor 'The X.Org Foundation', version 11.0.12101011
System Description: Guix System

Configured using:
 'configure
 CONFIG_SHELL=/gnu/store/fl3l5wx8qynjrvx5lilz6c38hb77cf36-bash-minimal-5.1.16/bin/bash
 SHELL=/gnu/store/fl3l5wx8qynjrvx5lilz6c38hb77cf36-bash-minimal-5.1.16/bin/bash
 --prefix=/gnu/store/45nwc8hc8fn1fhvr9qw01ylkfpvzxwsw-emacs-next-30.0.60-1.4e22ef8
 --enable-fast-install --with-cairo --with-modules
 --with-native-compilation=aot --disable-build-details'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Avoid-ANSI-escape-characters-bug-45938.patch --]
[-- Type: text/patch, Size: 1150 bytes --]

From d5fb353404814afb135ba98effd200c5733bbcc3 Mon Sep 17 00:00:00 2001
From: Evgenii Klimov <eugene.dev@lipklim.org>
Date: Sun, 25 Feb 2024 20:12:38 +0000
Subject: [PATCH] Avoid ANSI escape characters (bug#45938)

* lisp/progmodes/python.el (python-shell-completion-native-setup):
Avoid escape characters in comint output
---
 lisp/progmodes/python.el | 3 +++
 1 file changed, 3 insertions(+)

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')
 
-- 
2.45.2


  parent reply	other threads:[~2024-08-27 21:47 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 ` Evgenii Klimov via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-08-28 12:00   ` bug#45938: [PATCH] Avoid ANSI escape characters (bug#45938) Eli Zaretskii
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

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

  git send-email \
    --in-reply-to=87zfoxocyu.fsf@lipklim.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=45938@debbugs.gnu.org \
    --cc=eugene.dev@lipklim.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.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.