-
Notifications
You must be signed in to change notification settings - Fork 4
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
Remove display-graphic-p from icon checks #7
Comments
It's as designed since |
I agree it's a little more of a hassle but it's certainly not unsupported or unusable. Either way the way this plugin has implemented it there's no way to use Edit: Technically I'm not using that mode so this isn't an issue for me, instead I'm just setting |
Thanks for the update! I am curious how do you use |
I'm on linux, using st (here's my fork) a lightweight terminal built for the X window system. If you look in my fonts config for st you'll find I've added all the all-the-icons fonts as sparefonts meaning when my terminal tries to render a glyph not in my main font, it tries each font in sparefonts until it finds one that has the glyph. Thats' the terminal side, and it works reasonably well, however because all-the-icons uses multiple fonts there's a high chance a glyph will conflict between them. For example my octicon icon for repository is a clock due to how my font lookup precedence works. To get around that I'm using nerd-fonts (these have the highest priority in my terminal lookup) and then replacing any references to an all-the-icons font (eg: octicon) with the equivalent nerd-font (eg: nerd-oct). This is configured here. Lastly since most icons are double width (they take up the size of two characters when rendered) I've had to advise several functions to add another space when on terminal frames. For example this is how I do it with this package, or on some functions I just advise all the Here's my emacs config in case you want some more screenshots of icons on the terminal. |
@mohkale Thanks for your sharing! I've understood your solution completely. It would be better if you make a separate package. |
You mean fork ibuffer-all-the-icons? Or create a package that bridges the gap between nerd fonts and all-the-icons? The latter I've avoided since there's a pending issue in the nerd font package that I'm waiting on the maintainer to resolve. |
I mean the latter. And I found some icons are missing in nerd font, e.g. emacs. Is it still an issue? And I recalled, should consider this case: the user is using both terminal and GUI, but the icons don't work in terminal. The current solution is able to work. |
Yep, their really taking their time on it. 😞.
I mean I can do that? In the end my opinion on this is if you have a more complex workflow, you should configure it to handle that. If you can only support icons on graphical frames then don't use the terminal, or don't enable icons on either. You could even setup a hook that detects when a new frame is made and disables icons on all frames based on whether its on the terminal or the GUI. Hard-coding a dependence on a specific front-end is a bad idea. Consistency across GUIs and TTYs is one of emacs strong points. EDIT: Also correct me if I'm wrong but display-graphic-p doesn't stop icons being inserted in tty frames? It's not as if ibuffer is refreshed when you visit an existing buffer from a terminal frame. For example I can make the ibuffer on a graphical frame, make a new tty frame and then switch-buffer to it and the icons would still be there. |
Hi. A recent change to this project has invalidated the workaround I had in my config... so I'm asking again, please don't disable icons on terminal frames. The new implementation is baked directly into the minor mode so now I can't workaround it without advising away |
Right! I made a break change recently, to support daemon mode. Please see #9 (comment). |
I can see why you made it a minor mode and I agree it makes sense. I don't see why you're still preventing the mode from being used in terminal frames when I've demonstrated it works fine. Could you at the very least move it to an option I can disable. Something like |
@mohkale I know it's possible to display the icons in the terminal. Are you using icons-in-terminal or something else? all-the-icons doesn't support terminal officially, so
But this may be a good idea! |
I'm using all-the-icons. Perhaps scroll through the history of this issue ticket (it's been a while so I'd understand if you've forgotten). Since then I've also created a new package all-the-icons-nerd-fonts which contains the bulk of my configuration.
Which is an issue with their terminal configuration, not this package. Most terminal users would understand this (and barring that you can include a section in the README mentioning it). I'm fine with you disabling terminal support out of the box, that's likely a reasonable default, but atm there's no convenient way to enable it for terminal users which is my issue.
Great. PR incoming. |
The pactch 0c72213 has been commit. |
Ah, you're too fast for me. Thanks a bunch :-). |
@mohkale Welcome. When all-the-icons-nerd-fonts will be released to MELPA? And I remember some icons are missing in nerd fonts, e.g. Emacs 😢 |
Ideally when nerd-fonts#2 is fixed. That's been open for over a year so I'm not sure whether the nerd-fonts package is even still actively maintained. I could likely add a workaround in my package but it'd require some testing. If nerd-fonts itself isn't updated soon that's likely what I'd do, it's in my backlog.
Yes. Still an issue. It's not one I've faced yet since nothing in my nerd-fonts font conflicts with the emacs icon and I've got all of all-the-icons fonts in my lookup as well. To demonstrate you can take a look at my tmux status-line which has the emacs icon right there :-). |
Oh, thanks for the info. I will try nerd fonts, again. |
Great. If you're gonna try out all-the-icons-nerd-fonts any feedback would be appreciated :-). For reference here's the list of fonts I have and the order in which their configured. In way of terminals I'd recommend kitty. It has really nice font support letting you specify which individual glyphs you want from a font. It also has this really cool feature that shrinks a multi-character glyph to fit. So if you have a 2-character width icon it gets followed by a space it's shown as two characters, if you don't have the space it's resized and shown as a single character. In my terminal it just cuts off the icon at the halfway point 😢. I'll create a patch for st for this at some point as well :-). |
Could you share which terminal you're using and what configuration (if any) you have for it? |
I am using iterm2 with Hack Nerd Fonts on macOS. No special configurations. |
Hmmm... I can't really reproduce since I don't have a mac-os machine :/. I'd suggest making sure the right fonts are in the lookup. The question mark glyph shown there is often used when your terminal doesn't have any fonts with the glyph in its lookup. Edit: Looks like iterm doesn't support font-fallbacks. I'd suggest trying a terminal that can like mine (st) or one you can configure to like kitty. |
What fonts are you using for the fallbacks? I think there is no emacs icon in the latest nerd fonts. |
I linked it above. font is the main font, then it goes through each font in sparefonts until it finds one with an entry for the current glyph. |
Oh, I see. You are using st which is built by yourself. The solution seems not working for other terminals, unless building all fonts into one, IMO. Edit: I added this to ((all-the-icons-fileicon . "elisp") . (all-the-icons-nerd-dev . "gnu"))
((all-the-icons-fileicon . "emacs") . (all-the-icons-nerd-dev . "gnu")) |
You should be able to configure the scaling for individual fonts. In my case they were too big so I scaled them down a bit.
Why would you replace the emacs and elisp icons with GNU ones? Personally I prefer them staying as they are. |
Because there is no emacs or elisp icon in nerd-fonts. I have to use gnu icon instead, for testing purpose. |
I've got icons setup on my terminal but this plugin doesn't render them because it actively disables them on non GUI frames (here and here). It should be sufficient to have end-users disable
all-the-icons-ibuffer-icon
on non graphical frames if they don't want them so there's no need for the plugin to do so as well.The text was updated successfully, but these errors were encountered: