blessed icon indicating copy to clipboard operation
blessed copied to clipboard

bugfix infinite loop in Terminal.wrap

Open jquast opened this issue 1 year ago • 1 comments

Closes https://github.com/jquast/blessed/issues/273 by @grayjk,

The following code enters an infinite loop:

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

This fixes by explicit check: when

  • the given individual sequence is of length '2'
  • and the wrap 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 avatar Jun 26 '24 16:06 jquast

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.57%. Comparing base (77fe25a) to head (edb5196). Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #275      +/-   ##
==========================================
+ Coverage   95.56%   95.57%   +0.01%     
==========================================
  Files          10       10              
  Lines        1037     1040       +3     
  Branches      177      165      -12     
==========================================
+ Hits          991      994       +3     
  Misses         43       43              
  Partials        3        3              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Jun 26 '24 16:06 codecov[bot]

poke @jquast @avylove

hoping this can get merged so I can remove a workaround for #273. thanks!

grayjk avatar Apr 24 '25 18:04 grayjk

yes, sure, i'll do it soon

jquast avatar Apr 26 '25 14:04 jquast

This is released, although the wheel has uploaded I'm having a problem with pushing the source tarball, it should get online eventually

jquast avatar Apr 26 '25 17:04 jquast