everforest icon indicating copy to clipboard operation
everforest copied to clipboard

Increase readability of PowerShell commands outputs

Open TayTTo opened this issue 1 year ago • 6 comments

I have done the following steps before reporting this issue:

  • [x] I have searched the existing issues
  • [X] I have read the FAQ in the help doc

Operating system/version

Windows 11

GUI client/version

Vim 9.1

Feature matrix

I have a problem with the terminal in side gvim. When I use the Everforest theme, the color of directory name's is not readable when I select it or move the cursorline to it. How can I change the color of directory in the terminal? Screenshot 2024-08-04 140701 Screenshot 2024-08-05 183058

Minimal vimrc that can reproduce this bug.

call plug#begin()
Plug 'prabirshrestha/vim-lsp'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim'

Plug 'mattn/vim-lsp-settings'
Plug 'mattn/emmet-vim'

Plug 'hrsh7th/vim-vsnip'
Plug 'hrsh7th/vim-vsnip-integ'

Plug 'sainnhe/everforest'


call plug#end()

" Important!!
if has('termguicolors')
  set termguicolors
endif

" For light version.
set background=light
let g:everforest_cursor = 'blue'
let g:everforest_colors_override = {'bg_visual': ['#CCE5FF', '255'], }


Steps to reproduce this bug using minimal vimrc

nothing

Expected behavior

I want the directory's name have the black or grey color

Actual behavior

The directories's name is not readable when I move the cursor line to it or select it.

TayTTo avatar Aug 05 '24 15:08 TayTTo

Sorry, the first image is not correct. Here it is. Screenshot 2024-08-05 183022

TayTTo avatar Aug 05 '24 15:08 TayTTo

Would you happen to have another light colorscheme you can test with and post the screenshot, so that I can better understand whether the problem comes from Vim or PowerShell?

antoineco avatar Aug 06 '24 08:08 antoineco

Would you happen to have another light colorscheme you can test with and post the screenshot, so that I can better understand whether the problem comes from Vim or PowerShell?

Yes, it also happened with other light colorscheme like solarized and even the default theme of Vim, note that I use pwsh as the terminal, but I can fix it by adding these line to the vimrc file: " Setting terminal's color

let g:terminal_ansi_colors = [
    \ '#fdf6e3', '#dc322f', '#859900', '#b58900',
    \ '#268bd2', '#d33682', '#2aa198', '#657b83',
    \ '#ffa07a', '#cb3b16', '#8da101', '#dfa000',
    \ '#839496', '#6c71c4', '#93a1a1', '#002b36']

highlight Terminal guibg='#fdf6e3' guifg='#657b83'

TayTTo avatar Aug 06 '24 09:08 TayTTo

PowerShell's default Get-ChildItem colors are notoriously bad and not adapted to light terminals. Tweaking things inside the colorscheme is somewhat possible, but feels like a stretch (this is a Vim colorscheme, after all).

Instead, I recommend configurting your shell, for example by installing a small PowerShell module: https://stackoverflow.com/a/30788506/4716370. Using that approach, any color configured through Vim should fit nicely in the output of PowerShell commands.

antoineco avatar Aug 06 '24 10:08 antoineco

I have successful config it, the solution is based on this discussion: " https://vi.stackexchange.com/questions/25456/how-can-i-change-the-colorscheme-of-the-vim-terminal-buffer ". This is my solution for it:

let g:terminal_ansi_colors = [
    \ '#fdf6e3', '#dc322f', '#859900', '#b58900',
    \ '#268bd2', '#d33682', '#2aa198', '#657b83',
    \ '#ffa07a', '#cb3b16', '#8da101', '#dfa000',
    \ '#839496', '#6c71c4', '#93a1a1', '#002b36']

highlight Terminal guibg='#fdf6e3' guifg='#657b83'

image

Still keep the colorscheme and also make the directory readable in visual mode. Reply to me if my solution makes the contribution.

TayTTo avatar Aug 09 '24 18:08 TayTTo

It's great that it works for you, and I appreciate you sharing your solution.

However such changes can't be accepted here because they don't apply universally. What works in PowerShell will not work in a Linux shell, mainly because the colors used here deviate from the usual ANSI colors semantics (on top of being off palette):

Screenshot 2024-08-09 at 22 10 58

Here is what things look like in a Linux shell with Everforest's defaults: Screenshot 2024-08-09 at 22 32 58

The fact that it works for 1 user in 1 very specific config (Windows + PowerShell + gVim + light mode) doesn't make it reasonable to enforce on everyone. A colorscheme's defaults ought to remain as universal as possible. The strange colors you are observing are caused by your shell being misconfigured, and can therefore be reproduced with any Vim colorscheme. Luckily, the beauty of Vim is that you can configure to you preferences, like you did.

As closing words, I am cross-referencing simialr issues that were opened in the past:

  • https://github.com/sainnhe/gruvbox-material/issues/105
  • https://github.com/sainnhe/gruvbox-material/issues/152

antoineco avatar Aug 09 '24 20:08 antoineco