PyCmd
PyCmd copied to clipboard
Use actual Unicode width when computing the cell-width of strings printed to the terminal
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.