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] In the v0.2.6 , the icnl attribute of the stty is modified, but the attribute is not restored. v0.2.5 is ok #266

Open
xiangyu5632 opened this issue Nov 1, 2022 · 5 comments · May be fixed by #274
Labels

Comments

@xiangyu5632
Copy link

xiangyu5632 commented Nov 1, 2022

Bug reports

I use go-prompt to develop my own CLI client program. After exiting the client, press Enter and enter no line break. No command is displayed, but the command is executed. This can be eliminated by entering the stty sane command, so I determined that go-prompt modified the stty attribute. Switch to v0.2.5 and no problem.
the icnl attribute of the stty is modified, but the attribute is not restored.

Expected Behavior

bug

Current Behavior and Steps to Reproduce

That's how I used it:
fmt.Printf("openGemini CLI %s (rev-%s)\n", CLIENT_VERSION, "revision") fmt.Println("Please use quit, exitorCtrl-D to exit this program.") completer := NewCompleter() p := prompt.New( c.executor, completer.completer, prompt.OptionTitle("openGemini: interactive openGemini client"), prompt.OptionPrefix(">>> "), prompt.OptionPrefixTextColor(prompt.DefaultColor), prompt.OptionCompletionWordSeparator(FilePathCompletionSeparator), ) p.Run() return nil

That's how I find it :
bug2

  • Operating System: Linux (CentOS 8.5)
  • Terminal Emulator: XShell
  • tag of go-prompt or commit revision: 0.2.6
@xiangyu5632 xiangyu5632 added the bug label Nov 1, 2022
joeycumines added a commit to joeycumines/go-prompt that referenced this issue Aug 10, 2023
joeycumines added a commit to joeycumines/go-prompt that referenced this issue Aug 10, 2023
@joeycumines joeycumines linked a pull request Aug 10, 2023 that will close this issue
@joeycumines
Copy link

Fairly old issue I know, but I've fixed this issue @xiangyu5632 #274

I've forked it as well, though I'm hoping someone else is maintaining this.

@Verseth
Copy link

Verseth commented Aug 10, 2023

@joeycumines Unfortunately no one has been maintaining it for the last 2/3 years.

I've created a fork and merged lots of PRs from this repo.
There's lots of new functionalities like customisable syntax highlighting, multiline editing, customisable automatic indentation.

I use it to build a REPL for my programming language, but I want to maintain it as an independent library.

https://github.com/elk-language/go-prompt

I'd gladly look over your PR in my fork if you're interested.
A lot of changes have been done and the rendering system has been mostly rewritten, but this bug is still present.

@joeycumines
Copy link

It'll have to wait until tomorrow, but I'll take a look and probably make a PR, cheers @Verseth

@joeycumines
Copy link

It does appear to be fixed already in your fork, FYI @Verseth.

There's an additional minor (probably inconsequential) bug so I made a PR anyway: elk-language#16

I'm presently feeling a little apathetic towards the implementation as a whole, but I'll consider using your fork.

@joeycumines
Copy link

There was another bug specific to your fork @Verseth, it's also fixed in elk-language#16 - it restores the terminal parameters correctly, now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants