[pypy-dev] pyrepl: cursor blinks

Armin Rigo arigo at tunes.org
Sat Jun 28 20:20:10 CEST 2008

Hi all,

When I'm running an interactive pypy-c over an ssh connection I notice
that the cursor blinks a bit when I type (it can remain invisible for a
fraction of second).  Normal readline-style editing doesn't give this
result even over laggy connections.  I traced it to
pypy/lib/pyrepl/unix_console.py lines 95 and 97, which are the control
code for hiding and re-showing the cursor, called all the time when
refreshing the display.

I really don't like this, but of course it is not a concern for people
whose terminal's cursor is blinking all the time anyway.

Anyway, if I remove these control codes, I get quite a fine experience
again.  However, I'm sure this is highly dependent on the terminal and I
fear that some terminals might display the cursor moving quickly around
while refreshing is taking place.  If anyone knows of a better solution
to avoid both issues, please do tell :-)  Otherwise, if you feel like
it, could you please try the attached patch in your favourite terminal?
No need to re-translate a pypy-c.  Tell me what your experience is,
running an interactive pypy-c over an ssh connection (preferably laggy).

A bientot,

-------------- next part --------------
Index: unix_console.py
--- unix_console.py	(revision 56155)
+++ unix_console.py	(working copy)
@@ -92,9 +92,9 @@
         self.term = term
         self._bel   = _my_getstr("bel")
-        self._civis = _my_getstr("civis", optional=1)
+        self._civis = None # _my_getstr("civis", optional=1)
         self._clear = _my_getstr("clear")
-        self._cnorm = _my_getstr("cnorm", optional=1)
+        self._cnorm = None # _my_getstr("cnorm", optional=1)
         self._cub   = _my_getstr("cub",   optional=1)
         self._cub1  = _my_getstr("cub1",  1)
         self._cud   = _my_getstr("cud",   1)

More information about the Pypy-dev mailing list