Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase readability of PowerShell commands outputs #143

Open
2 tasks done
TayTTo opened this issue Aug 5, 2024 · 6 comments
Open
2 tasks done

Increase readability of PowerShell commands outputs #143

TayTTo opened this issue Aug 5, 2024 · 6 comments
Assignees

Comments

@TayTTo
Copy link

TayTTo commented Aug 5, 2024

I have done the following steps before reporting this issue:

  • I have searched the existing issues
  • 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 TayTTo added the bug label Aug 5, 2024
@TayTTo
Copy link
Author

TayTTo commented Aug 5, 2024

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

@antoineco antoineco self-assigned this Aug 6, 2024
@antoineco
Copy link
Collaborator

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?

@TayTTo
Copy link
Author

TayTTo commented Aug 6, 2024

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'

@antoineco
Copy link
Collaborator

antoineco commented Aug 6, 2024

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.

@TayTTo
Copy link
Author

TayTTo commented Aug 9, 2024

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.

@antoineco
Copy link
Collaborator

antoineco commented Aug 9, 2024

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:

@antoineco antoineco changed the title Increase readability of terminal. Increase readability of PowerShell commands outputs Aug 9, 2024
@antoineco antoineco added enhancement and removed bug labels Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants