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

mime type check leaks error message into prompt #133

Open
miversen33 opened this issue May 16, 2022 · 3 comments
Open

mime type check leaks error message into prompt #133

miversen33 opened this issue May 16, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@miversen33
Copy link
Contributor

Description

If you have a file with a truly awful file name (for example hello world %^&*()_-="'<,>.?|[{]}\), Telescope barfs and drops an error in the input box telling you that sh has cant resolve the name correctly. This error does not go away unless you close and reopen the file browser (and dont navigate to the awful file).

Discovered while testing another plugin and verified on my machine.

Neovim version

NVIM v0.7.0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-11 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=malloc -Wsuggest-attribute=cold -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/runner/work/neovim/neovim/build/config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include
Compiled by runner@fv-az316-460

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "
/home/runner/work/neovim/neovim/build/nvim.AppDir/usr/share/nvim"

Run :checkhealth for more info

Operating system and version

Ubuntu 20.04

Steps to reproduce

  1. Create garbage file
$ touch "garbage%^&*()_-=\"'<,>.?|[{]}\"
  1. Open neovim with minimal config
$ nvim -u minimal.lua
  1. Open Telescope
:Telescope file_browser
  1. Navigate cursor over garbage file
    Get the bork

Expected behavior

Telescope File Browser should be able to handle awful (but technically valid) file names

Actual behavior

String quoting failure it looks like?

Minimal config

-- minimal.lua
require('packer').startup(function(use)
    use 'nvim-telescope/telescope.nvim' -- Fuzzy Finder
    use "nvim-telescope/telescope-file-browser.nvim"
    
    if packer_bootstrap then
        require('packer').sync()
    end
end)
require("telescope").load_extension "file_browser"
@miversen33 miversen33 added the bug Something isn't working label May 16, 2022
@miversen33
Copy link
Contributor Author

Further notes, the file is opened when telling Telescope to open it, so it appears this is just a visual issue and not prohibitive to work flow.

@Conni2461
Copy link
Member

fd, for what its worth i've also seen this with live grep and other pickers but couldnt track it down yet. It only appeared randomly for me. I'll have to try these reproduce steps later

@fdschmidt93
Copy link
Member

fdschmidt93 commented May 16, 2022

It's the mime type check via file. I have the previewer turned off by default and didn't get that message in the prompt.

Commenting out mime-type checking immediately or using plenary.jobs as opposed to io.popen (as per nvim-telescope/telescope.nvim#1910) immediately solves the problem as the error message just leaks from the way we currently do mime type checking.

I hope to be able to complete the previewer RFC before 0.1 but have an important conference deadline end of June. Let's see. I have no sense of urgency to quick fix this stand alone as I suppose it's a rather rare issue 😅

@fdschmidt93 fdschmidt93 changed the title Terrible File Names dump error in input box mime type check leaks error message into prompt May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants