Bug 1573927

Summary: CustomCommandsMenu plugin does not work
Product: [Fedora] Fedora Reporter: Martin Chlumsky <martin.chlumsky>
Component: terminatorAssignee: Matt Rose <mattrose>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 30CC: bmason, dmaphy, egmont, mattrose, reddy
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-18 20:10:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Martin Chlumsky 2018-05-02 14:24:28 UTC
User-Agent:       Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36
Build Identifier: 

After an upgrade from Fedora 27 to Fedora 28, the CustomCommandsMenu plugin in Terminator no longer works.

Reproducible: Always

Steps to Reproduce:
1. Open Terminator

2. Enable the CustomCommandsMenu plugin (right-click in Terminator, Select Preferences, select Plugins, ensure CustomCommandsMenu is checked)

3. Add a custom command (right-click in Terminator, select Custom Commands then Preferences, Click new, check enabled, put a Name and a Command and click OK.

4. Use custom command (right-click in Terminator, select Custom Commands then click your custom command.
Actual Results:  
The custom command does not run. Nothing happens.

Expected Results:  
The custom command gets executed.

There appears to be no workaround.

Comment 1 Martin Chlumsky 2018-05-03 13:51:51 UTC
This has been reported upstream here: https://bugs.launchpad.net/terminator/+bug/1758564?comments=all

There is a workaround in comment #1 that works in Fedora 28.

Comment 2 Egmont Koblinger 2018-08-03 10:14:13 UTC
VTE version 0.52 fixed its Python binding of feed_child(), no longer taking that third parameter.

Fedora should patch its Terminator accordingly.

> There is a workaround in [...]

Note that it's not just a workaround, it's the proper fix if underlying VTE is known to be >= 0.52.

Comment 3 Ben Cotton 2019-05-02 21:12:23 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Ben Cotton 2019-05-28 22:02:33 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 5 Bryan Mason 2019-12-20 00:35:00 UTC
Still a problem in Fedora 30 (and likely 31 as well, but I haven't installed that yet).

Comment 6 Matt Rose 2019-12-20 19:43:45 UTC
I'll take a look at this.  If it's as easy as the fix in the other bug, it should be an easy patch

Comment 7 Bryan Mason 2019-12-20 19:56:35 UTC
Thanks.  It really is that easy to fix:

$ diff -u terminal.py.old terminal.py
--- terminal.py.old	2019-02-03 01:40:54.000000000 -0800
+++ terminal.py	2019-12-20 11:53:50.380667587 -0800
@@ -1503,7 +1503,7 @@
 
     def feed(self, text):
         """Feed the supplied text to VTE"""
-        self.vte.feed_child(text, len(text))
+        self.vte.feed_child(text)
 
     def zoom_in(self):
         """Increase the font size"""

Comment 8 Bryan Mason 2019-12-20 19:58:58 UTC
 . . . and I just realized that the patch above is for another problem (drag and drop of URLs doesn't work).  The problems are related, and the fix is similar, but they are separate issue.  Sorry for the mix-up.  I suppose I should open another BZ for the drag/drop problem.

Comment 9 Bryan Mason 2019-12-20 20:00:34 UTC
FWIW, the drag/drop is in BZ 1574662.

Comment 10 Egmont Koblinger 2019-12-20 20:05:32 UTC
If I'm not mistaken: The simple patch of removing the second parameter, as shown here in comment 7, works with python2 but not with python3.

For python3, something more complex is required, as I've shown in the DND patch: https://bugs.launchpad.net/terminator/+bug/1662544 komment 55. That patch only fixes it at 1 of the 2 (or more?) places feed_child() is used in the source. All of them should be updated according to the DND patch, preferably preserving the comment explaining the nasty hack, that is, something along these lines:

-        self.vte.feed_child(text, len(text))
+        # See https://gitlab.gnome.org/GNOME/vte/issues/201.
+        self.vte.feed_child_binary(text.encode(self.vte.get_encoding()))

Comment 11 Egmont Koblinger 2019-12-20 20:15:18 UTC
To be even more precise: "self.vte.feed_child(text)" is a good solution for python 2 (which isn't relevant any more), as well as for python 3 + vte >= 0.60. The nasty hack of using "feed_child_binary" instead is required for the combo if python 3 + vte <= 0.58.

vte 0.60 will be released in Mar 2020. You should not wait for that, but instead go with the "feed_child_binary" hack. In a year or two from now it can be simplified.

Comment 12 Matt Rose 2019-12-20 20:18:49 UTC
*** Bug 1763775 has been marked as a duplicate of this bug. ***

Comment 13 Matt Rose 2019-12-21 03:46:51 UTC
Put a fix in rawhide.  Egmont, remind me in a year to fix the fix :)

https://koji.fedoraproject.org/koji/buildinfo?buildID=1424377

Does anyone following this know the proper procedure for closing this?  Set it to RELEASE_PENDING?

Comment 14 Dominic Hopf 2020-05-18 20:10:44 UTC
IIRC the proper status for fixed issues like this is "CLOSED RAWHIDE" by the way. It's at least what I am usually setting a bug to when I've just built a package and it will land in Rawhide in the foreseeable future. :-)