go-prompt icon indicating copy to clipboard operation
go-prompt copied to clipboard

[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

Open xiangyu5632 opened this issue 1 year ago • 5 comments

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 avatar Nov 01 '22 06:11 xiangyu5632