coreutils
coreutils copied to clipboard
`stty`: Implement `--save` / `-g`
From the GNU manual:
‘-g’
‘--save’
Print all current settings in a form that can be used as an
argument to another ‘stty’ command to restore the current settings.
This option may not be used in combination with any line settings.
On my machine for example:
❯ stty --save
4100:5:bf:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
I suspect this is some base 64 encoding of the bits in the Termios
struct. Because this probably requires all the settings to be printed, this could be blocked by https://github.com/uutils/coreutils/issues/3861.