mintty / wsltty

Mintty as a terminal for Bash on Ubuntu on Windows / WSL
Other
3.1k stars 103 forks source link

Display graphical symbols in terminal #22

Closed wclr closed 7 years ago

wclr commented 7 years ago

I believe it is not wsltty specific and kins of basic windows terminal issue, but still will ask for it:

This is neovim UI:

Is it possible to have instead of this (questions in squares): image

Normal graphical characters as it in mac/linux: image

mintty commented 7 years ago

How do you start the terminal? What font is configured? And: What neovim do you run? I don't see any on WSL and apt-get doesn't find one.

wclr commented 7 years ago

The screen shows https://github.com/vim-airline/vim-airline plugin for vim/neovim, so my flow to get it:

There is alsow FAQ and the first topic is about sybols and fonts https://github.com/vim-airline/vim-airline/wiki/FAQ

mintty commented 7 years ago

Doesn't work here, please quote the complete init.vim file as needed.

wclr commented 7 years ago

Considering that dein.vim was installed into /dein.vim, ~/.config/nvim/init.vim:

"dein Scripts-----------------------------
if &compatible
  set nocompatible               " Be iMproved
endif

" Required:
set runtimepath+=/dein.vim/repos/github.com/Shougo/dein.vim

" Required:
if dein#load_state('/dein.vim')
  call dein#begin('/dein.vim')

  " Let dein manage dein
  " Required:
  call dein#add('/dein.vim/repos/github.com/Shougo/dein.vim')

  " Add or remove your plugins here:
  call dein#add('Shougo/neosnippet.vim')
  call dein#add('Shougo/neosnippet-snippets')

  call dein#add('vim-airline/vim-airline')
  call dein#add('vim-airline/vim-airline-themes')

  " You can specify revision/branch/tag.
  call dein#add('Shougo/vimshell', { 'rev': '3787e5' })

  " Required:
  call dein#end()
  call dein#save_state()
endif

" Required:
filetype plugin indent on
syntax enable

" If you want to install not installed plugins on startup.
if dein#check_install()
  call dein#install()
endif

"End dein Scripts-------------------------
mintty commented 7 years ago

Here the status line looks like this (with normal less/greater characters): NORMAL >> [No Name] <<< 100% : 0: 1 <

:call dein#install() fails: [dein] You may have used the wrong plugin name, or all of the plugins are already installed. Press ENTER or type command to continue

wclr commented 7 years ago

It is ok plugin is installed and enabled. :call dein#install() fails because you have plugins installed due to

" If you want to install not installed plugins on startup.
if dein#check_install()
  call dein#install()
endif

So can you post a screenshot? I have this "squared question marks" symbols (near Normal, and on the right too): image

And window top: image

mintty commented 7 years ago

Apparently nvim isn't configured here as to output those symbols, yet. It will be more useful if you post a screen copy (not screen shot) of that line; mark with Shift+mouse-drag, paste into a file to upload here, or directly in here. So I can check which characters are actually being output and whether I can reproduce their rendering, without needing to get nvim run alike.

wclr commented 7 years ago

You see here: http://vi.stackexchange.com/questions/3359/how-to-fix-status-bar-symbols-in-airline-plugin

it is proposed to add symbols manually:

" unicode symbols
let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = '␤'
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = 'Ξ'

" airline symbols
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''

When I insert those symbols in the terminal, I got: image

mintty commented 7 years ago

Add the following option (config file or command line in your desktop shortcut): FontRender=uniscribe

wclr commented 7 years ago

image

No effect. Does it wok for you?

mintty commented 7 years ago

Yes, it makes the " unicode symbols section render well, but not the " airline symbols section because those characters use unassigned Unicode code points which can only render if you use a special font with proprietary mappings in those code points. image

wclr commented 7 years ago

hm, I still don't have unicode symbols:

image

mintty commented 7 years ago

Maybe the font fallback mechanism does not find a suitable font that would contain the characters? Please install DejaVu fonts and try again.

wclr commented 7 years ago

Should I install them in Windows or in ubuntu? I installed on windows all fonts from https://dejavu-fonts.github.io/Download.html (first archive) and made apt-get inistall ttf-dejavu in ubuntu

wclr commented 7 years ago

Ah ok, I changed the font in the options. to use DejaVu. Ok just need to use fonts from here https://github.com/powerline/fonts. Thanks.

The question: is it possible somehow to use different fonts inside the console?

mintty commented 7 years ago
wclr commented 7 years ago

Now it is all working, airline, icons, etc, I have patched consola font using https://github.com/ryanoasis/nerd-fonts

image

Thanks for your support.

On multiple fonts in the terminal, I believe advanced terminals may support this, I'm not an active users for terminals.

mintty commented 7 years ago

Thanks for the nerd link, I suppose that would enable the "airline symbols". Yet it would be useful to find out why the "unicode symbols" didn't work for you while they work here without any patching (with -o FontRender=uniscribe; I guess I should make that the default).

wclr commented 7 years ago

Yes nerd-font patcher has a lot of glyphs that can be injected in the font including airline symbols. Indeed FontRender=uniscribe not needed. Think issue may be closed now.

daviecar21 commented 6 years ago

Sorry for starting up this thread again but can you just please post a step by step instruction manual? I can't seem to follow what you guys are doing... Thanks!

wclr commented 6 years ago

@daviecar21 you just need to make (get) a font that contains glyphs, install and set it in the mintty Text options.

You can get ready to use my Consolas NF font here: https://github.com/whitecolor/my-nerd-fonts

mahoneyl commented 6 years ago

@whitecolor Hey I just made my first github account to say thanks for posting your solution. You helped me out!

roachsinai commented 5 years ago

Sorry for starting up this thread again, too. @whitecolor did you try win 1809 update? After the 1809 update the symbols not work for me (1803 works well), I have tried the font you paste the link.

mintty commented 5 years ago

Please check whether, after the update, your special fonts are still installed. For me, the "unicode symbols" are still displayed fine, Windows 1809.

roachsinai commented 5 years ago

In fact, I have reinstall one Nerd font and one powerline font after 1809 update. And install the font follow @whitecolor 's link.

image

But still not work,

image

mintty commented 5 years ago

This looks quite different from the problem initially described in this issue, and confusing. Please describe completely and precisely what does not work for you and how it can be reproduced.

roachsinai commented 5 years ago

You mean a new issue?

mintty commented 5 years ago

That's not the point, as you like. I mean a clear description of your problem.

roachsinai commented 5 years ago

Sorry I'll try to make a clear description.

My sitiution: Nerd font shows well before I update win10, means symbols shows on 1803 version, and doesn't show on 1809 version.

Erog38 commented 5 years ago

@mintty I started having this issue after the update as well. To reproduce:

1 Use Windows 10 1809

  1. Fresh install of wsltty

  2. Download Go Mono for Powerline from https://github.com/powerline/fonts/blob/master/GoMono/Go%20Mono%20for%20Powerline.ttf

  3. %APPDATA%/wsltty/config: BoldAsFont=yes Font=Go Mono for Powerline FontWeight=200 FontHeight=11 FontSmoothing=full Transparency=medium Locale=en_US AllowBlinking=yes ClipShortcuts=yes Rows=25 Language=en_US CtrlShiftShortcuts=yes OpaqueWhenFocused=no Scrollbar=none PgUpDnScroll=yes FontIsBold=no ShowHiddenFonts=yes FontRender=uniscribe OldFontMenu=yes

Everything was dandy before the 1809 update. Some symbols show properly, but others do not. If I can provide any more information please let me know.

mintty commented 5 years ago

I'm not sure that the current issue is the same as originally reported here. However, I think it's the same as #130.

Memphizzz commented 5 years ago

I experience the same Issue after upgrading to 1809 just a few minutes ago. I've been using IBM Plex Mono Text on Medium 12pt. The symbols are either missing or way too big and get cut off. I've tried reinstalling all *.otf files of that font, but no luck.

mintty commented 5 years ago

I experience the same Issue

This issue has become quite long and it is not clear whether all commenters are having the same problem. So please describe your issue, including a reproducible test case, i.e. text being output, link to font being used.

gartnera commented 5 years ago

Today I upgraded to 1809. I experienced the same issue. I tried a couple a bunch of different fonts. Of those, only this one worked: https://github.com/powerline/fonts/tree/master/DejaVuSansMono

roachsinai commented 5 years ago

Thanks @gartnera though I prefer mononoki. https://github.com/powerline/fonts/tree/master/DejaVuSansMono works.

zot commented 4 years ago

Hmm, the nerd fonts that work with the new windows terminal aren't working for me (not showing the git branch symbol) but the Source Code Pro font is.

mintty commented 4 years ago

See my previous comment.