terokarvinen/micro-jump

No error message for missing pre-requisites on Windows

Closed this issue · 13 comments

New to micro - install your plugin via 'plugin install jump' but when I press the F4 key micro crashes/shuts down 🤔

(using micro on win10 - installed via choco)

Thanks for trying Jump on Windows, Heart1010.

Jump requires you to have the prerequisites installed and in your path, as listed in the README:

  • fzf
  • ctags

Do you have those in the path?

yes (both installed via choco)

PS C:\WINDOWS\system32> ctags --version
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Jul  9 2009, 17:05:35
  Addresses: <dhiebert@users.sourceforge.net>, http://ctags.sourceforge.net
  Optional compiled features: +win32, +regex, +internal-sort
PS C:\WINDOWS\system32> fzf --version
0.27.2 (e086f0b)

Do you have bash?

...this look like a windows/bash problem - the used bash can't find fzf/ctags executables
I have recorded my try and for a few msec I have found these errors
image

Great, I think you found the problem.

Do you know how to add those commands to PATH in Windows bash? In Linux, that would be something like

$ export PATH="/path/to/fzf:/path/to/ctags:$PATH"

Micro was installed over choco here on my win10 machine (same for fzf/ctags)- but the bash came from installing the win10 Debian Linux stack (win10 store).
So I think the main thing to check (I don't know how) is which bash that choco installed micro is using at all ;)
but that is out of the scope of your plugin I think

I added fzf/ctags to my .bashrc

~$ echo $PATH
/mnt/c/ProgramData/chocolatey/bin/fzf.exe:/mnt/c/ProgramData/chocolatey/bin/ctags.exe:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files/WindowsApps/TheDebianProject.DebianGNULinux_1.4.0.0_x64__76v4gfsz19hv4:/mnt/c/Users/Hermann/AppData/Local/Programs/Python/Python39/Scripts/:/mnt/c/Users/Hermann/AppData/Local/Programs/Python/Python39/:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/mnt/c/ProgramData/Oracle/Java/javapath:/mnt/c/Program Files (x86)/Intel/iCLS Client/:/mnt/c/Program Files/Intel/iCLS Client/:/mnt/c/WINDOWS/system32:/mnt/c/Program Files/gs/gs9.52/bin:/mnt/c/Program Files/gs/gs9.52/lib:/mnt/c/Program Files/Inkscape/bin:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/ProgramData/Lenovo/ReadyApps:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/mnt/c/Program Files/SourceGear/Common/DiffMerge/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/Intel/WiFi/bin/:/mnt/c/Program Files/Common Files/Intel/WirelessCommon/:/mnt/c/Program Files/PuTTY/:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/tools/BCURRAN3:/mnt/c/Program Files/dotnet/:/mnt/c/PHP:/mnt/c/Program Files (x86)/dotnet/:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/Hermann/AppData/Local/Microsoft/WindowsApps

but that didn't change aynthing regarding the not found fzf/ctags when I click F4 key in micro.

That looks promising.

About the scope thing: maybe micro-jump can't solve that situation without human intervention, but it could still give an error message.

Micro-jump calls bash, fzf and ctags in a one-liner

bash -c  "ctags -f - --fields=n 'foo.go'|fzf --layout=reverse|tr ':' '\n'|tail -1"

So, it might be interesting to try (interactively, on your bash command line):

$ fzf
$ ctags -f - --fields=n foo.go

I can see that your binaries are named .exe, which differs from how micro-jump calls them.

Ok

  • reverted/uninstalled that fzf/ctags win10 choco installations
  • installed fzf and ctags in the debian bash stack (with apt)
  • removed my own set paths to fzf/ctags windows versions

The fzf/ctags tests work in the debian bash stack

When I now run the choco installed micro and press F4 it doesn't crash anymore but I stand in the fzf screen (without any output)
image
I've recorded that test again and for a msec I can see a warning again - but only that (without any further ctags warnings/info/text) :(
image

You can test the main thing interactively to avoid millisecond timing. Replacing foo.go with your own file, what kind of error messages do you get?

$ ctags -f - --fields=n 'foo.go'
$ ctags -f - --fields=n 'foo.go'|fzf --layout=reverse
$ ctags -f - --fields=n 'foo.go'|fzf --layout=reverse|tr ':' '\n'|tail -1

all three commands looking good when I run them in the debian win10 linux stack bash but as said I don't know which bash micro is using (which was installed over choco 🤔)

You might get an idea what micro is using by calling bash from micro. What does this produce: ctrl-E

term bash --version

What are the first lines of the output of the commands above?

Unfortunately, it's unlikely to get this plugin to work on your system (Choko+Windows 10+Debian win10 Linux stack).

It will most likely require terminal emulation to run the plugin, because it uses terminal emulation to show fzf function selection dialog. In addition to that, your setup with multiple bashes is also a challenge. As you mentioned earlier, this is moving out of scope for micro-jump. Thus, I'm closing this issue.

Thank you for your report and prompt answers to my questions.