Gnome-Terminal ignores theme, preferences is unavailable, and copy not working when launching from right-click desktop

Bug #1722121 reported by Eirik
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
gnome-terminal (Ubuntu)
Confirmed
Undecided
Unassigned
nautilus (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Description: Ubuntu Artful Aardvark (development branch)
Release: 17.10

gnome-terminal:
  Installed: 3.24.2-0ubuntu4
  Candidate: 3.24.2-0ubuntu4
  Version table:
 *** 3.24.2-0ubuntu4 500
        500 http://us.archive.ubuntu.com/ubuntu artful/main amd64 Packages
        100 /var/lib/dpkg/status

Expected behavior

Right-clicking on the desktop and selecting "Open Terminal" should give me the same terminal as running gnome-terminal or or opening terminal in the activity view.

What happens
Gnome-Terminal launches with the correct GTK theme, but not the correct theme variant (light instead of dark). The "Preferences" option is gone from the top bar. Trying to copy something from the terminal and pasting outputs "unavailable".

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: gnome-terminal 3.24.2-0ubuntu4
ProcVersionSignature: Ubuntu 4.13.0-12.13-generic 4.13.3
Uname: Linux 4.13.0-12-generic x86_64
ApportVersion: 2.20.7-0ubuntu2
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Sun Oct 8 22:49:01 2017
InstallationDate: Installed on 2017-09-30 (8 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Beta amd64 (20170929)
ProcEnviron:
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: gnome-terminal
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Eirik (evire) wrote :
Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

Related to bug 1708306.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-terminal (Ubuntu):
status: New → Confirmed
Revision history for this message
Hunter Buchanan (hrbuchanan) wrote :

I'm seeing this issue as well. I can also confirm that copying doesn't work when Terminal is opened by right-clicking the desktop and selecting Open Terminal, but DOES work when I've opened it by other means.

Revision history for this message
Hunter Buchanan (hrbuchanan) wrote :

I should add that mine wasn't a fresh install of Ubuntu 17.10, but rather an upgrade from 17.04 (do-release-upgrade).

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

I can confirm this with Ubuntu's packages, as well as manually compiled VTE + gnome-terminal from git master (and hence no Ubuntu patches, no wrapper startup script).

Happens on "Ubuntu" desktop environment [Wayland] only, not on "Ubuntu (Xorg)" or any other. (Well, "GNOME" doesn't have a Terminal entry in its "right-click on the desktop" menu, not sure if it's supposed to be there or what makes it appear there.)

Terminal windows started up in these two different ways are also not grouped together in the left-hand launchbar, or when Alt+Tabbing.

However, they are all handled by a single common gnome-terminal-server process.

Ctrl+Shift+N (new window) somehow remembers the context and opens another window of that kind. When pressed over a faulty window, the new one will be faulty too. When pressed over a good one, the new one is good too.

If highlighted in a correct window, shift+insert pasting works in all the windows. If highlighted in a faulty window, shift+insert pasting doesn't work in the same window or other faulty windows, but works in healthy windows.

(Note to myself: I could even try re-enabling tab DND across windows, and drag from a faulty to a correct one or vice versa to see what happens.)

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

Pressing the global shortcut Ctrl+Alt+T, or pressing the Super key and typing Terminal, or launching from the left Launcher once it's been added as a favorite all launch via /usr/bin/gnome-terminal and result in a good one.

Nautilus (Files) file manager window, right click -> Open in Terminal does _not_ go thru /usr/bin/gnome-terminal, yet results in a good terminal.

Desktop's right click menu does _not_ go thru /usr/bin/gnome-terminal either (does it use the nautilus plugin? or some direct dbus/systemd stuff?) and results in a buggy window.

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

Re-enabling DND (git revert 10e164d8) pretty much always causes a sudden crash as soon as I try to drag out a tab, it's impossible to test that.

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

Correctly working windows are native Wayland. Faulty windows are X11 (XWayland), you can tell by e.g. xeyes following the mouse movement.

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

On "Ubuntu", xeyes follows the mouse movement when over the desktop. On "GNOME" it doesn't.

I guess it means that Ubuntu's desktop background app isn't native X11, and probably that's why somehow (still totally unclear to me how) gnome-terminal inherits this X11-compat requirement from the menu there.

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

With the help of main gnome-terminal developer Christian (thanks!) we've noticed the following:

When "Ubuntu" graphical session is chosen, the background (nautilus-desktop) uses X11 (XWayland). This can be confirmed by xeyes following the mouse movements made there. (With "GNOME" graphical session this is not the case, the background there is native Wayland.)

Using dbus-monitor, this is seen when opening a "good" terminal with the global shortcut Ctrl+Alt+T:

method call time=1509569901.444518 sender=:1.72 -> destination=:1.73 serial=12 path=/org/gnome/Terminal/Factory0; interface=org.gnome.Terminal.Factory0; member=CreateInstance
   array [
      dict entry(
         string "display"
         variant array of bytes "wayland-0" + \0
      )
      dict entry(
         string "encoding"
         variant string "UTF-8"
      )
   ]

and its counterpart with the "bad" terminal (desktop's right click menu) is:

method call time=1509569929.217075 sender=:1.64 -> destination=:1.80 serial=148 path=/org/gnome/Terminal/Factory0; interface=org.gnome.Terminal.Factory0; member=CreateInstance
   array [
      dict entry(
         string "display"
         variant array of bytes ":1.0" + \0
      )
      dict entry(
         string "desktop-startup-id"
         variant array of bytes "_TIME180922528" + \0
      )
      dict entry(
         string "active"
         variant boolean true
      )
   ]

Later on, however, pretty much the same set of environment variables, including "DISPLAY=:1" and "WAYLAND_DISPLAY=wayland-0" are passed in both cases. (The concrete values might vary of course, typically it's "DISPLAY=:0" but I'm opening a second graphical session for testing.) (The only difference in the environment variables is the presence/absence of DESKTOP_AUTOSTART_ID. I guess that's irrelevant.)

So there's the following to the story:

- gnome-terminal was meant to support multiple displays handled by the same server process, but it suffered from problems anyway. Christian has just removed this feature, which is a proper workaround/fix for this bug. The fix is at https://git.gnome.org/browse/gnome-terminal/commit/?id=36cce22 and https://git.gnome.org/browse/gnome-terminal/commit/?id=8d75f15. Ubuntu should go ahead and backport it.

- nautilus-desktop should be converted to a proper Wayland app with no leftover X11 stuff. That would also be a proper fix on its own, without the gnome-terminal fix. (Isn't this done in mainstream GNOME yet? Does Ubuntu bring back the X11 dependency with a patch? Dunno.)

- Why did this cause copy-paste not working and the theme not being the correct one? Perhaps there's no gnome-settings-daemon running for the X11/XWayland display, and perhaps its clipboard is not (or not properly) connected to Wayland's. We're unsure about these.

At this point I'm passing the ball to Ubuntu developers to come up with some fix based on these findings.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nautilus (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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