PyCmd icon indicating copy to clipboard operation
PyCmd copied to clipboard

Use actual Unicode width when computing the cell-width of strings printed to the terminal

Open horeah opened this issue 2 years ago • 0 comments

This was initially reported by @santagada in the context of the incremental history search (#1) but applies to several other places in the code: assuming that the number of terminal cells is equal to the number of characters in the printed string is incorrect for certain classes of Unicode characters!

The suggested solution is to use a package like wcwidth (https://pypi.org/project/wcwidth/) whenever terminal sizes and offsets are being computed.

horeah avatar Jan 28 '23 12:01 horeah