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

Deprecated: wcwidth callback via socket / OSC escape sequences #1

Open
wants to merge 28 commits into
base: master
Choose a base branch
from

Conversation

blueyed
Copy link
Owner

@blueyed blueyed commented Nov 7, 2016

See the README in the branch: https://github.com/blueyed/rxvt-unicode/blob/wcwidth-hack/README.md.

Done as a PR to allow for comments / review.

This make rxvt-unicode recognize Font Awesome [1], which only has glyphs
in the Private Use Areas (PUA) (xf000 - xf2b4), which are not tested by
`rxvt_font_xft::load`.
But is also has a glyph for 0x020 (Space).

This patch fixes the font from being ignored with the following message:

> urxvt: unable to calculate font width for
> 'FontAwesome-4:slant=0:weight=200:minspace=True', ignoring.

Not all glyphs will be displayed by rxvt-unicode (e.g. 0xf243
(fa-battery-1) is too wide still), but most of them will show up.

1: http://fontawesome.io/
`--enable-wcwidthcallback` needs the #ifdefs still.
This makes Zsh not think the wcwidth is broken, which makes it use its
internal one.
@blueyed
Copy link
Owner Author

blueyed commented Jan 11, 2017

Update: I'm using another approach by now, which uses a custom OSC escape sequence to query the wcwidth that urxvt's font returns.. would need to clean that up, but let me know if you're interested.

@kopr12
Copy link

kopr12 commented May 20, 2017

This one works fine, but it crashes from time to time with "Can't connect to socket..." or something like that. It's rare but it happens. I just tried your previous hack : exg/rxvt-unicode@master...blueyed:display-wide-glyphs
didn't use it for long, but I like it more (no LD_PRELOAD, sockets etc.) , however I had two icons cut in half, not a big deal, I guess I could replace those two with some other glyphs, anyway I think I'm going to replace this one (wcwidth callback) with that one and see if there are any more surprises.

However, I'm interested in that another approach (OSC escape sequence), so it would be great if you could upload that patch somewhere.

Thanks.

@blueyed
Copy link
Owner Author

blueyed commented May 20, 2017

@kajzersoze
Thanks for your feedback.
I am using the display-wide-glyphs branch/approach myself again, too (via https://aur.archlinux.org/packages/rxvt-unicode-cvs-patched-wideglyphs/).

The OSC escape sequences worked better than the socket, but are a) also slowish in general, and b) do not work if there is no tty attached, e.g. with tmux.

See also the README: https://aur.archlinux.org/cgit/aur.git/tree/README.md?h=rxvt-unicode-cvs-patched-wideglyphs

I have the OSC approach only locally (though it evolved quite a bit, allowing to toggle it etc), and would require some cleanup/work before pushing it somewhere. And given that it is not working too well also, it's not really worth it.

@blueyed
Copy link
Owner Author

blueyed commented May 20, 2017

however I had two icons cut in half, not a big deal, I guess I could replace those two with some other glyphs

Feel free to report it at https://github.com/blueyed/PKGBUILD-rxvt-unicode-wide.

@kopr12
Copy link

kopr12 commented May 20, 2017

I see, well never mind the OSC method then.

I think I see what might be the problem, I'm not using AUR, I'm on gentoo and I just made a patch from the link I gave earlier, from that AUR package link you gave above I can see there are 3 more patches beside the main one (I just used enable-wide-glyphs.patch, wish I knew about this AUR package, it would save me some time making manually that patch :) ), so that's why maybe I was having issues with couple of glyphs, I don't think sgr-mouse-mode.patch is related but those other two might be.
Thanks for the github link for that one, I'll move any issues from now on there.

btw I think I tried every possible scenario trying to fix this issue urxvt has with powerline fonts and only your hack helped, nothing else, so big thanks for making this !

@blueyed
Copy link
Owner Author

blueyed commented May 20, 2017

@kajzersoze
Yeah, rxvt-unicode is a very nice terminal, but not being able to use "broken" (as per upstream's opinion) is really bad.
I am not sure if the other patches are too much related - I've considered one of them to be wrong (as per upstream), but am using it by now anyway, since it avoids using URxvt*letterSpace: -1.
I've pushed my current urxvt font settings, in case that helps you: https://github.com/blueyed/dotfiles/blob/a17e446501eac7038d9618a83baa4a1dc6543477/Xresources#L93.

@blueyed blueyed changed the title WIP: wcwidth callback Deprecated: wcwidth callback via socket / OSC escape sequences May 20, 2017
@kopr12
Copy link

kopr12 commented May 20, 2017

Okay, well actually I think it might be my bad, I'll try it in a min and let you know, I forgot that this hack relies on adding whitespace after a glyph, it's probably that, will let you know as soon as I try.

@kopr12
Copy link

kopr12 commented May 20, 2017

Yeah that did it! It was my mistake, sorry about that.
One comment actually from your AUR package reminded me of that (adding whitespace)
That's it I guess, if I notice something else I'll report it in the proper place.
Thanks again!

@blueyed
Copy link
Owner Author

blueyed commented May 20, 2017

Awesome!
Thanks for reporting back / following up already.

@kopr12
Copy link

kopr12 commented May 20, 2017

I am not sure if the other patches are too much related - I've considered one of them to be wrong (as per upstream), but am using it by now anyway, since it avoids using URxvt*letterSpace: -1.

Indeed, didn't know that, very useful, I had URxvt*letterSpace: -2 :)
It was absolute must with the font I'm using.
I've included all 4 patches that you include plus 2 gentoo patches (nothing special) and I don't need that line anymore, having that line still affect things but with that patch it's not needed at all.
Have no idea what the mouse one does but I've used it anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants