Special characters in zsh prompt with oh-my-zsh - zsh

I'm seeing some special characters after each command on zsh prompt (CentOS 6.10). I'm using oh-my-zsh and I've also installed Powerline fonts.
I'm using spaceship-prompt installed using zplug.

Spaceship-prompt obviously utilizes some characters the font you're using doesn't support.
The font in your screenshot is very different from the font in the OMZ screenshots. I would guess that you installed the Powerline font that is needed, but you aren't using it.

Related

Stylizing the assignment operator in RStudio [duplicate]

I looked at Fira Code and I wanted to try it out with one of the listed supported editors. So I launched RStudio (Version 0.99.491 on a Win box) and set the font to Fira Code but ... nothing. So how to enable font ligatures in RStudio?
EDIT: The trick in the accepted answer below still works for RStudio Version 1.0.44. I still wish there's a simple button to enable it.
I still wish there's a simple button to enable it.
Wish granted! We've just added this to RStudio 1.1.
You can try the preview release here:
https://www.rstudio.com/products/rstudio/download/preview/
RStudio now have a build in option for ligatures, you do not need these dirty hack any more, cheers!
[OLD CONTENTS]
Close RStudio
Open [RStudio dir]/www/index.htm (If you are using a Linux distribution, the dir may be /usr/lib/rstudio, thanks for the comment of #CosminSaveanu)
Add following code between <head> and </head>:
<style>*{text-rendering: optimizeLegibility;}</style>
Restart your RStudio.
dirty but works.
If you are using Linux then type in your Terminal,
sudo apt install fonts-firacode
Restart Rstudio then in Tools / Appearance / Editor Font: choose Fira Code and Apply.

Configure Z Shell ohmyzsh theme font on MacOS Catalina

I'd like to use Oh My Z Shell agnoster theme
https://github.com/ohmyzsh/ohmyzsh/wiki/Themes#agnoster
in .zshrc
ZSH_THEME="agnoster"
But after ohmuzsh installation , it look like some symbols are missing in default MacOS font for terminal. And agnoster says nothing about requirement for any specific font.
 ~/Workspaces/Java/project1   master 
P.S. Using MacOS Catalina
I had the same problem. You need to download these fonts:
https://github.com/powerline/fonts
And then change your preference settings per the instructions at the bottom of the readme:
iTerm2 users need to set both the Regular font and the Non-ASCII Font in "iTerm > Preferences > Profiles > Text" to use a patched font (per this issue).

Font issues while integrating ZSH on Visual Studio Code

I'm trying to integrate zsh on my VSC setup but apparently arrows are not recognized by it.
My zsh theme is agnoster and I've already tried adding "terminal.integrated.fontFamily": "Meslo LG M DZ for Powerline" with no success. Anyone experienced something like this and can give me a hand? Thanks.
Following this little guide solved the issue making-powerline-work-in-visual-studio-code-terminal.
IMPORTANT: if you already have a powerline font installed (e.g. it looks fine inside your system terminal), skip step 1.
Install a patched version of your desired font directly from https://github.com/powerline/fonts. Apparently doing the "quick installation" (e.g. sudo apt-get install fonts-powerline) does not work in this case. So you can install manually downloading the .ttf file directly or running the install script ./install.sh provided. For instance you can do the following:
Clone the repository:
git clone https://github.com/powerline/fonts && cd fonts
Run ./install.sh to install them all or install one specific font by going inside its directory and opening the .ttf file. For instance, manually installing DejaVu Sans Mono for Powerline:
cd DejaVuSansMono
Open DejaVu Sans Mono for Powerline.ttf
Install the font
Add the terminal.integrated.fontFamily to your User Settings settings.json in VSCode specifying the powerline font to use. For instance, if I want to use DejaVu Sans Mono for Powerline:
{
[...]
"terminal.integrated.fontFamily": "DejaVu Sans Mono for Powerline",
[...]
}
Restart Visual Studio Code
For me it worked for linux and as well as manjaro (i don't know why others solution weren't working for me).
Download this font download font from here , Then create a folder named "Meslo" and extract all the fonts inside it.
Move this folder to /usr/share/fonts/truetype/
Run this command:
sudo fc-cache -vf /usr/share/fonts/
In settings.json of vscode add this line:
"terminal.integrated.fontFamily": "MesloLGM Nerd Font"
Save and Restart if necessary, it should work. Done.
Finally made it work after going through many blogs and GitHub comments. The below steps works for macOS.
Clone the Menlo for powerline font
git clone https://github.com/abertsch/Menlo-for-Powerline.git
Open this folder in finder. Double click on Menlo for Powerline.ttf file.
Click on Install Font
Open the settings.json file in VSCode and add the below line.
"terminal.integrated.fontFamily": "Menlo for Powerline"
If you still can't see the fonts in the terminal try restarting VSCode.
You can use the above steps to use any font you want.
I had the same exact issue on my Macbook. The problem was that the font I was using in Iterm was not added in the Terminal of VSCode.
Fix
fix was simple, you have to go to open Iterm -> Preferences -> Profiles -> Text and copy the Font Name
now head over to VS Code:
Open settings
In the search bar, type Terminal Font
Paste the font name in Terminal > Integrated: Font Family
and that will fix the issue for you!
If you already have a font installed which is looking fine in your terminal app (for example in iTerm2) and the font is just messed up inside VSCode, you don't have to install any additional fonts. Just add:
{
...,
"terminal.integrated.fontFamily": "YourFontName"
}
to your settings.json
where YourFontName is the name of the font you would like to use. On macOS you can see what fonts you have installed in your font book (search for font book in the spotlight Command + Space) which looks like this:
In my case my settings.json has the following entry:
{
...,
"terminal.integrated.fontFamily": "MesloLGS NF"
}
Yey! This works for me... Ubuntu 20.04
Key: Shared fonts think.
https://cloverinks.medium.com/oh-my-zsh-agnoster-theme-not-showing-correct-font-on-vscode-ubuntu-47b5e8dcbada
Most of the other answers didn't solve the issue for me in Manjaro Linux (KDE).
I eventually found a solution that made the Powerline glyphs visible in my VS Code zsh terminal:
https://forum.manjaro.org/t/kde-powerline-glyphs-missing-in-vscode-integrated-terminal-only/63742/3
Just set the font to NotoSansMono Nerd Font. This font was already installed on my system. I did not need to download any additional fonts.
There are two ways to change the font in VS Code:
Change the following line in settings.json:
"terminal.integrated.fontFamily": "NotoSansMono Nerd Font"
Alternatively, go to Settings -> Features -> Terminal and set Terminal > Integrated: Font Family to:
NotoSansMono Nerd Font
You may need to restart VS Code.
I had the same problem with my VS Code, WSL terminal (PowerLevel10K) on Windows 10. It looked exactly like yours. I found that my Terminal>Integrated:Font Family was named incorrectly. I use "DroidSansMono Nerd Font". I had entered it as "Droid Sans Mono Nerd Font".
That is not the way the font name shows up in programs like Word, Notepad or Photoshop. When I entered as it was shown in notepad,
I closed and reopened my VS Code terminal and everything rendered as expected.
So check your installed font name in your operating system's word processing software and see how it is listed. Enter it likewise into Terminal>Integrated:Font Family and your VS Code terminal should render correctly also.
In manjaro, install MesloLGS fonts and change the setting to"terminal.integrated.fontFamily": "MesloLGS NF"
in settings.json
while the font path is ~/.fonts

Display issue with oh-my-zsh agnoster theme

I've added the theme in the zshrc file like so:
ZSH_THEME="agnoster"
But it ends up looking like this:
I'm on Ubuntu Gnome 16.04. What am I missing?
You just need to install a font that contains these characters. for example, you can install Powerline fonts using this command:
sudo apt-get install fonts-powerline
That worked for me as well.
As stated on the agnoster-github-page you need either a
Powerline-patched font
Font that contains the characters needed
Your currently used font seems to be missing the \ue0b0 char. It looks different from what it should look like (A full-line-height one-char-wide right pointing triangle)
I would look into some of these fonts:
Patched fonts for Powerline users
Being a fan of not using patched fonts I prefer Hack and FiraCode
I was having this issue on Debian 9 with urxvt.
Fixed it changing font to Hack. Thanks to #AnimiVulpis answer.
Install Hack font on Debian:
apt-get install fonts-hack-ttf
Configure on ~/.Xresources:
URxvt.font: xft:Hack:size=8
Install Melno For Powerline font and Change default terminal font.
$ git clone https://github.com/abertsch/Menlo-for-Powerline.git
$ cd Menlo-for-Powerline
$ sudo mv Menlo* /usr/share/fonts
Now open terminal
Edit->Preferences-> Unnamed-> Text -> Check Custom font
Now Select your Custom font as Melno For Powerline Regular

make iterm show ansi by default

My home and work computers are both running Mountain Lion w/ latest update.
However, on my work computer, I couldn't get ansi output by default when using laravel or symfony-console component. I need to use --ansi switch to get the colors. I'm using Solarized Dark color scheme.
In home computer, I don't need to set --ansi switch.
So, how can I set to detect terminal ansi by default ?
NOTE: I did try to add CLICOLOR=1 in .bash_profile file. It doesn't work.
Same with you, after check the Symfony\Component\Console\Output\StreamOutput. I install the php posix extension via sudo yum --enablerepo=remi install php-posix then the ansi color is enabled default!

Resources