Skip to content

Rendering changes with multibyte prompt characters in recent versions. #576

@xwmx

Description

@xwmx

The rendering of multibyte characters in the prompt appears to have changed in recent versions and the characters are no longer rendered properly on my system.

Given the following command:

echo "Example content." | less --prompt "Example prompt ↓↑"

less v653 and earlier render the prompt as expected:

screenshot 1

In v654, less started printing the code points in angle brackets with leading ^@ characters:

screenshot 2

At some point this changed so the leading ^@ is now omitted in the current release version, v667, and the master branch, which currently print the code points in angle brackets:

screenshot 3

When $LESSCHARSET is set to dos, the characters render properly, as illustrated in the following comparison:

echo "Example content." | LESSCHARSET=utf-8 less --prompt "Example prompt ↓↑"
# Example content.
# Example prompt <U+0086><U+0093><U+0086><U+0091>

echo "Example content." | LESSCHARSET=dos less --prompt "Example prompt ↓↑"
# Example content.
# Example prompt ↓↑

The system is running macOS 14.6.1 and the output of locale is:

LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"

Thank you for developing such a useful and important program!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions