readline
readline copied to clipboard
Add support for zOS
Hi,
Firstly, thank you for this excellent project!
In this PR, I've updated the build tags in a few files to add support for zOS, which is an IBM Z (aka mainframe) operating system.
Test results look like this:
tmpdir: /tmp
=== RUN TestRetSegment
--- PASS: TestRetSegment (0.00s)
=== RUN TestSplitSegment
--- PASS: TestSplitSegment (0.00s)
=== RUN TestSegmentCompleter
--- PASS: TestSegmentCompleter (0.00s)
=== RUN TestRace
--- PASS: TestRace (0.00s)
=== RUN TestRuneWidth
--- PASS: TestRuneWidth (0.00s)
=== RUN TestAggRunes
--- PASS: TestAggRunes (0.00s)
PASS
ok github.com/chzyer/readline 1.018s
? github.com/chzyer/readline/example/readline-demo [no test files]
? github.com/chzyer/readline/example/readline-im [no test files]
? github.com/chzyer/readline/example/readline-multiline [no test files]
? github.com/chzyer/readline/example/readline-pass-strength [no test files]
? github.com/chzyer/readline/example/readline-remote/readline-remote-client [no test files]
? github.com/chzyer/readline/example/readline-remote/readline-remote-server [no test files]
=== RUN TestRuneWidth
--- PASS: TestRuneWidth (0.00s)
=== RUN TestAggRunes
--- PASS: TestAggRunes (0.00s)
PASS
ok github.com/chzyer/readline/runes 0.410s
... and the output from examples look like this:
$ cd readline-demo && go run .
» enhance
2023/05/28 01:05:08 you said: "enhance"
» mode
current mode: emacs
» login
please enter your password:
you enter: "boo"
» sleep
2023/05/28 01:06:15 sleep 4 second
» bye
$ cd ../readline-im && go run .
Hi, loopy! My name is Dave.
2023/05/28 01:07:39 Dave: hello
2023/05/28 01:07:41 Dave: hello
.
.
2023/05/28 01:08:44 Dave: bye
$ cd ../readline-multiline && go run .
> why
>>> test
>>> me;
why test me;
> bye;
bye;
$ cd ../readline-pass-strength && go run .
✔ ENT New Password:
Your password was: toostrong
⚠ ENT New Password:
Your password was: lame
Hi @chzyer, when you have a chance, could you please review & pull this in?
@v1gnesh hey, @chzyer haven't responded in quite a while. if your interesting some ppl have organised a fork with various fixes at https://github.com/ergochat/readline
Thanks for responding here @wader. Terraform depends on chzyer/readline, hence I'm here :) Would you/ergochat be able to request Terraform to switch to your fork?
EDIT: Coincidentally, someone has found a bug in chzyer/readline in the Terraform repo. So I've asked there if they can switch to ergochat/readline. https://github.com/hashicorp/terraform/issues/33195#issuecomment-1571571079
@v1gnesh I see, then your kind of in the same boat as us :) i'm not involved in terraform myself but maybe you can ask them about the situation?
ping @slingamn for awareness (ergochat maintainer)
@v1gnesh can you try ergochat/readline v0.0.3? I believe I added zos support already in https://github.com/ergochat/readline/pull/10
@v1gnesh can you try ergochat/readline v0.0.3? I believe I added zos support already in ergochat/readline#10
@slingamn Also curious... what's your story with zos :) ?
I have no connection to zos :-) I just upgraded readline's internal fork of x/term to v0.6.0, which added zos support in 2021: https://github.com/golang/term/commit/b80969c6736009821b4ff00232b82abb556c2c67