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

Cursor position is off when ZF_PROMPT has special characters like ansi escape codes #13

Closed
technicalpickles opened this issue Jan 5, 2023 · 4 comments
Assignees
Milestone

Comments

@technicalpickles
Copy link

I'm trying to use a character like as the ZF_PROMPT, but it seems like it the cursor is shifted way right of where text is actually inserted:

Screen.Recording.2023-01-05.at.9.53.29.AM.mov

This is even more pronounced when adding ansi color codes, ie ZF_PROMPT="\e[41m  \e[0m\e[31m\e[0m" :

Screen.Recording.2023-01-05.at.10.02.31.AM.mov
@natecraddock
Copy link
Owner

Hi @technicalpickles, thank you for the thorough bug report! There are two things wrong here

The first is that zf doesn't yet support Unicode. I haven't made that super clear yet though, so that's on me. I do have plans to add utf-8 support soon.

The second is that I don't escape the ANSI escape sequences. That's a bug and I can get that fixed sooner.

@natecraddock
Copy link
Owner

I have created two issues to track this: #15 and #16

I won't close this issue until both are completed

@natecraddock natecraddock added this to the 0.7.0 milestone Jan 6, 2023
@natecraddock natecraddock self-assigned this Feb 1, 2023
natecraddock added a commit that referenced this issue Feb 1, 2023
Correctly calculate the display width of the ZF_PROMPT by using ziglyph.

Closes #13
@natecraddock
Copy link
Owner

I have now resolved this in my https://github.com/natecraddock/zf/tree/unicode branch. You are welcome to test now if you would like, or just wait for the 0.7.0 release. I should be adding the remainder of the unicode support soon and releasing the new version.

@natecraddock
Copy link
Owner

Will be released in zf 0.7.0 soon (hopefully this week)

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

No branches or pull requests

2 participants