-
Notifications
You must be signed in to change notification settings - Fork 706
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
Input method preedit position #1940
Comments
On mlterm, that handle input method on its own, preedit area located near the cursor even in kakoune. xterm uses xim. |
That is strange, although Kakoune does not use the terminal cursor for display, it does position it at the position of it's main cursor. According to the xterm man page I read, xterm should use that cursor position. I have seen recently iterm2 with Kakoune displaying the emoji box correctly anchored at kakoune's cursor, so if that got broken its very recent, and I do not recall any changes in that area. Seems something fishy is going on, maybe xterm is confused because the cursor is hidden. |
Writing Japanese in kakoune on xterm first time is today. |
Hello, I did some experiments, and I believe this is actually an xterm bug. ibus-anthy preedit position works fine on rxvt-unicode, and works fine in xterm if I disable cursor hiding in Kakoune. It seems that xterm only uses the cursor position for I am not sure why xterm does that, I cant think of a good reason not to respect cursor position when it is hidden, as it still seems to be the best guess the terminal can make. I suggest to contact xterm developpers to see if they can fix that. |
Thank you very much. I've contacted xterm developer. |
I took a look at the package for kakoune in Debian/testing, and keeping the comment about the "cursor" in mind, can see that kakoune is leaving the actual cursor position in other places (such as xterm can't guess that the cells drawn by kakoune are intended as the "real" cursor position: https://github.com/mawww/kakoune/blob/master/src/face_registry.cc#L131 Instead, it uses the actual cursor position. Normally that "just works" in a curses program by setting the current position before doing Given all of that, the bug which was reported is in kakoune. |
@ThomasDickey hello, thanks a lot for taking a look. Unfortunately the debian/testing version of Kakoune is very old (it is from 2016), and does not have the 91bfd71 commit which takes care of placing the hardware cursor at the correct position. Newer Kakoune do place the hardware cursor, but it is hidden (we call ncurses According to my tests, in xterm, I get correct positioning if I disable that call, and wrong positioning if I keep it. Which led me to believe xterm might not take the cursor position into account if it is hidden. |
I also took a look at the source for rxvt-unicode, which doesn't maintain a separate cursor position for the SpotLocation, in case you were considering some feature of that program. But since it doesn't do that, there's nothing to imitate there. It gets the position here: https://github.com/exg/rxvt-unicode/blob/master/src/screen.C#L3547 and uses it here: https://github.com/exg/rxvt-unicode/blob/master/src/main.C#L1259 xterm does the same thing: https://github.com/ThomasDickey/xterm-snapshots/blob/master/charproc.c#L4981 Whether the cursor is visible (or blinking or whatever attribute), as one moves around the screen writing text, it moves the cursor that these terminals use for input. |
@ThomasDickey I am not very familiar with Xterm code base, but wouldn't the following condition prevent the PreeditPosition from being updated when the cursor is hidden ? |
thanks - I'll make the indicated change :=) |
Thank you, Thomas and Maxime. |
With preeditType OverTheSpot(xterm's default), preedit area is located same position regardless cursor position in kakoune.
While preedit area is located near the cursor position in at least zsh, less and vi.
I tested on
The text was updated successfully, but these errors were encountered: