readline
readline copied to clipboard
Several fixes
Hi, I'm glad to see you active, please take a look on these bugfixes/improvements
About the conflicting files: on ansi_windows if you leave like :
if c >= 30 && c < 40 {
color ^= COLOR_FINTENSITY
color |= ColorTableFg[c-30]
...
it will panic if by any chance someone outputs "\033[39m" since ColorTableFg only contains 7 items, for runebuf.go it seems the other PR has the same goals as the one I did so its up to you
This branch seems to resolve a panic I was getting on master with ReadPassword
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x1231381]
goroutine 1 [running]:
github.com/chzyer/readline.(*RuneBuffer).output(0xc42008a780, 0x0, 0xc420057638, 0x123259c)
/home/go/src/github.com/chzyer/readline/runebuf.go:494 +0xd1
github.com/chzyer/readline.(*RuneBuffer).print(0xc42008a780)
/home/go/src/github.com/chzyer/readline/runebuf.go:475 +0x2b
github.com/chzyer/readline.(*RuneBuffer).Refresh(0xc42008a780, 0x0)
/home/go/src/github.com/chzyer/readline/runebuf.go:465 +0xb2
github.com/chzyer/readline.(*Operation).Runes(0xc420110000, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/go/src/github.com/chzyer/readline/operation.go:388 +0xf9
github.com/chzyer/readline.(*Operation).Slice(0xc420110000, 0x12f7748, 0xc420048ba0, 0x0, 0x1, 0xc420094c60)
/home/go/src/github.com/chzyer/readline/operation.go:429 +0x2f
github.com/chzyer/readline.(*Operation).PasswordWithConfig(0xc420110000, 0xc420094c60, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/go/src/github.com/chzyer/readline/operation.go:417 +0xb5
github.com/chzyer/readline.(*Operation).PasswordEx(0xc420110000, 0x12e7987, 0x11, 0x0, 0x0, 0x3f, 0x0, 0x10118f5, 0x1518558, 0x3f)
/home/go/src/github.com/chzyer/readline/operation.go:405 +0x165
github.com/chzyer/readline.(*Operation).Password(0xc420110000, 0x12e7987, 0x11, 0x12e554a, 0x8, 0x12f7af0, 0x0, 0x0)
/home/go/src/github.com/chzyer/readline/operation.go:421 +0x55
github.com/chzyer/readline.(*Instance).ReadPassword(0xc4200e03c0, 0x12e7987, 0x11, 0x0, 0x10, 0xc420018400, 0x1518558, 0x0)
/home/go/src/github.com/chzyer/readline/readline.go:232 +0x43