Skip to content

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

@lelandbatey

Description

@lelandbatey

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions