mirror of https://github.com/chzyer/readline.git
c30c5a000a
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. |
||
---|---|---|
doc | ||
example | ||
runes | ||
.gitignore | ||
.travis.yml | ||
CHANGELOG.md | ||
LICENSE | ||
README.md | ||
ansi_windows.go | ||
complete.go | ||
complete_helper.go | ||
complete_segment.go | ||
complete_segment_test.go | ||
go.mod | ||
go.sum | ||
history.go | ||
operation.go | ||
password.go | ||
rawreader_windows.go | ||
readline.go | ||
readline_test.go | ||
remote.go | ||
runebuf.go | ||
runes.go | ||
runes_test.go | ||
search.go | ||
std.go | ||
std_windows.go | ||
term.go | ||
term_bsd.go | ||
term_linux.go | ||
term_nosyscall6.go | ||
term_unix.go | ||
term_windows.go | ||
terminal.go | ||
utils.go | ||
utils_test.go | ||
utils_unix.go | ||
utils_windows.go | ||
vim.go | ||
windows_api.go |
README.md
A powerful readline library in Linux
macOS
Windows
Solaris
AIX
Guide
Repos using readline
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]