After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 514632 - Problem with cursor in emacs in gnome-terminal
Problem with cursor in emacs in gnome-terminal
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: VTE Maintainers
VTE Maintainers
: 529304 530644 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-02-05 22:23 UTC by Maciej (Matthew) Piechotka
Modified: 2009-08-20 19:20 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Script (8.61 KB, application/octet-stream)
2008-02-05 23:56 UTC, Maciej (Matthew) Piechotka
Details
Timing (2.99 KB, text/plain)
2008-02-05 23:56 UTC, Maciej (Matthew) Piechotka
Details
typescript (8.12 KB, text/plain)
2008-09-17 07:37 UTC, Per Olofsson
Details
timing (2.88 KB, text/plain)
2008-09-17 07:37 UTC, Per Olofsson
Details
better typescript (8.81 KB, text/plain)
2008-09-17 07:42 UTC, Per Olofsson
Details
better timing (2.40 KB, text/plain)
2008-09-17 07:42 UTC, Per Olofsson
Details
typescript for emacs -nw test.cc: 012345 6 (2.98 KB, text/plain)
2008-09-17 08:22 UTC, Oscar
Details
timing for testscript.0 (731 bytes, text/plain)
2008-09-17 08:23 UTC, Oscar
Details

Description Maciej (Matthew) Piechotka 2008-02-05 22:23:35 UTC
Please describe the problem:
If run under gnome-terminal some whitespaces are shown as solid blocks.

Also described in (problem is not debian specific as I am using Gentoo ;) ):
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=455688
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=457483


Steps to reproduce:
1. Open gnome teminal
2. Start emacs
3. Write some text


Actual results:
Some█text with witespaces.

Expected results:
Some text with witespaces.

Does this happen every time?
Only some whitespaces

