Skip to content

Add support for zOS#226

Open
v1gnesh wants to merge 3 commits into
chzyer:mainfrom
v1gnesh:master
Open

Add support for zOS#226
v1gnesh wants to merge 3 commits into
chzyer:mainfrom
v1gnesh:master

Conversation

@v1gnesh

@v1gnesh v1gnesh commented May 28, 2023

Copy link
Copy Markdown

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


@v1gnesh

v1gnesh commented Jun 1, 2023

Copy link
Copy Markdown
Author

Hi @chzyer, when you have a chance, could you please review & pull this in?

@wader

wader commented Jun 1, 2023

Copy link
Copy Markdown
Collaborator

@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

@v1gnesh

v1gnesh commented Jun 1, 2023

Copy link
Copy Markdown
Author

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.
hashicorp/terraform#33195 (comment)

@wader

wader commented Jun 1, 2023

Copy link
Copy Markdown
Collaborator

@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?

@wader

wader commented Jun 1, 2023

Copy link
Copy Markdown
Collaborator

ping @slingamn for awareness (ergochat maintainer)

@slingamn

slingamn commented Jun 1, 2023

Copy link
Copy Markdown
Collaborator

@v1gnesh can you try ergochat/readline v0.0.3? I believe I added zos support already in ergochat/readline#10

@v1gnesh

v1gnesh commented Jun 2, 2023

Copy link
Copy Markdown
Author

@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 :) ?

@slingamn

slingamn commented Jun 2, 2023

Copy link
Copy Markdown
Collaborator

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: golang/term@b80969c

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.

3 participants