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

vimade doesn't seem to be doing anything in terminal mode #1

Open
yunake opened this issue Jan 15, 2019 · 29 comments
Open

vimade doesn't seem to be doing anything in terminal mode #1

yunake opened this issue Jan 15, 2019 · 29 comments

Comments

@yunake
Copy link

yunake commented Jan 15, 2019

Great plugin! I've installed using native vim rtp loading and it seems to be working fine in GUI, but it isn't doing anything in terminal mode. How can i efficiently debug this issue? I'm using Tango palette in gnome-terminal and tilda, inside and outside of tmux, and 256 color support is working just fine, even true color in the apps that support it.

@TaDaa
Copy link
Owner

TaDaa commented Jan 15, 2019

Terminal is still a wip, currently it only supports the xterm 256 palette, but I can take a look as soon as I get some free time to see about adding gnome + tilda. Which colorscheme are you using?

@ryan-ph
Copy link

ryan-ph commented Jan 15, 2019

I'm experiencing the same on Alacritty and Tmux. I'm using quantum

@Ch00k
Copy link

Ch00k commented Jan 15, 2019

Second that. tmux + alacritty + base16 color schemes (both bash and vim).

@lervag
Copy link

lervag commented Jan 15, 2019

I use a solarized palette in urxvt.

@ryan-ph
Copy link

ryan-ph commented Jan 15, 2019

It seems to work on Alacritty if you set termguicolors, but if possible, it would be nice to have it function without termguicolors being set.

@yunake
Copy link
Author

yunake commented Jan 15, 2019

i'm on a slightly customised lucius colorscheme. didn't realize it would matter.

@TaDaa
Copy link
Owner

TaDaa commented Jan 17, 2019

pushed a fix where the normalid couldn't be resolved in some terminals, see if this resolves the issues for you guys

@daf
Copy link

daf commented Jan 17, 2019

Working for me in gnome-terminal. The first time I exited there was an error printed on the terminal from vimade, some python problem, but trying to replicate it, I can't get it to come back again. I'll keep an eye out.

Works in tmux too!

@daf
Copy link

daf commented Jan 17, 2019

Happened again but I can't reproduce it faithfully at all:

~ -> vim ~/tmp/dumpff.py 
Error detected while processing function vimade#CheckWindows[5]..provider#python3#Call:
line   18:
Invalid channel: 2~ ->

shows up on exit. Probably 1 in 15 exits will have this shown.

@TaDaa
Copy link
Owner

TaDaa commented Jan 17, 2019

always a complaint on line 18?

Also you on vim or neovim? I do see some similar errors floating around on neovim, issues with python threading or something -- but I'll have to get neovim setup later on my VM to debug

@Ch00k
Copy link

Ch00k commented Jan 17, 2019

see if this resolves the issues for you guys

