Skip to content

Conversation

@lbrabec
Copy link

@lbrabec lbrabec commented Apr 3, 2025

Calculate length of prompt correctly if HSTR_PROMPT contains UTF-8 characters (e.g. '❯ ')

Calculate length of prompt correctly if `HSTR_PROMPT`
contains UTF-8 characters (e.g. `'❯ '`)
@dvorka dvorka requested review from Copilot and dvorka May 9, 2025 06:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies the prompt length calculation to correctly handle UTF-8 characters by replacing the call to strlen() with the wide char aware hstr_strlen() function.

  • Replaces the call to strlen() with hstr_strlen() in the prompt printing logic.
  • Ensures that prompts containing UTF-8 characters, such as "❯ ", are measured correctly for proper display.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant