You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
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.
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 aTerm
struct. This is unfortunate, since theTerm
struct exposes some great functionality, and it would be awesome if there where a way to use theTerm
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. ButSetOption
accepts functions which modifyTerm
, but sinceTerm
has no exported fields, no function defined outside of this package can access any fields ofTerm
, meaning no externally defined function can make use ofSetOption
. SinceSetOption
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!The text was updated successfully, but these errors were encountered: