You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when use oh-my-zsh , in most mono fonts, the width of ➜ charactor is 2, but pyte only move cursor 1, for wcwidth('➜') => 1, is there any way to resolve this problem if I don't want to change the font(cause I didnt find the font which this charactor's width is 1)
The text was updated successfully, but these errors were encountered:
haha, to get the cursor width pixel, I used a stupid but works code
cursor=screen.cursorself.cursor_x=cursor.xself.cursor_y=cursor.y# get the line text where the cursor isline=screen.display[self.cursor_y]
# to get the actual charactors befor cursor.xx=self.cursor_xwhile1:
w=wcswidth(line[:x])
ifw>self.cursor_x:
x-=1elifw<self.cursor_x:
x+=1else:
breaktext=line[:x]
char=line[x]
# calculate the pixel widthwidth_cursor_x=self.font.width(text)
when use oh-my-zsh , in most mono fonts, the width of
➜
charactor is 2, but pyte only move cursor 1, forwcwidth('➜') => 1
, is there any way to resolve this problem if I don't want to change the font(cause I didnt find the font which this charactor's width is 1)The text was updated successfully, but these errors were encountered: