terminator should normalize the X display name before generating the DBus bus name

Bug #1267195 reported by Andrea Corbellini
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Terminator
Fix Released
Low
Unassigned

Bug Description

terminatorlib/ipc.py contains the following lines:

  try:
      # Try and include the X11 display name in the dbus bus name
      DISPLAY = hex(hash(gtk.gdk.get_display())).replace('-', '_')
      BUS_NAME = '%s%s' % (BUS_BASE, DISPLAY)
  except:
      BUS_NAME = BUS_BASE

The problem with gtk.gdk.get_display() is that it returns the value of $DISPLAY (or --display) untouched. The following two commands:

  $ DISPLAY=:0 terminator
  $ DISPLAY=:0.0 terminator

produce two instances of Terminator with two different PIDs and two different BUS_NAMEs, although they belong to the same display.

According to the Xorg documentation (http://www.x.org/archive/X11R6.8.1/doc/X.7.html#sect4), the format for the display name is "hostname:displaynumber.screennumber". 'hostname' and 'displaynumber' are precious, 'screennumber' is totally useless for us and should be stripped.

The code should probably be changed to:

  DISPLAY = hex(hash(gtk.gdk.get_display().partition('.')[0]))

Related branches

Changed in terminator:
importance: Undecided → Low
Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

Hi Bug subscribers, this is the maintainer (Steve Boddy) of Terminator, who took over from Chris.

In case you were not aware there has been a new release 0.98 of Terminator in the last few days which has many changes, fixes and updates. We also have an ongoing GTK3 port which uses a much more up-to-date libvte.

Even with the ~50 issues closed by that release, and discounting the ~90 outstanding wishlist items, we still have an unwieldy 95 bugs. With the oldest approaching it's 6th birthday and some that haven't seen any updates in nearly 5, it is time for a purge.

My intention is to try and get this list down to a minimum, and for that I need your help.

First I'm going to work through, oldest to newest, setting bugs to Incomplete, pending confirmation that they are still an issue. If after a month there is no feedback, the issue will get closed as Invalid. Here's where you come in. I can't always reproduce, or setting up (i.e. other distros) to even test takes a long time, so I'm going to try crowdsourcing this.

1. Get the latest release. Is it still an issue? If yes, set the confirmed-0.98 tag. For bonus points follow the guide http://gnometerminator.blogspot.com/2015/09/so-you-want-to-try-terminator-gtk3.html and see if the GTK3 branch has same issue, and set the confirmed-gtk3 or notaffected-gtk3 tag.

2. Can you reproduce with an empty/default config file? You can pass "-g temp_config" to do this without affecting your existing config. If you already have Terminator running, you'll need to pass -u as well to disable the DBus.

3. If able to, can you reproduce with another user/guest account?

4. If the issue does not already have clear, precise instructions to reproduce with minimal setup/steps, add them.

5. Put as much info about what you are running.
   * Software/library versions (libvte, gtk, pango, cairo, distro, desktop environment, language)
   * Screens (single or multi)
   * Any unusual / custom packages or configs that might be interacting.

6. If possible attach the config file, unless the issue also happens with an empty one, but mention that.

7. Attach the "-d" debug output from 0.98.

Some common things that cause incidents.

* Strange sizing issues or rapidly shrinking windows - Try turning off Window geometry hints.
* Input (esp. broadcasting duplicate chars etc) problems - Try killing IBus.
* Hand editing of the config file can cause various issues - Due to misunderstanding, incorrect structure or typos.
* Some issues are actually in libvte - This is why testing GTK3 is so important.
* segfaults - Unfortunately these are dying inside the C libraries, and it is usually beyond me to fix those.

Many thanks for your assistance, and hopefully this will get us closer to a bug-free Terminator.

Changed in terminator:
status: New → Incomplete
Revision history for this message
ju1ius (jules-bernable) wrote :

Hi,

I can confirm this bug happens on 0.98 and on latest gtk3-trunk.

Steps to reproduce:

1. Using Thunar, create the following custom action (Edit -> Configure custom actions):

Name: Terminator Here
Command: /path/to/terminator --working-directory=%f
File patterns: *
Appears if selection contains: Directories

2. Open D-Feet, session bus tab, search for net.tenshu

3. Launch terminator the normal way, a new dbus service appears, net.tenshu.Terminator0xBLAHBLAHBLAH

4. Launch terminator the normal way again, you can see the same service is reused for the new window

5. Open Thunar, right-click on a directory and choose "Terminator Here"

6. In D-Feet, a new dbus service appears, net.tenshu.Terminator0xF00BAR

Expected behavior: there should be only one net.tenshu.Terminator service instance running per session.

The fix proposed by Andrea Corbellini solves the issue in both 0.98 and gtk3-trunk.

Revision history for this message
ju1ius (jules-bernable) wrote :
ju1ius (jules-bernable)
Changed in terminator:
status: Incomplete → Confirmed
ju1ius (jules-bernable)
tags: added: confirmed-0.98
tags: added: confirmed-gtk3
removed: confirmed-0.98
tags: added: confirmed-0.98
tags: added: dbus
Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

Committed revision 1734.

Changed in terminator:
status: Confirmed → Fix Committed
Changed in terminator:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.