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

[Bug] regression for example #21

Open
phanirithvij opened this issue Sep 20, 2023 · 5 comments
Open

[Bug] regression for example #21

phanirithvij opened this issue Sep 20, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@phanirithvij
Copy link

Bug reports

As I mentioned here, c-bata#212 (comment)

Expected Behavior

The new example should work normally, tabbing should switch, tab character should not be insterted in the text.

Current Behavior and Steps to Reproduce

Steps:

  • get the example from c-bata/go-prompt readme build and run unchanged
  • get the example from elk-language/go-prompt, build and run unchanged
  • compare
  • see gif below

Gif

Context

  • Operating System: linux, manjaro, tmux (also reproduced without tmux)
  • Terminal Emulator: (i.e. iTerm2) alacritty (also tried on Konsole same issue)
  • tag of go-prompt or commit revision: elk-language/go-prompt latest version v1.1.5 and c-bata/go-prompt latest version v0.2.6
@phanirithvij phanirithvij added the bug Something isn't working label Sep 20, 2023
@Verseth
Copy link

Verseth commented Sep 20, 2023

Thanks for reporting the bug.
The thing that surprises me is that _example/http-prompt works properly while being almost identical to _example/simple-echo which has this bug.

I'll look into it and try to fix it.

@phanirithvij
Copy link
Author

http-prompt also accepts tab as a valid input

@Verseth
Copy link

Verseth commented Sep 22, 2023

That alone doesn't constitute a regression. This was changed on purpose.
When no suggestions are available and you press tab, it should be inserted as two spaces (by default, you can configure the amount of spaces for a single tab).

@phanirithvij
Copy link
Author

phanirithvij commented Sep 22, 2023

That doesn't behave like any shell I know, it is becoming a text editor then.
Is it possible to disable this behavior then?

@Verseth
Copy link

Verseth commented Sep 22, 2023

That's because I intended to make it suitable for building interactive text-editor-like REPLs like ipython, I didn't intend to make it work like a basic shell.

But you're right, this behaviour should be configurable.
It's not possible to disable it right now, but I'll add it in the next patch, together with the bugfix.

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

2 participants