Powerline symbols aren't working? - terminal

Hi I'm trying to use a power line theme for zsh and although I've installed the Powerline-symbols.otf and various fonts from the https://github.com/Lokaltog/powerline-fonts repo, I cannot get the Powerline prompt to show the symbols. Instead I get [X]'s where the symbols should be.
I'm using terminal and made sure that it is set to xterm-256 colours and utf-8 encoding.

Just downloading and installing the fonts is not enough. In order to get the Powerline symbols, you need to tell Terminal to use one of the patched fonts you downloaded.
This can be done from the menu Terminal->Preferences.... In Settings->Text click on the button Change... in the section Font. Choose any font with "Powerline" in its name and you should get to see the Powerline symbols.

I just set the font dejavuSansMono NF and problem solved

I didn't have the fonts in the font list. To install them you need to clone fonts
git clone https://github.com/powerline/fonts.git
then to open PowerShell and run
.\install.ps1
inside your fonts directory. If you get error
FullyQualifiedErrorId : UnauthorizedAccess
you need to update policies by running
Set-ExecutionPolicy Unrestricted
via PowerShell. After that try to install fonts again.
Now you will be able to change the font as instructed above by Adaephon

Related

How do I list fonts that are available to VSCode on macOS?

So, I have a patched version of Fira Code that I use in Terminal.app, which knows it by the name "Fira Code Regular Nerd Font Complete". If I enter that name in the editor font settings of VSCode it is clearly unrecognized.
How do I list fonts known to VSCode, and if it is missing altogether, what do I need to do to install it?
To list the fonts that are available, run the following command in the terminal:
system_profiler -json SPFontsDataType | grep \"family | sort | uniq
This will show the name you need to supply to VSCode to use the font.
Any font that is activated on the Mac will be available to VSCode. I am using a patched font, and by applying the name that is shown using the command above, I was able to use it in VSCode.

Wrong terminal emulator persists in VSCode

I'm currently using Debian Buster (10): installed a new terminal emulator (Alacritty) along with a new shell (ZSH); and configured my system to use this new terminal & shell as the defaults.
Unfortunately, VScode continues--regardless of the changes I make in my vscode settings file--to use some sort of defunct terminal. Notice the screwed-up styling:
screenshot of vscode with incorrect terminal
Anyone with knowledge on how to configure vscode to use the correct terminal would be very much appreciated. Thank you guys.
This is just a terminal font issue.
First you need to download and install a Powerline Font (there are quite a few, check this link for hints).
Then you need to assign that downloaded font to your terminal. You should add:
{
"terminal.integrated.fontFamily": "<your powerline font>"
}
to your settings.json file, or search in the gui settings Terminal integrated Font Family and add it there.
I personally use SauceCodepro NF which works great for me.

My Powerlevel10k doesn't work right (I use omz)

usually the powerlevel10k configurator asks you what style of powerlevel10k you want to run (lean classic etc.) when you press p10k configure. They didn't present me those options instead my they just asked me some other questions like if I wanted to display time and so on.
After that they defaulted my terminal to this:
Why doesn't it look like the usual powerlevel10k? And why doesn't it show me my icons even though I installed their MesloLGS Nffont
From the Powerlevel10k FAQ:
Some prompt styles are missing from the configuration wizard
[snip]
If there is no UTF-8 locale on the system, configuration wizard won't offer prompt styles that use
Unicode characters. Fix: Install a UTF-8 locale. Verify with locale -a.
[snip]
Command locale -a lists all installed locales. If you run it, you'll notice that there is no UTF-8 locale. So you need to install one. How you do that depends on your OS. Google "Install locale on your OS".

Installing powerline fonts for zsh + Prezto theme

I am currently using Zsh + Prezto for my scripting shell configuration. I have been using the sorin theme but am a little dissatisfied with it. I'd like to switch to the paradox theme!
It is supposed to look like this:
I'm having some trouble doing that. When I switch to the theme, the symbols aren't able to load, so I get a prompt that looks like this:
Notice the boxed question marks where there should be an edge border for the background or a branch symbol for the git branch. (Take a look at the paradox theme preview here).
I've seen here that I should install Powerline patched fonts for the symbols to load in correctly. However, as I'm somewhat unfamiliar with the process, I would love some help installing it into my OS X.
In the documentation, it notes I should install via pip. When I run pip install --user powerline-status, my prompt is still unable to display the symbols the way it should look.
What else must I do, after running the installation, to display this prompt correctly?
I am using a MacBook Pro with El Capitan
Update: I have installed the powerline fonts and run the install.sh exec, changed my terminal preferred font, and tested out the new look of the prompt. The symbols now display, however, they are raised from the baseline of the prompt row, like so:
Notice that the symbol of "\ue0b0" is elevated from the bottom of the row.
It is all about the Powerline symbols.
To get the Powerline symbols working as mike#Mikes-Laptop.local has:
Download a Powerline font. A good font for downloading can be found at https://github.com/powerline/fonts
Install it by running ./install.sh.
Change the font in your Terminal preferences to use the new Powerline font.
Test! To test the glyphs in a terminal:
echo "\ue0b0 \u00b1 \ue0a0 \u27a6 \u2718 \u26a1 \u2699"
The prior instructions were intended for Mac OS version 10.11 with Terminal, but may work similar for other setups.
On Windows - just
* download some Powerline font like:
https://github.com/abertsch/Menlo-for-Powerline/raw/master/Menlo%20for%20Powerline.ttf
* Install it by clicking the file twice
* Choose the new font in properties
That's it!
If you're a macOS user, the Powerline glyphs are now built-in to iTerm (as of 3.3.7, 17 Nov 2019) but disabled by default.
You can enable the fonts by toggling the checkbox in iTerm > Preferences > Profiles > Text:
Any newly opened Terminal windows will render supported Unicode characters as glyphs, as shown the following screenshot test.
$ echo "\ue0b0 \u00b1 \ue0a0 \u27a6 \u2718 \u26a1 \u2699"
If you'd rather manually manage the installation of the Powerline Symbols, you can use Homebrew Casks:
$ brew tap homebrew/cask-fonts
$ brew cask install font-powerline-symbols
This will install the PowerlineSymbols.otf typeface for you to use system-wide.
Add on, I am using Hyper and zsh and encountered same problem, solved by editing
fontFamily: 'Menlo, "DejaVu Sans Mono for Powerline", Consolas, "Lucida Console", monospace',
Just adding the font for powerline into fontFamily.
For anyone coming to this later, iTerm2 3.3.7 has a checkbox to use built-in Powerline glyphs. If you're not trying to get too fancy, this is an easy way to get those glyphs.
Preferences > Profiles > Text > Check that box
For Linux people that have to work in a local environment (i.e. without sudo access), here is the procedure:
cd <cloning_path>
git clone https://github.com/powerline/fonts-git --depth=1
cd fonts
./install.sh
That's it. You don't have to configure anything in a graphical menu like other answers say. Powerline fonts should be loaded and powerline symbols should automatically be used by the oh my zsh prompt
If you later want to un install the powerline fonts:
cd <cloning_path>/fonts
./uninstall.sh

Powerline (tmuxline and vim-airline) not showing the right characters [iTerm2, Mac OS X]

so I'm using tmuxline and vim-airline because I don't know how to install powerline for iTerm 2
Anyway they should be looking like tabs but there are characters here not showing. Can anyone help me out?
My question has been answered. Thanks guys!
For future viewers who might encounter the same problem. All you have to do is the following:
Write this in your terminal (iTerm2 etc...)
git clone https://github.com/powerline/fonts.git
Now find that file (usually ~/)
cd powerline/fonts
Then type
./install.sh
After that go to your terminals preferences (usually cmd+,) and go to profiles > profilename > Font (Change Font) > Search for "Powerline" and all the installed fonts for powerline should appear > apply.
Use Anti-aliased if you want, and you can separate into two different fonts so that you only need the powerline font for 'Non-ASCII', and your preferred font in 'Font'
Did you install the patched font, as mentioned in Installation on OS X?
Install downloaded patched font by double-clicking the font file in
Finder, then clicking Install this font in the preview window.
Despite the link is to powerline installation manual, vim-airline also suggests to install that font.
You need special fonts for tmux powerline. You can easily install them from the command line:
git clone https://github.com/powerline/fonts.git
sudo ./fonts/install.sh
Then you change fonts in iTerm2 (both regular and non-ASCII fonts).

Resources