https://bugzilla.redhat.com/show_bug.cgi?id=1847347
Bug ID: 1847347 Summary: gnome-terminal and xfce4-terminal get surrounding text from previous application Product: Fedora Version: 32 Status: NEW Component: ibus Assignee: tfujiwar@redhat.com Reporter: mfabian@redhat.com QA Contact: extras-qa@fedoraproject.org CC: i18n-bugs@lists.fedoraproject.org, shawn.p.huang@gmail.com, tfujiwar@redhat.com Target Milestone: --- Classification: Fedora
I made the following screenshots and video by testing on Gnome-Xorg, but the problem occurs on Gnome-Wayland as well.
How to reproduce (see also attached screenshots and video):
- To show what happens with the surrounding text, I first opened the setup tool of ibus-typing-booster and set the debug level in the options tab to 3.
When the debug level is high, the auxiliary text above the candidate list shows what context has been obtained by using surrounding text (if surrounding text is available, if it is not available like when using xterm, the context is just remembered from what was typed last).
- I opened 3 windows: gedit, firefox, and gnome-terminal.
- I focus on gedit and type "a b c d e"
On top of the candidate list one can see: "Context: b c d"
This is because when the letter "e" was typed, ibus-typing-booster got the surrounding text at the cursor position and parsed the last 3 tokens left of the cursor out of the result. And these last 3 tokens left of the cursor are "b c d".
- Now I focus on firefox and type "f g h i j"
On top of the candidate list one can see: "Context: g h i"
I.e. the correct context "g h i" to the left of the just typed "j" (which is still in preedit) has been found using surrounding text.
- Now I focus on gnome-terminal and type "k l m"
On top of the candidate list one can see: "Context h i j"
This comes from the surrounding text left of the cursor in *firefox*, *not* from gnome-terminal.
Although gnome-terminal reports that surrounding text is supported, i.e.
self.client_capabilities & IBus.Capabilite.SURROUNDING_TEXT
is True (see the code to get the context at:
https://github.com/mike-fabian/ibus-typing-booster/blob/master/engine/hunspe...
)
gnome-terminal does not really seem to support surrounding text. The surrounding text comes from the previous client which really supported surrounding text.
If the previous client was firefox, one still gets the surrounding text from firefox while typing in gnome-terminal.
Same with gedit, if the previous client before focussing on gnome-terminal was gedit, one still gets the surrounding text from gedit while typing in gnome-terminal.
- The same problem occurs when using xfce4-terminal instead of gnome-terminal.
- When using xterm, the problem does *not* occur because when using xterm
self.client_capabilities & IBus.Capabilite.SURROUNDING_TEXT
is False and then the get_context() immediately returns and the context remembered from the last text typed is used as a fallback.
https://bugzilla.redhat.com/show_bug.cgi?id=1847347
Mike FABIAN mfabian@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mfabian@redhat.com
--- Comment #1 from Mike FABIAN mfabian@redhat.com --- Created attachment 1697573 --> https://bugzilla.redhat.com/attachment.cgi?id=1697573&action=edit screenshot1.png
https://bugzilla.redhat.com/show_bug.cgi?id=1847347
--- Comment #2 from Mike FABIAN mfabian@redhat.com --- Created attachment 1697574 --> https://bugzilla.redhat.com/attachment.cgi?id=1697574&action=edit screenshot2.png
https://bugzilla.redhat.com/show_bug.cgi?id=1847347
--- Comment #3 from Mike FABIAN mfabian@redhat.com --- Created attachment 1697575 --> https://bugzilla.redhat.com/attachment.cgi?id=1697575&action=edit screenshot3.png
https://bugzilla.redhat.com/show_bug.cgi?id=1847347
--- Comment #4 from Mike FABIAN mfabian@redhat.com --- Created attachment 1697577 --> https://bugzilla.redhat.com/attachment.cgi?id=1697577&action=edit Screencast from 06-16-2020 10:51:39 AM.webm
Video showing how screenshot1.png, screenshot2.png, and screenshot3.png were created.
https://bugzilla.redhat.com/show_bug.cgi?id=1847347
fujiwara tfujiwar@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gnome-sig@lists.fedoraproje | |ct.org, klember@redhat.com Component|ibus |vte291 Assignee|tfujiwar@redhat.com |klember@redhat.com
--- Comment #5 from fujiwara tfujiwar@redhat.com --- Unfortunately VTE does not implement "retrieve-surrounding" signal:
https://gitlab.gnome.org/GNOME/vte/-/blob/master/src/vte.cc#L4380
https://bugzilla.gnome.org/show_bug.cgi?id=726191
https://gitlab.gnome.org/GNOME/vte/-/issues/214
Instead, GtkTextView calls gtk_im_context_set_surrounding() in gtk_text_view_retrieve_surrounding_handler() with "retrieve-surrounding" signal.
https://bugzilla.redhat.com/show_bug.cgi?id=1847347
Mike FABIAN mfabian@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|32 |34
--- Comment #6 from Mike FABIAN mfabian@redhat.com --- This bug still exists in Fedora 34.
https://bugzilla.redhat.com/show_bug.cgi?id=1847347
Debarshi Ray debarshir@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |debarshir@redhat.com Link ID| |GNOME Gitlab | |GNOME/vte/-/issues/214 Summary|gnome-terminal and |Input Method "surrounding" |xfce4-terminal get |Events |surrounding text from | |previous application |
https://bugzilla.redhat.com/show_bug.cgi?id=1847347
--- Comment #7 from Ben Cotton bcotton@redhat.com --- This message is a reminder that Fedora Linux 34 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07. 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 'version' of '34'.
Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version.
Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 34 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 Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed.
https://bugzilla.redhat.com/show_bug.cgi?id=1847347
Mike FABIAN mfabian@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|34 |36
https://bugzilla.redhat.com/show_bug.cgi?id=1847347
--- Comment #8 from Mike FABIAN mfabian@redhat.com --- https://gitlab.gnome.org/GNOME/vte/-/blob/master/src/vte.cc#L4423
Still has empty stubs ofr retrieving and deleting surrounding text:
bool Terminal::im_retrieve_surrounding() { /* FIXME: implement this! Bug #726191 */ return false; }
bool Terminal::im_delete_surrounding(int offset, int n_chars) { /* FIXME: implement this! Bug #726191 */ return false; }
https://bugzilla.redhat.com/show_bug.cgi?id=1847347
--- Comment #9 from Ben Cotton bcotton@redhat.com --- This message is a reminder that Fedora Linux 36 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16. 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 'version' of '36'.
Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see it.
Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 36 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 Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed.
https://bugzilla.redhat.com/show_bug.cgi?id=1847347
Jens Petersen petersen@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Flags| |needinfo?(mfabian@redhat.co | |m)
--- Comment #10 from Jens Petersen petersen@redhat.com --- I recommend to open a new upstream bug to track this, please
https://bugzilla.redhat.com/show_bug.cgi?id=1847347
Jens Petersen petersen@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|36 |38
https://bugzilla.redhat.com/show_bug.cgi?id=1847347
--- Comment #11 from Aoife Moloney amoloney@redhat.com --- This message is a reminder that Fedora Linux 38 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 38 on 2024-05-21. 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 'version' of '38'.
Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see it.
Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 38 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 Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed.
https://bugzilla.redhat.com/show_bug.cgi?id=1847347
Aoife Moloney amoloney@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |CLOSED Resolution|--- |EOL Last Closed| |2024-05-21 14:11:13
--- Comment #12 from Aoife Moloney amoloney@redhat.com --- Fedora Linux 38 entered end-of-life (EOL) status on 2024-05-21.
Fedora Linux 38 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 Linux please feel free to reopen this bug against that version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see the version field.
If you are unable to reopen this bug, please file a new report against an active release.
Thank you for reporting this bug and we are sorry it could not be fixed.
i18n-bugs@lists.fedoraproject.org