Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broadcast issues additional key to terminals #78

Closed
Isgleas opened this issue May 14, 2020 · 41 comments · Fixed by #114
Closed

Broadcast issues additional key to terminals #78

Isgleas opened this issue May 14, 2020 · 41 comments · Fixed by #114
Labels
question Further information is requested
Milestone

Comments

@Isgleas
Copy link

Isgleas commented May 14, 2020

When grouping terminals and broadcasting on them, the keys typed on the focused one are keyed twice on the other terminals.

Lets say, if I type ls on the main terminal, I get llss on the others on the group. The same happens when setting broadcast to all,

Terminator v 1.91 on Opensuse Leap 15.1

image

@mattrose
Copy link
Member

I believe this has been fixed in master. Can you try:

git clone https://github.com/gnome-terminator/terminator
cd terminator
./terminator -u

to try it out?

@Isgleas
Copy link
Author

Isgleas commented May 14, 2020

I see the same behavior

image

@lazyfrosch
Copy link
Member

confirmed in my setup

@mattrose
Copy link
Member

weird, I'm not seeing that either on fedora or my mac, and my mac terminator install is as quirky as hell :)

@mattrose
Copy link
Member

image

@Isgleas
Copy link
Author

Isgleas commented Jun 3, 2020

I have found this issue happens if I'm on KDE Xorg, it does not show neither on KDE Wayland, Gnome Wayland nor Gnome Xorg. I have tried modifying some of the keyboard related env variables but none of them seem to affect
image
image

@Isgleas Isgleas closed this as completed Jun 3, 2020
@Isgleas Isgleas reopened this Jun 3, 2020
@Isgleas
Copy link
Author

Isgleas commented Jun 3, 2020

Closed it by mistake

@mattrose
Copy link
Member

mattrose commented Jun 3, 2020

FOUND IT! It is, as I thought an issue with ibus grabbing keypress events and then sending them back.

It's ibus/ibus#2036

There are a bunch of issues around it, but I'm gonna take the same big hammer approach to the problem as Stephen took.

If you hit this bug and want to work around it, simply ensure the following environment variable is set before starting terminator:
IBUS_NO_SNOOPER_APPS=python3

@mattrose
Copy link
Member

mattrose commented Jun 3, 2020

Well, this was an adventure. It turns out that it wasn't the environment variable that changed, but actually the internals of the python psutil module, which meant that we weren't actually detecting whether or not ibus was running, and consequently never setting the proper ibus environment variable.

Can anyone who has encountered this bug please check out the PR and test it?

@Isgleas
Copy link
Author

Isgleas commented Jun 3, 2020

Setting the environment variable seems to fix the broadcast issue, but some shortcuts, not all, start working funny, like triggering an emoji list menu

image

image

@Isgleas
Copy link
Author

Isgleas commented Jun 3, 2020

PR114 seems to work, great!
image

@mattrose
Copy link
Member

mattrose commented Jun 3, 2020

Great, I'll pull this in soon. Thanks for testing it out so quickly.

@mattrose mattrose linked a pull request Jun 11, 2020 that will close this issue
@mattrose mattrose added this to the 2.0 milestone Jun 24, 2020
@ozzdemir
Copy link
Contributor

It still happens to me with commit 6c56f32
Tried deleting environment variable by adding del os.environ['GTK_IM_MODULE'] to terminator before main called. It works, but then I cant launch a layout from Terminator Layout Launcher.
Using Ubuntu 18.04, and installed from source with the mentioned commit.

@mattrose
Copy link
Member

I'm going to re-open this to check this out.

@mattrose mattrose reopened this Dec 20, 2020
@ozzdemir
Copy link
Contributor

When I tried to start layout from terminal, observed that it was giving keyError since GTK_IM_MODULE env var is already deleted (probably), when I handled it in a try except block, now I can start from layout. Final form of the addition (Just before if __name__ == '__main__':) I made is as follows:

try:
    del os.environ['GTK_IM_MODULE']
except Exception as e:
    print(e)

I did not open a merge request since I am not sure if this is the best way to handle it, but if anyone wants a quick solution can use it.

@mattrose
Copy link
Member

I reverted #36, can you retest this and close it if it's fixed again?

@mattrose mattrose added the question Further information is requested label Dec 30, 2020
@ozzdemir
Copy link
Contributor

ozzdemir commented Dec 31, 2020

Checked issue78 branch, and there was no such problem, but master branch still has it.

@lazyfrosch lazyfrosch modified the milestones: 2.0, 2.1 Jan 3, 2021
@mattrose
Copy link
Member

Did you update master from upstream?

@ozzdemir
Copy link
Contributor

Yes, I did at the time and tried again just now. Still persists.
terminator --version reports terminator 2.1.0. If there is a call that returns the commit hash or so, I can also share it.

@ozzdemir
Copy link
Contributor

It seems the bug introduced by 736e88a. I did find it by sectioning commits and testing for the problem.

@mattrose
Copy link
Member

Hmm, can you see if the ibus fix referenced in that commit is in your version of ibus?

@ozzdemir
Copy link
Contributor

How can I check it? Seems my IBus version is 1.5.17.

@mattrose
Copy link
Member

That should have the fix in it, I'll see if I can reproduce this in an ubuntu 18.04 vm soon

@Joshua-Snapp
Copy link

I also have this problem when broadcasting to multiple panes. The current workaround that seems to work is to set DBUS_SESSION_BUS_ADDRESS='' and start terminator with the -u option described in the DBus section of the Terminator documentation.

I added the following alias to my ~/.bashrc to make this workaround more convenient to run.

alias terminator="DBUS_SESSION_BUS_ADDRESS='' terminator -u"

I'm running the following:

  • Fedora 32
  • ibus.x86_64 1.5.22-7.fc32
  • terminator.noarch 2.1.0-1.fc32
  • gtk3.x86_64 3.24.23-1.fc32

Enabled Terminator Plugins:

  • LaunchpadBugURLHandler
  • LaunchpadCodeURLHandler
  • APTURLHandler
  • TerminatorThemes
  • TerminatorSearch

@xbello
Copy link

xbello commented Feb 5, 2021

I've been able to make it work creating the executable file ~/bin/terminator (assuming your ~/bin has preference) as:

export DBUS_SESSION_BUS_ADDRESS=$(dbus-launch)
/usr/bin/terminator

I did this because the terminator.desktop launcher doesn't seem to use the alias from the .bashrc

@mattrose
Copy link
Member

I think this workaround is best if anyone is still hitting this issue. Anytime I try and fix this in code it breaks more critical functionality.

@kimba74
Copy link

kimba74 commented Aug 27, 2021

Hi @mattrose

Looks like this bug is back starting with terminator version v2.1.0

I installed terminator from your PPA and got an update a few hours ago from 2.0.1-1-0ubuntu3 to 2.1.1-2 since then I get the double input on split terminal again. The insert_number feature also crashes with error:

Traceback (most recent call last):
  File "/home/steffen/Development/Languages/Python/terminator/terminatorlib/terminator.py", line 592, in do_enumerate
    term.feed(numstr % (idx + 1))
  File "/home/steffen/Development/Languages/Python/terminator/terminatorlib/terminal.py", line 1584, in feed
    self.vte.feed_child(text)
TypeError: Item 0: Must be number, not str

To verify that it was working earlier I cloned your repo and tested the tags backwards:

Tag Result
v2.1.1 Broken
v2.1.0 Broken
v2.0.1 Works

So I guess somewhere the changes you made to fix this bug in git lost after version v2.0.1

I'm running Ubuntu 20.04.

Let me know if I can provide additional information to help narrow down the issue.

Cheers,

Kimba

@yuki
Copy link

yuki commented Nov 23, 2021

Same issue on Terminator 2.1.0-2 on Debian bookworm (actually "testing").
The workaround

export DBUS_SESSION_BUS_ADDRESS=$(dbus-launch)
/usr/bin/terminator

is working

ozzdemir added a commit to ozzdemir/terminator that referenced this issue Jan 26, 2022
…onment variable

Using this hotfix for a while, and no discrepancy observed. In order to
permanently(hopefully) fix the issue, commiting fix.
mattrose added a commit that referenced this issue Jan 28, 2022
Added hotfix for #78 that deletes GTK_IM_MODULE environment variable
@yurenchen000
Copy link

yurenchen000 commented Apr 18, 2022

ubuntu20.04, fcitx google-pinyin.

the situation I encountered:

## env other

// this no effecit

QT4_IM_MODULE= QT_IM_MODULE= DBUS_SESSION_BUS_ADDRESS= /usr/bin/terminator -u

env GTK_IM_MODULE

// this fixed, but will lose fcitx input

GTK_IM_MODULE=  /usr/bin/terminator -u

// this fixed, but also lose fcitx input

--- a/usr/bin/terminator
+++ b/usr/bin/terminator
@@ -23,6 +23,12 @@ import sys
 import os
 import psutil
 import pwd
+
+try:
+    del os.environ['GTK_IM_MODULE']
+except Exception as e:
+    print(e)
+
 try:
     ORIGCWD = os.getcwd()
 except OSError:

so, the current workaround principle is disable input method ?
may be this is a temporary workaround ?





NOTE UPDATE: #596 (comment)



Tip

I'm on ubuntu22 too,
just share a little experience
(if you don't want to roughly stop input-method)

for fcitx

//this will disable fcitx in terminator

GTK_IM_MODULE= terminator -u

#78 (comment)

for ibus

//ibus can work in terminator , but only broadcast eng input

IBUS_NO_SNOOPER_APPS=python3 terminator -u

#504 (comment)

@JKomoroski
Copy link

For those using terminator 2.1.1 and are launching terminator from a .desktop shortcut (i.e Fedora). I was able to work around this issue edit the Exec argument to include an empty Dbus address.

Copy the system terminator desktop file to my local application shortcut directory. For example on my system:

cp /usr/share/applications/terminator.desktop ~/.local/share/applications 

Open the copied result file in the local applications folder and edit the Exec=terminator to:

Exec=env DBUS_SESSION_BUS_ADDRESS= terminator -u

@Arondight
Copy link

Damn you can't delete the GTK_IM_MODULE environment variable, tons of users need to use it! THIS CODE SUCKS!

@mattrose
Copy link
Member

mattrose commented Apr 6, 2023

agreed, that's why I pulled it in the latest release.

@bmullan
Copy link

bmullan commented Dec 2, 2023

On Ubuntu 22.04.3 LTS

My Terminator got updated sometime recently to a newer version that exhibited the duplicate character issue when
Broadcasting between multiple Terminator "window" sessions.

I finally fixed it on my system by editing:

$ sudo nano /usr/share/applications/terminator.desktop

Change the line "Exec=terminator" to:

Exec=env DBUS_SESSION_BUS_ADDRESS= terminator -u

Testing:

Start Terminator, split the window so you have 2 Terminator sessions.
In one of those select Broadcast All

It now works again on my Ubuntu system w/no character duplication!

@awsms
Copy link

awsms commented Dec 26, 2023

still having this issue on 2.1.3

@xbello
Copy link

xbello commented Dec 27, 2023

On Ubuntu 22.04.3 LTS

My Terminator got updated sometime recently to a newer version that exhibited the duplicate character issue when Broadcasting between multiple Terminator "window" sessions.

I finally fixed it on my system by editing:

$ sudo nano /usr/share/applications/terminator.desktop

This kind of changes might be overwritten in the next upgrade. It could be in a couple of months or in a couple of years. And then you won't remember how did you fix it.

You should edit instead your user terminator.desktop that usually is at $HOME.local/share/applications/. If it doesn't exist, create one by copying the file from the system.

@alohl669
Copy link

alohl669 commented Sep 6, 2024

Ubuntun 24.04
using xorg(does not happen on waylan)
terminador 2.1.3

terminator still working wrong

image

I come from ubuntu 20.04 without problems and for work reasons I can't change to waylan now. I know there is a workaround to resolve this but, are there plans to fix this issue? As far as I know, this exists from 2020

@eamathw
Copy link

eamathw commented Oct 17, 2024

Ubuntu 22.04.5 LTS
Terminator 2.1.1-1

This problem only started when I switched from Wayland to Xorg(to fix Zoom screen sharing issue at work). The solution I've been using is:
GTK_IM_MODULE= terminator

@sudoix
Copy link

sudoix commented Nov 3, 2024

Still having this issue:
terminator 2.1.3
Ubuntu 24.04

@bmullan
Copy link

bmullan commented Nov 3, 2024 via email

@mattrose
Copy link
Member

mattrose commented Nov 3, 2024

This disables all dbus functionality and does work, but there's a much easier way than editing the desktop file. You can just disable the dbus server in the preferences here https://gnome-terminator.readthedocs.io/en/latest/preferences.html

Edit: > $ sudo nano /usr/share/applications/terminator.desktop Change the line "Exec=terminator" to: Exec=env DBUS_SESSION_BUS_ADDRESS= terminator -u

@bmullan
Copy link

bmullan commented Nov 4, 2024

@mattrose
Thanks for that link!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.