Other information:
Portage 2.1.4.1 (default-linux/x86/2007.0/desktop, gcc-4.2.2, glibc-2.7-r1, 2.6.24-zen1 i686)
=================================================================
System uname: 2.6.24-zen1 i686 Intel(R) Celeron(R) M processor 1.50GHz
Timestamp of tree: Tue, 05 Feb 2008 03:00:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.4
dev-lang/python:     2.5.1-r5
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.24
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium-m -mfpmath=sse -pipe -momit-leaf-frame-pointer -ggdb -w -ftree-vectorize -ftree-loop-optimize"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=pentium-m -mfpmath=sse -pipe -momit-leaf-frame-pointer -ggdb -w -ftree-vectorize -ftree-loop-optimize"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks metadata-transfer parallel-fetch sandbox sfperms splitdebug unmerge-orphans userfetch userpriv"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--add-needed -Wl,--as-needed"
LINGUAS="en_GB en_US pl"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/java-overlay /usr/portage/local/layman/gnome /usr/portage/local/layman/custom-kernels /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aac acl acpi alsa applet attr avahi avalon bash-completion berkdb bitmap-fonts bittorrent boo browseplugin bzip2 cairo calendar caps cddb cdparanoia cdr cli cracklib crypt cups curl curlwrappers d daap dbus deskbar devhelp disk-partition djvu dri dvd dvdr dvdread eclipse eds emacs emboss encode esd evo evolution exif expat extra fam ffmpeg firefox flac flash fortran fuse galago gcj gconf gd gdbm gdl gedit gif gimp glut gmail gmp gnome gnutls gpm gsf gstreamer gtk guile hal iconv idle imap inotify ipod iproute2 ipv6 isdnlog jabber java java5 jpeg jpeg2k jython kerberos keyring laptop latex libburn libgda libnotify libsexy logrotate lucene mad madwifi maildir mhash midi mikmod mmap mmx mono mozilla mp3 mpeg mudflap mule musicbrainz nautilus ncurses network networkmanager nls nntp no-old-linux nptl nptlonly nsplugin ntpl ogg oggvorbis openal opengl openmp pam pango pbm pcmcia pcre pdf perl png pop postgres pppd pulseaudio python quicktime readline reflection regex reiserfs resolvconf rhino ruby samba sbcl scanner sdl session soap sourceview spell spl sqlite sqlite3 sse sse2 ssh ssl subversion svg symlink syslog tcpd tetex theora threads threadsafe tiff timidity totem tracker trayicon truetype truetype-fonts type1-fonts unicode usb vim vorbis vte wifi wxwindows x86 xattr xcb xforms xhtml xml xml2 xorg xsl xulrunner xv zeroconf zlib" ALSA_CARDS="atiixp" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="panasonic" ELIBC="glibc" INPUT_DEVICES="evdev mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB en_US pl" USERLAND="GNU" VIDEO_CARDS="fglrx radeon"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Chris Wilson 2008-02-05 23:15:08 UTC
The debian bug reports suggest that they see the artifact with a blinking cursor - can you reproduce this bug with a non-blinking cursor? [I've not seen this problem in my brief attempts to reproduce it using emacs with/without blinking cursors.]

If you can reproduce this easily, then could you record your session under script and attach the output. I'd imagine the timing information is also a critical factor, so I'd suggest invoking script like:
$ script -t bug514632.script 2>bug514532.timing

Thanks in advance.
Comment 2 Maciej (Matthew) Piechotka 2008-02-05 23:56:01 UTC
Created attachment 104528 [details]
Script

How to switch off the blinking cursor?

PS.
After switching the tabs in gt the artefact dissappeared.
Comment 3 Maciej (Matthew) Piechotka 2008-02-05 23:56:49 UTC
Created attachment 104529 [details]
Timing
Comment 4 Chris Wilson 2008-02-06 13:00:47 UTC
Thanks Maciej, replaying that script triggers the bug. Hmm, the blinking cursor option has been removed from the preferences dialog and now relies on the gtk-cursor-blink setting.
Comment 5 Maciej (Matthew) Piechotka 2008-02-06 13:03:42 UTC
Is it:
1. In gnome-config-daemon?
2. In gtkrc?
3. In gcong?
Comment 6 Per Olofsson 2008-04-30 09:19:39 UTC
Hi,

The cursor_blink option can be found in /desktop/gnome/interface/ in gconf (configuration editor). However, disabling the blinking cursor does not fix the problem for me.
Comment 7 baron 2008-05-26 11:22:12 UTC
I too have this problem in Fedora 9.  Turning off the cursor_blink option seemed to help a little.  The problem seemed to occur less often.  But it did still happen.  It does not happen with xterm.  I use white text on a black background, so the extra blocks in whitespace are actually white. :)
Comment 8 baron 2008-06-10 20:20:44 UTC
Reading some other reports of this bug, I found that I (and some others) can make it disappear by adding
(setq column-number-mode 1)
to your .emacs file.
Comment 9 Maciej (Matthew) Piechotka 2008-06-14 13:24:32 UTC
Well. It still seems to be a VTE bug. Nice that there is a quick fixup but it is not a solution.
Comment 10 Maciej (Matthew) Piechotka 2008-06-16 07:12:41 UTC
(In reply to comment #8)
> Reading some other reports of this bug, I found that I (and some others) can
> make it disappear by adding
> (setq column-number-mode 1)
> to your .emacs file.
> 

It do not seems to work for me...
Comment 11 Behdad Esfahbod 2008-09-17 03:44:55 UTC
I'm still to reproduce this.  No one says what I need to do to reproduce.

What I need is someone to run it inside script(1) with timing enabled.  That is, do:

script -t 2>timing

Then inside that run emacs and reproduce the problem, then exit emacs and exit script.  Attach the files "timing" and "typescript" here.
Comment 12 Per Olofsson 2008-09-17 07:37:31 UTC
Created attachment 118861 [details]
typescript
Comment 13 Per Olofsson 2008-09-17 07:37:55 UTC
Created attachment 118862 [details]
timing
Comment 14 Per Olofsson 2008-09-17 07:42:04 UTC
Created attachment 118863 [details]
better typescript
Comment 15 Per Olofsson 2008-09-17 07:42:30 UTC
Created attachment 118864 [details]
better timing
Comment 16 Per Olofsson 2008-09-17 07:43:51 UTC
(In reply to comment #11)
> I'm still to reproduce this.  No one says what I need to do to reproduce.
> 
> What I need is someone to run it inside script(1) with timing enabled.  That
> is, do:
> 
> script -t 2>timing
> 
> Then inside that run emacs and reproduce the problem, then exit emacs and exit
> script.  Attach the files "timing" and "typescript" here.
> 

OK, here you are.

The two last files demonstrate the problem more clearly.
Comment 17 Oscar 2008-09-17 08:21:17 UTC
(In reply to comment #11)
> I'm still to reproduce this.  No one says what I need to do to reproduce.
> 
> What I need is someone to run it inside script(1) with timing enabled.  That
> is, do:
> 
> script -t 2>timing
> 
> Then inside that run emacs and reproduce the problem, then exit emacs and exit
> script.  Attach the files "timing" and "typescript" here.
> 

emacs -nw test.cc
012345 6

after the '5', a black box will appear.
Emacs 22.2.1
gnome-terminal 2.23.91

(see typescript.0 and timing.0 attached)
Comment 18 Oscar 2008-09-17 08:22:26 UTC
Created attachment 118865 [details]
typescript for emacs -nw test.cc: 012345 6

typescript captured from emacs -nw test.cc, followed by "012345 6'
Comment 19 Oscar 2008-09-17 08:23:23 UTC
Created attachment 118866 [details]
timing for testscript.0

timing for testscript.0, emacs -nw test.cc: 012345 6
Comment 20 Dan Davison 2008-10-07 13:42:24 UTC
I've just upgraded to gnome 2.24.0 (build date 22/09/08) under ubuntu 8.10 and this bug persists. For me the (setq column-number-mode 1) workaround worked initially for some weeks and then stopped working (under ubuntu 8.04, gnome 2.22?). I have blink-cursor enabled in neither emacs nor gconf.
Comment 21 Oscar 2008-10-12 05:47:54 UTC
Behdad,

If you don't have the time or inclination to fix this bug, perhaps you should roll back the change that introduced this bug, since that has already been identified by other people.  The last time I looked at this change, it seemed like a performance optimization to opportunistically send tabs instead of spaces.

The correctness/full functionality trumps the occasional opportunity to avoid sending a few extra characters, so a roll-back is clearly appropriate, pending a full fix.
Comment 22 Christian Persch 2008-10-12 12:09:04 UTC
(In reply to comment #21)
> perhaps you should
> roll back the change that introduced this bug, since that has already been
> identified by other people.

It has? Where? There's no info in this bug specifying the exact SVN revision that introduced this bug. Have you bisected vte to find it?
Comment 23 Oscar 2008-10-12 21:45:42 UTC
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=455688#29

Here is part of that post to bugs.debian.org on August 20th:

* I believe this problem was introduced by the revision 1996.
  http://svn.gnome.org/viewvc/vte?view=revision&revision=1996

| 2007-11-27  Behdad Esfahbod  <behdad@gnome.org>
|
|     Bug 353610 – Don't convert tab characters upon copying
|
|     * src/vte-private.h:
|     * src/vteseq.c (vte_sequence_handler_ta):
|     Smart tab handling to try to preserve tab character upong copying.
|     Also makes such smart tabs all-or-none selectable.


  The problem seems to dissapear when I replace the definition of
  vte_sequence_handler_ta() in vteseq.c with the one from the revision
  1995.

Comment 24 Oscar 2008-10-27 00:22:28 UTC
We have tracked down the problem, submitted script snapshots to reproduce the problem, even identified the checkin that caused the breakage.

And yet the problem is not yet resolved.  How can you be so delinquent?  You break a critical component, and then you refuse to fix it.

Please roll it back or fix it.  And try to find someone else to maintain this component if you do not have the resources.
Comment 25 Behdad Esfahbod 2008-10-27 00:31:12 UTC
(In reply to comment #24)
> We have tracked down the problem, submitted script snapshots to reproduce the
> problem,

Yes, this was done on Sep 17.  A mere five weeks ago.


> even identified the checkin that caused the breakage.

That's not the interesting part.  I knew which commit has caused it.


> And yet the problem is not yet resolved.

So?

> How can you be so delinquent?

Thanks.  I love you too.

> You break a critical component, and then you refuse to fix it.

I'm working on a fix.  Will be done in a few days.  This broken critical component have still been working for thousands.  Only a few people have been experiencing this bug and bothered enough to report.  I appreciate all the reports, and this is the top priority bug on my list to fix.

If you want a rollback, ask your distro.  We don't fix bugs by rolling back upstream.


> Please roll it back or fix it.  And try to find someone else to maintain this
> component if you do not have the resources.

Want to maintain it?  You're more than happy to.  And if you think we are currently doing a bad job at it, you should have seen what it was like before I picked it up, there were no maintainers to begin with.
Comment 26 Behdad Esfahbod 2008-11-29 05:57:31 UTC
*** Bug 529304 has been marked as a duplicate of this bug. ***
Comment 27 Behdad Esfahbod 2008-11-29 06:13:42 UTC
Should be fixed in trunk.  Please test.  I'll look into pushing it into a stable release after confirmation.

2008-11-29  Behdad Esfahbod  <behdad@gnome.org>

        Bug 514632 – Problem with cursor in emacs in gnome-terminal

        * src/vte-private.h:
        * src/vte.c (_vte_terminal_cleanup_tab_fragments_at_cursor),
        (_vte_terminal_insert_char):
        * src/vteseq.c (vte_sequence_handler_ch),
        (vte_sequence_handler_cm), (vte_sequence_handler_le),
        (vte_sequence_handler_cursor_character_absolute):
        Break "smart tabs" into multiple empty cells when cursor moves
        into them or inserting character there.

Comment 28 Behdad Esfahbod 2008-11-29 07:06:58 UTC
*** Bug 530644 has been marked as a duplicate of this bug. ***
Comment 29 baron 2008-11-29 11:39:08 UTC
(In reply to comment #27)
> Should be fixed in trunk.  Please test.  I'll look into pushing it into a
> stable release after confirmation.

I'm not sure what "trunk" means, but
vte-0.17.4-1.fc10.x86_64.rpm 
does not solve the problem for me (with fc9, still).
(I closed all old terminal windows too.  That didn't help.)
Comment 30 Maciej (Matthew) Piechotka 2008-11-29 13:43:46 UTC
(In reply to comment #29)
> (In reply to comment #27)
> > Should be fixed in trunk.  Please test.  I'll look into pushing it into a
> > stable release after confirmation.
> 
> I'm not sure what "trunk" means, but
> vte-0.17.4-1.fc10.x86_64.rpm 
> does not solve the problem for me (with fc9, still).
> (I closed all old terminal windows too.  That didn't help.)
> 

It will be in the next release. Trunk here means svn.
Comment 31 Dan Davison 2008-11-29 17:36:16 UTC
Thanks Behdad, it will be good to have that fixed. I have to admit I'm not sure how to go about testing this. Would anyone mind outlining for me how to check the behaviour of the latest svn version of this without making changes to my system that are difficult to reverse? Or pointing me towards instructions? I'm on ubuntu.
Comment 32 Maciej (Matthew) Piechotka 2008-11-29 17:47:25 UTC
I guess that:
1. Build the vte from svn (probably install to /opt/vte ~/.applications or similar location. I'd advice to test on user rights and install with user rights to ~/.applications)
2. Set the LD_LIBRARY_PATH to lookup the libraries in the /opt/vte/lib ~/.applications/lib or similar (hint: ~/.bashrc ~/.bash_profile. Please note that you may need to relog into system).
3. Tests it.

This is *NOT* an official advice. I take no responisbility for any system breakdown that may occure during the process.
Comment 33 Behdad Esfahbod 2008-11-29 18:15:27 UTC
(In reply to comment #32)
> I guess that:
> 1. Build the vte from svn (probably install to /opt/vte ~/.applications or
> similar location. I'd advice to test on user rights and install with user
> rights to ~/.applications)
> 2. Set the LD_LIBRARY_PATH to lookup the libraries in the /opt/vte/lib
> ~/.applications/lib or similar (hint: ~/.bashrc ~/.bash_profile. Please note
> that you may need to relog into system).
> 3. Tests it.
> 
> This is *NOT* an official advice. I take no responisbility for any system
> breakdown that may occure during the process.
> 

Or just build vte from SVN and run the vte/src/vte command and test in there.
Comment 34 Greg Hudson 2009-02-23 19:41:06 UTC
Not the ideal kind of testing, but possibly useful:

I applied r2222 from svn to Ubuntu's vte 1:0.17.4-0ubuntu1 package.  (It's entirely possible that this act of cherry-picking was a bad idea.)  On testing, I observed a crash while viewing scrolling output:

0xb7e245c0 in _vte_terminal_cleanup_tab_fragments_at_cursor (terminal=0xa07c378) at /root/vte-0.17.4/./src/vte.c:2888
2888                            *cell = screen->fill_defaults;
(gdb) print cell
$1 = (struct vte_charcell *) 0x0
(gdb) print i
$2 = 1
(gdb) print row
$3 = (VteRowData *) 0xa5717a8
(gdb) print col
$4 = 33
(gdb) print num_columns
$5 = 12
(gdb) cont

Not fully understanding why num_columns was larger than the number of valid columns in that row, I changed that line to "if (cell) *cell = ..." and stopped seeing crashes.

The bug with full tabs being highlighted went away, I think.  However, I still sometimes see ghost cursors within the spaces when I simply type words into emacs.

I will see about building a consistent revision of vte from svn.
Comment 35 Greg Hudson 2009-02-23 19:46:48 UTC
Oh, and I have cursor blinking turned off via gconf-editor (under /apps/gnome-terminal according to my notes).
Comment 36 Greg Hudson 2009-02-23 21:02:25 UTC
I built the most recent rev of vte from source and was unable to reproduce the bug (using the "012345<space> in C-mode" emacs test, which reproduces the bug reliably for me in previous versions).

So, I think this is confirmed fixed, although r2222 alone may not be all of the fix relative to what shipped in Ubuntu 8.10.
Comment 37 Greg Hudson 2009-02-23 22:31:42 UTC
For the benefit of anyone backporting this fix: r2222 and r2275 together appear to fix the problem (relative to 0.17.4) and avoid the crash bug resulting from r2222 alone.
Comment 38 Jeff Simpson 2009-08-20 18:52:15 UTC
Can somebody confirm what official vte release fixes this bug? I am seeing this problem in 0.20.5, still.
Comment 39 baron 2009-08-20 19:16:01 UTC
(In reply to comment #38)
> Can somebody confirm what official vte release fixes this bug? I am seeing this
> problem in 0.20.5, still.

Works for me with

vte-0.20.5-1.fc11.x86_64

and probably quite a bit before that.  I haven't noticed it for a while, either on this computer or an i586 one.
Comment 40 Jeff Simpson 2009-08-20 19:18:35 UTC
I'm actually seeing the cursor-blocks replacing more than just the whitespace - it is showing up over normal characters as I type them and appearing as glitches when I hold down backspace to delete a line of characters. Perhaps I am seeing a different bug that just looks very similar...
Comment 41 Behdad Esfahbod 2009-08-20 19:20:47 UTC
Fixed in 0.19.0.  File a new bug if you're seeing something not working.