-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Links/URLs get offset when certain unicode characters are printed #8709
Comments
Oh weird. I would have thought this was a dupe of #8121, but that one was fixed in 1.5.3142, so this must be it's own variation on the subject. Those 𝓐 characters are really messing it up, huh. |
It looks a lot like it, going the other way from the screen of that issue.
Yeah, I found the problem when printing display usernames from an api. Not only the |
The 𝓐 is considered as two wide chars because of #8124. Another place we might want to use a comprehensive Unicode width estimator . |
Definitely more characters than that, e.g. 🎟.
|
) <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Properly handle UTF-16 surrogates when calculating the position of matched pattern. Fix #8709 <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References https://github.com/microsoft/terminal/blob/b88ffb21b0725331877ba76bac5a79a4c21eaa03/src/buffer/out/search.cpp#L335-L339 <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [ ] Closes #8709 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [ ] Schema updated. * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments use `Utf16Parser::Parse` to handle code points from U+010000 to U+10FFFF in UTF-16. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed ![image](https://user-images.githubusercontent.com/1068203/145421736-c842c7d4-0136-42d0-ad72-f004f58d9e3b.png) also the case by @mas90 #8709 (comment): ![image](https://user-images.githubusercontent.com/1068203/145420264-3fe220b4-42c5-44ac-aa94-4e604b164ed3.png)
) <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Properly handle UTF-16 surrogates when calculating the position of matched pattern. Fix #8709 <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References https://github.com/microsoft/terminal/blob/b88ffb21b0725331877ba76bac5a79a4c21eaa03/src/buffer/out/search.cpp#L335-L339 <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [ ] Closes #8709 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [ ] Schema updated. * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments use `Utf16Parser::Parse` to handle code points from U+010000 to U+10FFFF in UTF-16. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed ![image](https://user-images.githubusercontent.com/1068203/145421736-c842c7d4-0136-42d0-ad72-f004f58d9e3b.png) also the case by @mas90 #8709 (comment): ![image](https://user-images.githubusercontent.com/1068203/145420264-3fe220b4-42c5-44ac-aa94-4e604b164ed3.png) (cherry picked from commit a2d96d6)
) <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Properly handle UTF-16 surrogates when calculating the position of matched pattern. Fix #8709 <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References https://github.com/microsoft/terminal/blob/b88ffb21b0725331877ba76bac5a79a4c21eaa03/src/buffer/out/search.cpp#L335-L339 <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [ ] Closes #8709 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [ ] Schema updated. * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments use `Utf16Parser::Parse` to handle code points from U+010000 to U+10FFFF in UTF-16. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed ![image](https://user-images.githubusercontent.com/1068203/145421736-c842c7d4-0136-42d0-ad72-f004f58d9e3b.png) also the case by @mas90 #8709 (comment): ![image](https://user-images.githubusercontent.com/1068203/145420264-3fe220b4-42c5-44ac-aa94-4e604b164ed3.png) (cherry picked from commit a2d96d6)
Clever quick fix -- thanks @comzyh! I'm rolling this into the 1.11 and 1.12 servicing releases we're putting out to make Terminal more robust over the holidays. :) |
🎉This issue was addressed in #11915, which has now been successfully released as Handy links: |
🎉This issue was addressed in #11915, which has now been successfully released as Handy links: |
Which version of Terminal are you using? This issue was closed two years ago 🙂 |
@DHowett I think this regressed recently, because I was able to reproduce the issue until I got the update from 3 days ago. I'm assuming it was fixed by this:
@CerebralDatabank Bottom line is you probably just need to get the very latest update. |
@DHowett Haha I knew that, but what can I say, I still have the issue 😅 thought replying here was better than opening a duplicate lol @j4james I think you're right, latest stable is If I install the latest release via the |
you know what, that's totally fair! hah!
Nope, you can install the |
Environment
Steps to reproduce
Print certain unicode characters like this one:
𝓐
Expected behavior
Links/URLs should be valid.
Actual behavior
Links/URLs get offset and break with the presence of certain unicode characters.
For example, if the following text is printed:
The hoverable link, clickable link and opened link is
ps://microsoft.com/
If those unicode characters are not printed (if you scroll for example), the links work again.
2021-01-05_22-44-13_kWeoQrwJie.mp4
Note that the emoji doesn't cause the issue.
The code used in the video is:
The text was updated successfully, but these errors were encountered: