Custom Commands Plugin not typing keystrokes on selection

Bug #1758564 reported by Keith Thome
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Terminator
New
Undecided
Unassigned
terminator (Arch Linux)
New
Undecided
Unassigned

Bug Description

After upgrading to the latest Kali distro, the Custom Commands plugin no longer will type out the associated keystrokes entered for each custom command. The flyout is there, the label for the custom command is there, but selecting them does not type any text into the shell as it used to do.

Kali Kernel versions:
Linux kali 4.14.0-kali3-amd64 #1 SMP Debian 4.14.17-1kali1 (2018-02-16) x86_64 GNU/Linux

Terminator Version (according to dpkg):
1.91-1

Debug Output (happens when clicking on any custom command in the flyout):
File "/root/terminator/terminatorlib/plugins/custom_commands.py", line 130, in _execute
    terminal.vte.feed_child(command, len(command))
TypeError: Vte.Terminal.feed_child() takes exactly 2 arguments (3 given)

Keith Thome (d00gman)
description: updated
Keith Thome (d00gman)
description: updated
Revision history for this message
Keith Thome (d00gman) wrote :

1. Delete terminator/terminatorlib/plugins/customer_commands.pyc to force re-compilation at next run time.

2. Change Line 130 of terminator/terminatorlib/plugins/customer_commands.py

from:

terminal.vte.feed_child(command, len(command))

to:

terminal.vte.feed_child(command)

3. Enjoy Terminator Custom Commands Plugin until patched release hits.

Revision history for this message
Keith Thome (d00gman) wrote :

For Kali distros the terminator files that need to be changed are located at:
/usr/share/terminator/terminatorlib/plugins

Revision history for this message
Giancarlo Razzolini (grazzolini) wrote :

I confirm this bug is happening on Arch Linux package as well:

https://bugs.archlinux.org/task/58160

I have implemented the suggested patch on the package, while we don't get a new release:

https://git.archlinux.org/svntogit/community.git/tree/trunk/001-custom_commands.patch?h=packages/terminator

Revision history for this message
Martin Chlumsky (martin-chlumsky) wrote :

This bug is also happening on Fedora 28: https://bugzilla.redhat.com/show_bug.cgi?id=1573927

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

VTE version 0.52 fixed its Python binding of feed_child(), no longer taking that third parameter.

Terminator should be adjusted, trying the variant corresponding to the VTE version, or doing a try-except.

See https://github.com/Guake/guake/issues/1243#issuecomment-410208659 for more juicy details.

Revision history for this message
Keith Thome (d00gman) wrote :

Changed to reflect VTE version 0.52
1. Delete terminator/terminatorlib/plugins/custom_commands.pyc to force re-compilation at next run time.

2. Change Line 130 of terminator/terminatorlib/plugins/customer_commands.py

from:

terminal.vte.feed_child(command, len(command))

to:

terminal.vte.feed_child(command.encode("utf-8"))

3. Enjoy Terminator Custom Commands Plugin until patched release hits.

Revision history for this message
Trifo T (trifo13) wrote :

Unfortunately, the same solution does not apply to the current version of Terminator: 1.91-4

There's no custom_commands.pyc

Looks like now __pycache__ is in place, but deleting ./__pycache__/custom_commands.cpython-37.pyc does not force re-compilation at the next run.

Any solution that would help with the current version of Terminator?

BR.

Revision history for this message
Andreas Steinwachs (steinwachs) wrote :

I'm on Terminator 1.91-1 and Ubuntu Linux 18.10 (cosmic) and had the same issue.

To fix this, I followed the aforementioned advice. However, I also cleaned up all the .pyc files and __pycache__ and forced a complete recompile.

Finally, note that the aforementioned solution contains a typo: It is "custom_commands.py", NOT "customer_commands.py"! ;)

As the solution does not seem to work for everyone. I am assuming that it is due to different file locations, the typo, and potentially a lack of properly cleaning up the Python byte code files.

Here's the complete procedure step-by-step as it worked for me:

1) Find out where your terminator files are and cd to that directory:
which terminator
    // Output: /usr/bin/terminator -> ../share/terminator/terminator
    // So the terminator root directory is /usr/share/terminator in this case

2) cd /usr/share/terminator

3) Change custom_commands.py as indicated by others

sudo nano terminatorlib/plugins/custom_commands.py

Change line 130 of terminatorlib/plugins/custom_commands.py

from:

terminal.vte.feed_child(command, len(command))

to:

terminal.vte.feed_child(command)

4) sudo pyclean . // To be on the safe side. Alternatively, use: sudo py3clean .
5) sudo python -m compileall . // Re-compile the whole lot
6) restart terminator // <-- This is necessary!

Custom commands should now work. To test, select and run a custom command from the commands menu.

Revision history for this message
Markus Frosch (lazyfrosch) wrote :

This will be fixed in the new upstream project under:
https://github.com/gnome-terminator/terminator/pull/6

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.