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

Ansi output in different cases #327

Closed
4 of 9 tasks
dekz opened this issue Mar 2, 2017 · 10 comments
Closed
4 of 9 tasks

Ansi output in different cases #327

dekz opened this issue Mar 2, 2017 · 10 comments

Comments

@dekz
Copy link

dekz commented Mar 2, 2017

  • Category
    • Question
    • Bug
    • Suggestion
  • OS
    • Linux
    • macOS
    • Windows
    • Etc.
  • Vim
    • Vim
    • Neovim

:Files

screen shot 2017-03-02 at 2 38 36 pm

:Buffers

screen shot 2017-03-02 at 2 38 47 pm

The output is now coloured and works ok

:Buffers (Unsupported Ansi)

screen shot 2017-03-02 at 2 40 05 pm

Some how I've made ANSI unsupported in my Neovim configuration (since a clean Install works fine using your example in the Github Issue Template)

Is there a global way to disable ansi, :Files seems fine, but :Buffers uses ansi.

@junegunn
Copy link
Owner

junegunn commented Mar 2, 2017

export FZF_DEFAULT_OPTS='--no-color' should help, although even with the option the current version of fzf does not suppress colored text in the preview window, which should be fixed in the upcoming release.

@dekz
Copy link
Author

dekz commented Mar 2, 2017

λ env | grep FZF
FZF_DEFAULT_OPTS=--no-color
λ env | grep COLOR
λ echo $TERM
xterm

screen shot 2017-03-02 at 2 48 04 pm

@junegunn
Copy link
Owner

junegunn commented Mar 2, 2017

Did you properly export the variable?

@junegunn
Copy link
Owner

junegunn commented Mar 2, 2017

Works for me fine. The issue I mentioned regarding the preview window will be fixed in the next version.

junegunn/fzf@972fb1a

@junegunn junegunn closed this as completed Mar 2, 2017
@dekz
Copy link
Author

dekz commented Mar 2, 2017

Yep

I've attached an asciicast recording.

asciicast

@junegunn
Copy link
Owner

junegunn commented Mar 2, 2017

I'm pretty sure it's a configuration issue.

@dekz
Copy link
Author

dekz commented Mar 2, 2017

I am able to reproduce this in a Docker container with Bash + Neovim and only FZF and FZF.vim installed as plugins.

fzf version: 16.5

It is related to setting fzf layout options in vimrc.

let g:fzf_layout = { 'up': '~25%', 'options': '--reverse' }

Here is an asciicast with the options set and then unset, with the behaviour changing.

asciicast

@dekz
Copy link
Author

dekz commented Mar 2, 2017

I now realise adding --ansi to options

let g:fzf_layout = { 'up': '~25%', 'options': '--reverse --ansi' }

Enables it to display properly for me in this case.

Thanks for your work @junegunn

@junegunn
Copy link
Owner

junegunn commented Mar 2, 2017

Oh, you are not supposed to have options in g:fzf_layout. And that's the reason it's not working as expected. The options entry in g:fzf_layout overrides the correct set of options used by :Buffers command. I'm gonna make fzf throw an error if it's incorrectly used. Is there any blog post that suggests doing so? This seems to be a recurring mistake. #317 (comment)

@dekz
Copy link
Author

dekz commented Mar 2, 2017

Ah it could have been, or from someone else's github profile. I'll have a dig around.

My config had not changed in 6+ months, but I recently upgraded fzf.

I'll use the let $FZF_DEFAULT_OPTS = '--reverse' from now on. Thanks!

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

2 participants