Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose ability to modify arbitrary terminal attibutes via Term struct #22

Open
lelandbatey opened this issue Sep 27, 2016 · 1 comment
Labels

Comments

@lelandbatey
Copy link
Contributor

Currently, if I use the github.com/pkg/term package, there is no mechanism to allow a developer to modify arbitrary attributes of a terminal managed by a Term struct. This is unfortunate, since the Term struct exposes some great functionality, and it would be awesome if there where a way to use the Term struct, but manually set the attributes I want.

Why Is SetOption Publicly Exported?

What's odd is that the Term struct does have a method, SetOption, which seems like it would allow a developer to make the manual changes one desires. But SetOption accepts functions which modify Term, but since Term has no exported fields, no function defined outside of this package can access any fields of Term, meaning no externally defined function can make use of SetOption. Since SetOption isn't useful outside of this package (at least as far as I can tell), why is it exported publicly?

I think the quickest change to get the functionality I'm describing would be to make the fields of Term public. Barring that, some other way of manually setting terminal attributes would be awesome!

@davecheney
Copy link
Member

This package follows Rob Pike's functional options pattern. If there is a particular option you want to see added to this package, please raise it as a request or send a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants