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

Characters not echoing after after using autocomplete #1

Closed
j0hax opened this issue Jul 6, 2021 · 6 comments
Closed

Characters not echoing after after using autocomplete #1

j0hax opened this issue Jul 6, 2021 · 6 comments

Comments

@j0hax
Copy link

j0hax commented Jul 6, 2021

Hello, I am the maintainer for the element package on NixOS!

I noticed that after using autocomplete, characters do not echo on the command line after the program exits. The only way known to me to fix this is by executing reset. This happens when using regular bash and bash --posix.

I've included an asciinema demonstrating the problem. Unfortunately I'm not familiar with Go, so I can't provide a PR, but I'd love to see a fix for this program!

asciicast

@gennaro-tedesco
Copy link
Owner

Good morning and thank you for looking into element!

I confirm that with bash I am seeing the same problem (which does not manifest if using zsh or fish); in particular it seems that such problem occurs only when exiting after the prompt selection: if instead the program exits because of a wrong command or an incorrect query, such inconsistency does not reproduce.

I would be inclined to think that the responsibility lies in the library I am using to show the prompt, namely go-prompt and the way it passes the exit codes to the shell (I have re-created a minimal prompt example independent of element where I see the same). If this is the case (I am not entirely sure yet, will do more testing) I believe we would have to open an issue in that project instead.

Just for reproducibility sake: could you report the specific of the system you are using (terminal, shell, operating system)?

@gennaro-tedesco
Copy link
Owner

gennaro-tedesco commented Jul 7, 2021

I have reproduced the issue by copying and pasting the documentation example: see below

Screen.Recording.2021-07-07.at.10.57.03.mov

so the problem is indeed the way go-prompt interacts with bash (independent of the rest of the code in element). Only after issuing reset does the prompt echo the characters again.

Please validate that this is the case on your hand too and if so we can open an issue there and reference this one for completeness.

@j0hax
Copy link
Author

j0hax commented Jul 7, 2021

Just for reproducibility sake: could you report the specific of the system you are using (terminal, shell, operating system)?

  • Terminal: Konsole
  • Shell: bash 4.4.23
  • OS: NixOS 21.11.20210704.20887e4

I could also reproduce the bug by running the dependency's provided examples.

I looked into the project and it appears this issue has already been reported in c-bata/go-prompt#228, c-bata/go-prompt#233 and a fix is provided by c-bata/go-prompt#239. It may be nice to integrate as a patch.

@gennaro-tedesco
Copy link
Owner

gennaro-tedesco commented Jul 7, 2021

So it seems that the PR is waiting to be merged. I would say we wait for the merge so that I can re-release element with the new dependency.

@DUOLabs333
Copy link

Yes -- for those that want an immediate fix: if you do git clone --depth=1 https://github.com/Xiami2012/go-prompt -b fix-termios-bad-save, cd into go-prompt, then go build, then do go get -u -v github.com/gennaro-tedesco/element again, it should work.

@gennaro-tedesco
Copy link
Owner

The PR has been merged, I am closing this as the issue should be fixed.

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

3 participants