GNU bug report logs - #71440
Python Inferior Mode Can’t Recognize My Prompt

Previous Next

Package: emacs;

Reported by: "shynur ." <one.last.kiss <at> outlook.com>

Date: Sat, 8 Jun 2024 16:36:01 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "shynur ." <one.last.kiss <at> outlook.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "71440 <at> debbugs.gnu.org" <71440 <at> debbugs.gnu.org>
Subject: bug#71440: Python Inferior Mode Can’t Recognize My Prompt
Date: Sun, 9 Jun 2024 10:11:29 +0000
> You expect that to show colors in Emacs as well?

I don’t care about the color of Python’s prompt in Emacs,
because Emacs has its own color scheme which looks nice!

As long as Python Inferior Mode displays those two
characters (‘►’ and ‘▻’) correctly I’ll happy.

Actually it DOES - there’s no problem when I use Python 
Inferior Mode directly.

The problem occurs when I call ‘python-shell-send-buffer’
from a Python buffer, as mentioned in my original post:
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71440#5>.

> I suggest to define PS1 and PS2 specially for the inferior Python.

I have to say that this is hard to implement cleanly.

I’ve tried:

    (setopt python-shell-interpreter-args "-i -c sys.ps1,sys.ps2='►▻'")

but it turned out that the ‘PYTHONSTARTUP’ file is loaded 
after the statement following ‘-c’ is executed.

______

I think this can be a feature request: provide an option 
to ignore any setting-color character sequence (eg `\033[32m`)
in XXYYZZ Inferior Mode, because there’re so many REPL
apps using a colored prompt and Emacs may not handle them
properly.

This bug report was last modified 1 year and 38 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.