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

Alt screen does not move cursor same amount as primary screen for some emoji #1461

Open
rockorager opened this issue Feb 10, 2024 · 2 comments
Labels
bug Something isn't working VT: Backend Virtual Terminal Backend (libterminal API)

Comments

@rockorager
Copy link

rockorager commented Feb 10, 2024

Contour Terminal version

contour-git from AUR

Installer source

something else (please specify below)

Operating System

Arch linux

Architecture

x86-64

Other Software

No response

Steps to reproduce

#!/bin/sh

echo "primary screen:"
echo "|--|"
echo "|🏳️‍🌈|"
echo "|📎|"
echo "|📡|"
sleep 5

echo -e "\x1b[?1049h\x1b[?2027h" # enter alt screen and turn on 2027
echo "alternate screen:"
echo "|--|"
echo "|🏳️‍🌈|"
echo "|📎|"
echo "|📡|"

sleep 5

echo -e "\x1b[?1049l"

Expected Behavior

In the alt screen, the cursor only moves one cell for some emoji

Actual Behavior

The cursor should move the same (correct) amount in the primary screen and alt screen

Additional notes

No response

@rockorager rockorager added the bug Something isn't working label Feb 10, 2024
@Yaraslaut Yaraslaut added VT: rasterizer Rendering of the terminal into a pixmap using `terminal_renderer` library fonts font rasterization and text shaping API and platform implementations labels Feb 10, 2024
@christianparpart christianparpart added VT: Backend Virtual Terminal Backend (libterminal API) and removed VT: rasterizer Rendering of the terminal into a pixmap using `terminal_renderer` library fonts font rasterization and text shaping API and platform implementations labels Feb 10, 2024
@christianparpart
Copy link
Member

Cursor movement mistakes are most likely a bug in unicode grapheme cluster's width handling.
I wonder why it's only happening on alt screen and not on primary. Will figure it out. Many thanks for your report, @rockorager :)

@christianparpart
Copy link
Member

Okay, this is a dup of #1375 - technically speaking. I am having a PR open over at libunicode that attempts to fix this (with better API and implementation). this should be fixed by the next major Contour release :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working VT: Backend Virtual Terminal Backend (libterminal API)
Projects
None yet
Development

No branches or pull requests

3 participants