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

some keys not responding immediately #616

Closed
jonsykkel opened this issue May 1, 2021 · 12 comments
Closed

some keys not responding immediately #616

jonsykkel opened this issue May 1, 2021 · 12 comments
Labels

Comments

@jonsykkel
Copy link

certain keys are doing weird stuff after commit 4c0efdc on freebsd
the events seem to not be processed immediately, but take effect after any other key has been pressed
if i press 'e', nothing happens, then for example 'j', the editor opens
same thing happens with 'q' and all my lfrc keybinds
clean lfrc, bash/zsh/sh, tmux makes no difference

@gokcehan
Copy link
Owner

gokcehan commented May 2, 2021

@jonsykkel It's the commit where tcell switched from /dev/tty to stdin for input processing. It's unfortunate if it breaks things in freebsd. There was a recent update in tcell which I haven't included in lf yet. Let's hope it fixes this issue. Marking this issue as a bug for visibility in the meantime.

@gokcehan gokcehan added the bug label May 2, 2021
@dv-blk
Copy link

dv-blk commented May 3, 2021

I too am experiencing this issue with gentoo.

@gokcehan
Copy link
Owner

gokcehan commented May 3, 2021

@jonsykkel @dv-blk I have tried using the latest tcell 2.2.1 instead of our local fork and it breaks things for me. Specificially gdamore/tcell@7694d90 makes the program require two keys to be pressed before doing anything which is similar to what you describe. Is it possible you are not building the program as a module with our own tcell fork?

@gokcehan
Copy link
Owner

gokcehan commented May 3, 2021

I think this is already reported as gdamore/tcell#452 and there are two PRs addressing the issue. I won't switch to 2.2.1 until things are stable.

@jonsykkel
Copy link
Author

@jonsykkel @dv-blk I have tried using the latest tcell 2.2.1 instead of our local fork and it breaks things for me. Specificially gdamore/tcell@7694d90 makes the program require two keys to be pressed before doing anything which is similar to what you describe. Is it possible you are not building the program as a module with our own tcell fork?

dont know the first thing about go so not sure how i verify that but it seems to use your fork according to the go build output:
jon@pc:~/code/lf$ go build
go: downloading golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d
go: downloading github.com/mattn/go-runewidth v0.0.10
go: downloading github.com/gokcehan/tcell/v2 v2.2.1-0.20210329222449-4dd2d52e83ef
go: downloading gopkg.in/djherbis/times.v1 v1.2.0
go: downloading golang.org/x/sys v0.0.0-20201119102817-f84b799fce68
go: downloading github.com/rivo/uniseg v0.1.0
go: downloading github.com/gdamore/encoding v1.0.0
go: downloading golang.org/x/text v0.3.0
go: downloading github.com/lucasb-eyer/go-colorful v1.0.3

@gokcehan
Copy link
Owner

gokcehan commented May 3, 2021

@jonsykkel Unfortunately, I'm not good at the Go build system either. And they keep changing things so it depends on what Go version you have. You may try enabling the go module mode with the environment variable to see if it helps. (i.e. export GO111MODULE=on). Also how do you install the binary after building? There was another person in the mailing list reporting the same thing and he said manually copying the binary after building fixes the issue. Maybe you can try simply running the binary without installing to see if the issue is fixed.

@jonsykkel
Copy link
Author

same story with GO111MODULE=on. i install the binary by just copying it to /usr/local/bin, and yeah running the binary without installing is what i did to figure out which commit breaks it

@gokcehan
Copy link
Owner

gokcehan commented May 3, 2021

@jonsykkel Then it might be the case that stdin is broken in freebsd and /dev/tty is broken in linux. We may need to wait for the discussion on tcell side to see how it goes.

@dv-blk Since you experience this on linux, I still suspect your issue might be due to not building from the source in module mod.

@okalm
Copy link

okalm commented May 15, 2021

I can confirm what @jonsykkel says. I am glad to find this report I wasn't sure certain if it was bug or my setup becoming weird.
Have to press two times when :
_ invoking personal actions scripts
_ exit lf
_ opening files sometimes also
_ start external software
Every time I wonder if I already pressed the key or not ...
Well this makes lf becoming not simple to use anymore.
lf: version 21
OS: FreeBSD 13

@gokcehan
Copy link
Owner

@okalm I imagine it's very annoying to use lf with this issue. There is an ongoing PR gdamore/tcell#454 on tcell side which can hopefully help us fix the issue.

gokcehan added a commit that referenced this issue May 16, 2021
@gokcehan
Copy link
Owner

Another PR is merged to tcell today and it does seem to work well on linux so I have now bumped our tcell to upstream v2.3.1. It would be nice if people here can build from the source to test if the issue is fixed on freebsd or not.

@jonsykkel
Copy link
Author

last commit indeed fixes it here

@gokcehan gokcehan closed this as completed Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants