Readline is a pure go(golang) implementation for GNU-Readline kind library
Go to file
Thomas O'Dowd c30c5a000a Fix terminal resize race conditions
The runebuf, search and complete data structures all maintain their
own cache of the terminal width and height. When the terminal is
resized, a signal is sent to a go routine which calls a function
that sets the new width and height to each data structure instance.
However, this races with the main thread reading the sizes.

Instead of introducing more locks, it makes sense that the terminal
itself caches it's width and height and the other structures just
get it as necessary. This removes all the racing.

As part of this change, search, complete and runebuf constructor
changes to no longer require the initial sizes. Also each structure
needs a reference to the Terminal so they can get the width/height.
As the io.Writer parameter is actually the terminal anyway, the
simpliest option was just to change the type from the io.Writer to
Terminal. I don't believe that anyone would be calling these
functions directly so the signature changes should be ok. I also
removed the no longer used OnWidthChange() and OnSizeChange()
functions from these three structures.
2023-03-05 12:21:35 +09:00
doc update readme 2016-09-02 22:37:16 +08:00
example restore term when receive signal (#200) 2022-04-24 21:25:55 +08:00
runes Fix #43 , remove sub-package for gopkg compatiblity 2016-04-05 09:55:46 +08:00
.gitignore Fix ioloop groutine leaks bug. (#136) 2017-12-08 09:17:16 +08:00
.travis.yml travis: update go version (#128) 2017-10-01 22:55:11 -05:00
CHANGELOG.md correct spelling mistake (#127) 2017-10-01 22:57:10 -05:00
LICENSE Initial commit 2015-09-20 23:11:30 +08:00
README.md AIX support (#175) 2022-04-17 16:50:25 +08:00
ansi_windows.go Various screen redraw fixes for wide characters, narrow screens etc. 2023-02-28 11:00:57 +09:00
complete.go Fix terminal resize race conditions 2023-03-05 12:21:35 +09:00
complete_helper.go Dynamic autocompletion (#60) 2016-07-26 21:39:09 +08:00
complete_segment.go [completer] add SegmentAutoComplete 2016-04-12 14:04:56 +08:00
complete_segment_test.go [remote] fix test 2016-04-11 01:54:54 +08:00
go.mod Various screen redraw fixes for wide characters, narrow screens etc. 2023-02-28 11:00:57 +09:00
go.sum Various screen redraw fixes for wide characters, narrow screens etc. 2023-02-28 11:00:57 +09:00
history.go enabling disabling history (#102) 2017-10-02 20:42:28 +08:00
operation.go Fix terminal resize race conditions 2023-03-05 12:21:35 +09:00
password.go Fix panic for ReadPassword (#133) 2017-11-03 21:19:23 +08:00
rawreader_windows.go add comment 2015-10-09 11:13:07 +08:00
readline.go A Pager to list completion candidates if they don't fit on one page. 2023-03-04 18:59:22 +09:00
readline_test.go Bugfix/datarace prompt (#81) 2016-09-15 18:11:25 +08:00
remote.go Fix ioloop groutine leaks bug. (#136) 2017-12-08 09:17:16 +08:00
runebuf.go Fix terminal resize race conditions 2023-03-05 12:21:35 +09:00
runes.go Various screen redraw fixes for wide characters, narrow screens etc. 2023-02-28 11:00:57 +09:00
runes_test.go Various screen redraw fixes for wide characters, narrow screens etc. 2023-02-28 11:00:57 +09:00
search.go Fix terminal resize race conditions 2023-03-05 12:21:35 +09:00
std.go Fix ioloop groutine leaks bug. (#136) 2017-12-08 09:17:16 +08:00
std_windows.go finish windows support 2015-09-29 23:28:12 +08:00
term.go Added 'os400' (#201) 2022-04-18 20:41:19 +08:00
term_bsd.go Solaris support (#110) 2017-03-13 07:57:45 +08:00
term_linux.go Solaris support (#110) 2017-03-13 07:57:45 +08:00
term_nosyscall6.go Added 'os400' (#201) 2022-04-18 20:41:19 +08:00
term_unix.go Solaris support (#110) 2017-03-13 07:57:45 +08:00
term_windows.go fix windows compile error 2016-07-22 00:40:16 +08:00
terminal.go Fix terminal resize race conditions 2023-03-05 12:21:35 +09:00
utils.go Fix race condition between writing and prompting. 2023-03-04 18:35:07 +09:00
utils_test.go remove test for SplitByMultiLine 2016-03-31 00:19:18 +08:00
utils_unix.go A Pager to list completion candidates if they don't fit on one page. 2023-03-04 18:59:22 +09:00
utils_windows.go A Pager to list completion candidates if they don't fit on one page. 2023-03-04 18:59:22 +09:00
vim.go Add barebones support for yank/paste (#120) 2017-10-01 22:57:50 -05:00
windows_api.go finish windows support 2015-09-29 23:28:12 +08:00

README.md

Build Status Software License Version GoDoc OpenCollective OpenCollective

A powerful readline library in Linux macOS Windows Solaris AIX

Guide

Repos using readline

cockroachdb robertkrimen/otto empire mehrdadrad/mylg knq/usql youtube/doorman bom-d-van/harp abiosoft/ishell Netflix/hal-9001 docker/go-p9p

Feedback

If you have any questions, please submit a github issue and any pull requests is welcomed :)

Backers

Love Readline? Help me keep it alive by donating funds to cover project expenses!
[Become a backer]

Sponsors

Become a sponsor and get your logo here on our Github page. [Become a sponsor]