[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#31115: 26.1; python shell flicker

From: Andreas Röhler
Subject: bug#31115: 26.1; python shell flicker
Date: Thu, 12 Apr 2018 08:20:39 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 09.04.2018 20:19, Charles A. Roelli wrote:
emacs -q
M-x run-python RET C-x o

Now press and hold down RET: a lot of prompts fly by, and as soon as
point reaches the bottom of the window, there is some flicker where
the cursor momentarily appears centered (as if `recenter' was run) and
simultaneously all the text in the buffer blinks as if the whole
screen was cleared and redrawn.  In contrast, if you try this same
recipe in a normal shell buffer from M-x shell, there won't be any

Obviously, the above recipe is not a standard use case for a shell
buffer, but the same flicker is observed during normal use too.

A naive fix is to comment out the meat of python-comint-postoutput-
scroll-to-bottom, and reevaluate it:

(defun python-comint-postoutput-scroll-to-bottom (output)
   "Faster version of `comint-postoutput-scroll-to-bottom'.
Avoids `recenter' calls until OUTPUT is completely sent."
   ;; (when (and (not (string= "" output))
   ;;            (python-shell-comint-end-of-output-p
   ;;             (ansi-color-filter-apply output)))
   ;;   (comint-postoutput-scroll-to-bottom output))

I have no idea why that works, but it seems to help.  The function in
question was added in the following commit:

   commit a6dc66a5441bc6832c12d362edd2d886edc1612a
   Author: Fabián Ezequiel Gallina <address@hidden>
   Date:   Sat Jul 26 23:02:38 2014 -0300

       Faster comint output.

       * lisp/progmodes/python.el:
       (python-comint-output-filter-function): Make obsolete.
       (python-comint-postoutput-scroll-to-bottom): New function.
       (inferior-python-mode): Set comint-output-filter-functions to a

       Fixes: debbugs:16875

Can't reproduce with GNU Emacs 26.1 (build 1, i686-pc-linux-gnu, GTK+ Version 3.14.5) of 2018-04-10 at Debian

reply via email to

[Prev in Thread] Current Thread [Next in Thread]