ryanoasis/nerd-fonts

how to set font in centos terminal

Closed this issue · 14 comments

Requirements

  • I have searched the issues for my issue and found nothing related or helpful
  • I have searched the FAQ for help
  • I have checked the Wiki for help

Experienced Behavior

I have installed the nerd fonts, but I don't know how to make the terminal use these fonts.

Expected Behavior

No response

Example Symbols or Text

No response

Font Used

JetBrainsMono

Source of Font File

./install.sh

Terminal Emulator (and the title of the terminal window)

screen-256color

Operating System and Version

centos7

Screenshots

No response

Which terminal emulator are you using? xterm, Gnome Terminal, ... ?

If you do not know, find out using ps like so:

Find current shells PPID (parent provess id)

2025-01-13_15-43

Invoke ps l in your terminal emulator.
I will show itself, with Process ID (PID) 113341 and Parent's ID PPID 97529 in my example.

Further up is Process 97529, the shell, zsh in my case, and its PPID is 97522.

That is the terminal emulator itself.

Look that up:

image

and you see I use tilix as terminal.

@Finii Thank you for your reply, my case is below:
image

Oh, this looks like you are on the (textual) console, and not under some graphical environment (like Gnome, KDE, ...).

Last time I checked the console fonts are limited to 512 256 (?) glyphs, in a codepage like manner.
That means NerdFonts is technically impossible to be used there, sorry.

Ah, see

I see. A server without a desktop environment wouldn't be able to install Gnome or KDE, so it seems that it's not possible to use nerd fonts for beautification on a remote server. Right?

When I work on a remote server I start from the local machine and connect to it via ssh.
In this case you ARE on a Gnome/KDE/MSWindows/macOS environment.
The font then needs to be installed on that (local) machine and activated in the terminal you use locally.
No change on the remote server side needed.

The only problem with console is if you are directly connected to that server machine, with a display connected to its graphics card or through a KVM setup.

Even if you connect to that remote server's console through IPMI or whatever, the display is rendered locally, and you can install and use the Nerd Fonts.

Thank you for your reply. I login the remote server by a web link. Let me try by ssh.

@Finii I have successfully installed Nerd Fonts on macOS and made them take effect. Now, the icons in LazyVim can be displayed, but quite a few icons are still not showing up. Is there any way to fix this?
image
image

Can you copy and past that (which is shown in the screenshot) as text into a comment?
Then I can determine the codepoint of the glyphs that do not work.

image

Seems you use Nerd Font Propo, I would suggest using either Nerd Font or Nerd Font Mono, but not the Propo variant.

In linux console, the text I copied is below:

 " Press ? for help                                                                                                                                          |
                                                                                                                                                            |~
.. (up a dir)                                                                                                                                               |~
/mnt/gt-data2/dtz/SparseOcc/                                                                                                                                |~
▸ __pycache__/                                                                                                                                              |~
▸ asserts/                                                                                                                                                  |~
▸ [✗]configs/                                                                                                                                               |~
▸ data/ -> /mnt/gt-data2/dtz/data/                                                                                                                          |~
▸ lib/                                                                                                                                                      |~
▸ loaders/                                                                                                                                                  |~
▸ [✗]models/                                                                                                                                                |~
▸ outputs/                                                                                                                                                  |~
▸ pretrain/                                                                                                                                                 |~
  [✭]core-nvim-127133-1736684431                                                                                                                            |~
  [✭]core-nvim-181513-1736690730                                                                                                                            |~
  gen_instance_info.py                                                                                                                                      |~
  gen_sweep_info.py                                                                                                                                         |~
  LICENSE                                                                                                                                                   |~
  old_metrics.py                                                                                                                                            |~
  ray_metrics.py                                                                                                                                            |~
  README.md                                                                                                                                                 |~
  [✭]tags                                                                                                                                                   |~
  timing.py                                                                                                                                                 |~
  train.py                                                                                                                                                  |~
  utils.py                                                                                                                                                  |~
  val.py                                                                                                                                                    |~
  viz_prediction.py                                                                                                                            

The copy&pasted text is obviously different. tags has a [*] in front and all the icons, that should show up at least as unknown character in t browser are absent. You really need to copy interactively from the display where you see the wrong icons 🤔

@Finii Sorry, I previously thought that what was copied from the console was what you wanted. The text I copied from iterm2 is below:

 /mnt/gt-data2/dtz/SparseOcc │ 1
  asserts │
  configs  │
  lib │
  loaders │
  models  │
 LICENSE │
 README.md │
* core-nvim-127133-1736684431  │
* core-nvim-181513-1736690730  │
ó°�  gen_instance_info.py
ó°�  gen_sweep_info.py
ó°�  old_metrics.py
ó°�  ray_metrics.py
ó°�» tags 
ó°�  timing.py
ó°�  train.py
ó°�  utils.py
ó°�  val.py
ó°�  viz_prediction.py
(9 hidden items) │

Image

Hmm, it looks like the icons are in the 5 digit range and some part of your involved application is not working with those.

Like codepoint F0001 or later (= new Material Design Icons).

It completely breaks the multibyte code apart into multiple glyphs. Maybe something is not working in utf8 mode.

4 digit (2 byte) code did work

Image

If there would be Microsoft involved I'd guess it is represented as USC2 instead of utf16 which would result in similar breakage.

I guess something in not transporting the codepoint correctly.

Apart from these very vague tips I can hardly help. The font itself (and this Nerd Fonts) is not the reason here. Sorry.