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/hunspell_table.py#L2497 ) 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.
Created attachment 1697573 [details] screenshot1.png
Created attachment 1697574 [details] screenshot2.png
Created attachment 1697575 [details] screenshot3.png
Created attachment 1697577 [details] Screencast from 06-16-2020 10:51:39 AM.webm Video showing how screenshot1.png, screenshot2.png, and screenshot3.png were created.
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.
This bug still exists in Fedora 34.
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://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; }
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.
I recommend to open a new upstream bug to track this, please