bubbletea icon indicating copy to clipboard operation
bubbletea copied to clipboard

IME input in wrong position

Open Bryan2333 opened this issue 1 year ago • 2 comments

Describe the bug Candidate window of input method is at wrong position on Linux. The window is always at the left bottom side of the application.

Setup Please complete the following information along with version numbers, if applicable.

  • OS: Arch Linux with KDE Plasma Wayland
  • Shell: fish
  • Terminal Emulator: konsole
  • Terminal Multiplexer: none

To Reproduce Steps to reproduce the behavior:

  1. Clone the repository
  2. Build the example like textinput, textarea
  3. Run the program
  4. Try to use input method like Fcitx5.

Source Code Just the provided example code

Expected behavior The candidate box following the cursor.

Screenshots Screenshot_20231128_164927.webp

Additional context

Bryan2333 avatar Nov 28 '23 08:11 Bryan2333

Thanks for the report! This appears to be happening because Bubble Tea keeps the cursor in the lower left position while the various input types in Bubbles render a virtual (simulated) cursor. To solve for this we'll need some changes to the renderer, a low level cursor API, and some updates in Bubbles.

Related: https://github.com/charmbracelet/bubbles/issues/361

Additional reference (see "What Can Program Authors Do Today?" near the end): https://mitchellh.com/writing/grapheme-clusters-in-terminals

meowgorithm avatar Dec 06 '23 15:12 meowgorithm