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

fennel stdio client in conjure cause neovim to block forever? #232

Closed
glyh opened this issue Aug 1, 2021 · 13 comments
Closed

fennel stdio client in conjure cause neovim to block forever? #232

glyh opened this issue Aug 1, 2021 · 13 comments
Labels
bug Something isn't working client-fennel

Comments

@glyh
Copy link
Contributor

glyh commented Aug 1, 2021

Steps to reproduce

Here's the minimal init.lua to reproduce:

require('packer').startup( {function()
  -- Packer can manage itself
  use 'wbthomason/packer.nvim'
  use {'Olical/conjure', commit="8dedf17ad815ce78122c22d25e93777e3f2d8cfe"} 
end, config = {
  git = {
    default_url_format = "https://hub.fastgit.org/%s"}}})

vim.g["conjure#filetype#fennel"] = "conjure.client.fennel.stdio"

Then start neovim and install all plugins, and open some fennel file, then the neovim get stucks and nothing will happen, except I manually stop neovim with <C-c>, even the UI rendered by neovim is left in the terminal...

Some information

  • neovim version:
NVIM v0.6.0-dev+98-ga5c25e4f3
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 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -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-az87-30

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

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/share/nvim"

Run :checkhealth for more info
  • fennel: Fennel 0.10.0-dev on Lua 5.4
  • OS : Linux arch 5.13.6-arch1-1 #1 SMP PREEMPT Thu, 29 Jul 2021 00:21:06 +0000 x86_64 GNU/Linux
@Olical Olical added bug Something isn't working client-fennel labels Aug 4, 2021
@Olical
Copy link
Owner

Olical commented Aug 12, 2021

Hmm this is working absolutely fine for me 🤔 do you have fennel installed through luarocks, added it to your path and have a working lua instance?

@glyh
Copy link
Contributor Author

glyh commented Aug 12, 2021

I've installed it through AUR, which can be required from lua REPL.

I just tired out install fennel via luarocks

sudo luarocks install fennel

However, this results in the same bug ...

@Olical
Copy link
Owner

Olical commented Aug 12, 2021

So if you run fennel in your terminal it launches the REPL fine?

@glyh
Copy link
Contributor Author

glyh commented Aug 12, 2021

Yep

@glyh
Copy link
Contributor Author

glyh commented Aug 12, 2021

I've found that it's not blocking all the way, but make every key stroke lags, and most of the keystrokes are not responded...
Here's a video:
asciicast

@Olical
Copy link
Owner

Olical commented Aug 12, 2021

Hmm, could you share the output from your Fennel REPL? Mine is:

Welcome to Fennel 0.10.0 on Lua 5.2!
Use ,help to see available commands.
Try installing readline via luarocks for a better repl experience.

I'm wondering if that readline part is an important difference 🤔 I'm also wondering if this is related to Olical/aniseed#53

I can't reproduce either, so maybe if I can find a similarity between the two I can spot the issue. Or at least have some sort of clue.

@thiru
Copy link

thiru commented Aug 12, 2021

I'm having the same issue. It seems to only happen when the stdio REPL is used (which I just tried for the first time today):

vim.g["conjure#filetype#fennel"] = "conjure.client.fennel.stdio"

When run through Aniseed it seems to work for the most part. I also have readline installed @Olical but that doesn't seem to help. Here's my welcome message:

; Sponsored by @martinklepsch ❤
; --------------------------------------------------------------------------------
; "fennel" (started)
Welcome to Fennel 0.10.0 on Lua 5.4!
Use ,help to see available commands.

The reason I tried using the stdio REPL is because require wasn't working for me when attempting to load another .fnl file in the same directory. I'll open another ticket on it.

@thiru
Copy link

thiru commented Aug 12, 2021

Ahh actually readline is the issue. I tried uninstalling it and it works great. The relative .fnl require also works for me now.

I wonder if there's an easy way to start fennel without loading readline?

@thiru
Copy link

thiru commented Aug 12, 2021

I just asked about this on their Matrix channel and the main developer of Fennel (technomancy) about this and he said:

conjure should be setting TERM=dumb if it's running in a context that can't handle readline

@Olical
Copy link
Owner

Olical commented Aug 12, 2021 via email

@Olical
Copy link
Owner

Olical commented Aug 13, 2021

I've pushed a change to develop that hopefully addresses this in a fairly blanket way. Let me know if it looks better for you on the develop branch!

@glyh
Copy link
Contributor Author

glyh commented Aug 13, 2021

A lot better! Thanks a lot!

@Olical
Copy link
Owner

Olical commented Aug 14, 2021

Excellent! Thank you!

@Olical Olical closed this as completed Aug 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working client-fennel
Projects
None yet
Development

No branches or pull requests

3 participants