no difference in my case, unfortunately :(

@daf
Copy link

daf commented Jan 17, 2019

@TaDaa yes, line 18, and I'm on neovim.

@TaDaa
Copy link
Owner

TaDaa commented Jan 17, 2019

@Ch00k sorry about that -- its taking me some time to setup alacritty (only have it working on mac atm) -- which OS are you using alacritty on? -- Also what is your output for "echo &t_Co" and "echo g:vimade"?

@Ch00k
Copy link

Ch00k commented Jan 17, 2019

@TaDaa I use macOS 10.13.6. I just tried to run vim inside and outside of tmux, and both the echo's produce the same result:

256
{'basebg': '', 'basefg': '', 'fadelevel': 0.4, 'rowbufsize': 30, 'colbufsize': 30, 'normalid': 84, 'checkinterval': 32}

@TaDaa
Copy link
Owner

TaDaa commented Jan 17, 2019

Running 10.14.1, works in alacritty + tmux 2.8 for me (unless I set termguicolors, that seems to break syntax highlighting in general). Does your :messages contain errors? Is syntax highlighting normally? Does vimade work in Alacritty by itself, if not does it work in the default terminal?

@TaDaa
Copy link
Owner

TaDaa commented Jan 18, 2019

You may see some change now! For terminal there was a possibility that ctermfg/ctermbg does not get set (when it uses the terminal defaults). There isn't a 100% way of getting the terminal settings (and tmux n, but Vimade should at least try now and default to 0/248 if it can't.

I think for best results on Alacritty, vimade needs a colorscheme that specifies Normal or vimade needs to be configured using g:vimade.basebg and g:vimade.basefg. I could not find a way to make Alacritty print out the colors like other xterm terminals could (so if any of you know how, let me know -- I may ask on their github later if not)

@TaDaa
Copy link
Owner

TaDaa commented Jan 19, 2019

Spoke too soon, almost there

@typoman
Copy link

typoman commented Jan 23, 2019

I can confirm the plugin works for native OSX (10.13.6) terminal app (xterm-256color).

@Ch00k
Copy link

Ch00k commented Jan 24, 2019

The latest code works for me in tmux with vim base16 colorscheme. Although vim startup is pretty slow now, and :messages still shows this:

Vimade: could not load terminal ansi colors, trying tmux...
Vimade: could not load tmux colors, make sure you either use a colorscheme that defines a background and foreground for 'Normal' or configure g:vimade.basefg and g:vimade.basebg

I have no custom vimade variables defined in my vimrc.

@perklet
Copy link

perklet commented Jan 25, 2019

The latest code works for me in tmux with vim base16 colorscheme. Although vim startup is pretty slow now, and :messages still shows this:

Vimade: could not load terminal ansi colors, trying tmux...
Vimade: could not load tmux colors, make sure you either use a colorscheme that defines a background and foreground for 'Normal' or configure g:vimade.basefg and g:vimade.basebg

I have no custom vimade variables defined in my vimrc.

Same Issue here

@TaDaa
Copy link
Owner

TaDaa commented Jan 25, 2019

Slowness should be fixed now guys and messages should be gone -- the terminal support should overall be a better experience I am hoping...

Here is what is supported:
autodetection of terminal background and foreground colors for vim8 tilix, kitty, gnome, rxvt, and any other terminal that can correctly return the background/foreground ansi requests. Tmux is also supported on the previously mentioned terminals (tmux depends on the terminal and then wraps the response in its own request code).

Neovim is not supported for autodetection of background/foreground yet. Instead vimade will default the fades based on white/black or vice versa depending on whether &background is light or dark...I am working on supporting autodetection on neovim and have a partially working hack but it requires hijacking the UI tty (since neovim is actually not the tty). I am a bit hesitant to put the hack in because its a bit fragile, but it might lead me to a better solution soon.

@TaDaa
Copy link
Owner

TaDaa commented Jan 25, 2019

Couple of Alacritty users here, so I opened an issue on Alacritty git regarding the ANSI codes not working, maybe they have an alternative
alacritty/alacritty#2039

@ChrisAmelia
Copy link

ChrisAmelia commented Jun 18, 2019

NVIM v0.4.0-762-g9420a2127 (AppImage), gnome-terminal

After having installed vimade with Vim-Plug: Plug 'TaDaa/vimade', it looks like vimade hasn't been added correctly, command VimadeEnable is not recognized (same for others commands). Any ideas?

@benfrain
Copy link

benfrain commented Apr 6, 2020

Neovim v0.4.3 and Nord theme, using iTerm2 v3.3.9.

I'm a front-end dev so entirely possible I'm doing something stupid but very little seems to change between panes. Attaching a grab whereby the top pane is active — notice that only some characters get dimmed/re-colored and line-numbers are unaffected. This is using this config for vimmade:

let g:vimade = {}
let g:vimade.fadelevel = 0.4
let g:vimade.enablesigns = 1

Screenshot 2020-04-06 at 18 18 25

@TaDaa
Copy link
Owner

TaDaa commented Apr 6, 2020

May need a minimal vimrc/init.vim and I'll try to reproduce the issue.

Also are you using tmux and is nvim using termguicolors or is it in 256 color mode?

@benfrain
Copy link

benfrain commented Apr 6, 2020

@TaDaa Hi! no tmux, my init.vim is here - that was saved up just before adding vimade as per earlier comment.

Here is the bit in the init.vim regarding colours:

if exists('+termguicolors') && ($TERM == "st-256color" || $TERM == "tmux-256color")
    let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
    let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
    set termguicolors
endif

@TaDaa
Copy link
Owner

TaDaa commented Apr 7, 2020

Thanks @benfrain

Few questions:

  • Can you confirm the output of echo $TERM?
  • What is the output of echo &termguicolors
  • If $TERM outputs something that is strange, can you try exiting nvim and setting TERM to xterm-256color.

@benfrain
Copy link

benfrain commented Apr 8, 2020

Thanks @benfrain

Few questions:

  • Can you confirm the output of echo $TERM?

=> xterm-256color

  • What is the output of echo &termguicolors

=> 0

BTW - I have noticed that if I open a split with :sp the new pane doesn't get highlighted. If I open my 'init.vim' file with my shortcut nnoremap <Leader>v :vsp $MYVIMRC<CR> that does make the other panes fade.

Is that because the :sp is opening the same file rather than a different one, so it doesn't know to dim it??

@TaDaa
Copy link
Owner

TaDaa commented Apr 8, 2020

That is right, :sp and :sp won't dim because its the same buffer (until the buffer changes via buffer switch, new, etc)

The partial highlighting is still strange to me, I have not been able to reproduce the issue, but we are also seeing different results in 256color mode (my background shows as black and not the nord theme).

It is possible that in 256color the approximation for the fade somehow calculated too close to the Normal ctermfg, which would result in the same color text. Might be worth trying to adjust the fadelevel to 0.3 or 0.2 and see if the text changes color at all. I will say termguicolors produces much better results if its an option for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants