Skip to content

stty should accept $(stty -a) as its arguments #9056

@gnachman

Description

@gnachman

A common pattern to save and restore terminal state is:

SAVED=$(stty -g)
…do stuff that changes terminal state…
stty "$SAVED"

However, uu's stty cannot parse its own -g output.

bash-5.1$ /opt/homebrew/Cellar/uutils-coreutils/0.3.0/bin/ustty -g
6b02:3:4b00:200005cf:4:ff:ff:7f:17:15:12:0:3:1c:1a:19:0:0:16:f:1:0:14:0
bash-5.1$ /opt/homebrew/Cellar/uutils-coreutils/0.3.0/bin/ustty $(/opt/homebrew/Cellar/uutils-coreutils/0.3.0/bin/ustty -g)
ustty: invalid argument '6b02:3:4b00:200005cf:4:ff:ff:7f:17:15:12:0:3:1c:1a:19:0:0:16:f:1:0:14:0'

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