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

infinite loop in Terminal.wrap #273

Open
grayjk opened this issue Jun 20, 2024 · 1 comment · May be fixed by #275
Open

infinite loop in Terminal.wrap #273

grayjk opened this issue Jun 20, 2024 · 1 comment · May be fixed by #275
Labels

Comments

@grayjk
Copy link

grayjk commented Jun 20, 2024

Using blessed 1.20.0 and wcwidth 0.2.13, the following code enters an infinite loop:

import blessed
blessed.Terminal().wrap('\u5973', 1)
@jquast
Copy link
Owner

jquast commented Jun 20, 2024

Thank you!

I'm working through it, in the meantime the workaround is to set break_long_words=False,

import blessed
blessed.Terminal().wrap('\u5973', 1, break_long_words=False)

jquast added a commit that referenced this issue Jun 26, 2024
From #273,

> The following code enters an infinite loop:

    import blessed
    blessed.Terminal().wrap('\u5973', 1)

This fixes by explicit test: when the given individual sequence is
of length '2', and the width is '1', and the cur_len is '0', we cannot
break down this "Wide" character any further -- so it is allowed to
flow outside the given cell.

- 'faulthandler_timeout = 30' is added to [pytest] in tox.ini,
- Tests for East-Asian, Emoji, and ZWJ are added
- Further noting that blessed gets ZWJ wrong
@jquast jquast linked a pull request Jun 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants