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

added readline support #12

Closed

Conversation

A-UNDERSCORE-D
Copy link

This adds readline support, meaning that among other things, your lines don't get cut up if you're typing and a new raw line comes in, arrow keys can be used to edit lines, and history is kept

@DanielOaks
Copy link
Member

Awesome, nice change. So I'm gonna do some work on top of this and ensure that we preserve Windows compat, maybe make this functionality configurable, and will definitely merge it in!

@jesopo
Copy link
Contributor

jesopo commented Jan 27, 2022

bump xoxox

@slingamn
Copy link
Member

slingamn commented Mar 7, 2022

https://github.com/chzyer/readline looks abandoned. rlwrap(1) has been working OK for me, e.g.:

rlwrap ircdog --tls testnet.ergo.chat 6697

@DanielOaks
Copy link
Member

I think the main trouble I was having with this pr was just keeping windows+ansi compatibility is hard – if there's a solution/lib/etc that can provide this functionality while keeping those (at the same time, ie ansi on windows) working then I'm happy!

@slingamn
Copy link
Member

I took another look at this using github.com/chzyer/readline v1.5.1. I'm having some weird issues with the library. defer rl.Close() gets stuck here:

https://github.com/chzyer/readline/blob/7f93d88cd5ffa0e805d58d2f9fc3191be15ec668/terminal.go#L228

until the user presses the enter key. This stops the app from exiting in response to a server-side disconnection (e.g. one caused by the QUIT command).

I could try putting together a minimal test case for this and showing it to upstream...

@slingamn
Copy link
Member

Not calling rl.Close() is not a viable workaround: if it isn't called, (for example, if os.Exit() or log.Fatalf terminates the program), it leaves the terminal in a broken state.

@slingamn
Copy link
Member

slingamn commented Feb 6, 2023

chzyer/readline#217

@A-UNDERSCORE-D
Copy link
Author

Was generally behaving when I created this pr, however I haven't touched this in quite a while

@slingamn slingamn mentioned this pull request Feb 6, 2023
@slingamn
Copy link
Member

slingamn commented Feb 6, 2023

Sorry, I got lazy and was using this as the tracking issue for readline. I opened a real tracking issue at #28

@slingamn slingamn closed this Feb 6, 2023
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

Successfully merging this pull request may close these issues.

4 participants