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

setterm --clear rest doesn't work #861

Closed
bugrasan opened this issue Sep 6, 2019 · 1 comment
Closed

setterm --clear rest doesn't work #861

bugrasan opened this issue Sep 6, 2019 · 1 comment

Comments

@bugrasan
Copy link

bugrasan commented Sep 6, 2019

versions: setterm from util-linux 2.33.1 on Ubuntu 19.04 and setterm from util-linux 2.34 on Manjaro

according to setterm help:
--clear [all|rest] clear screen and set cursor position
also according to man page:
--clear [all|rest] Without an argument or with the argument all, the entire screen is cleared and the cursor is set to the home position, just like clear(1) does. With the argument rest, the screen is cleared from the current cursor position to the end.

however then i do:

$ setterm --clear rest
setterm: argument error: 'rest'

according to source code this needs to be reset
https://github.com/karelzak/util-linux/blob/2c308875a7fa1aaa44892c368f6b37bcfcb8879a/term-utils/setterm.c#L617

furthermore according to the man page description above --clear can be used Without an argument or..., however:

$ setterm --clear
setterm: option '--clear' requires an argument
Try 'setterm --help' for more information.

however according to source code it requires a argument https://github.com/karelzak/util-linux/blob/2c308875a7fa1aaa44892c368f6b37bcfcb8879a/term-utils/setterm.c#L500

karelzak added a commit that referenced this issue Sep 10, 2019
* make argument optional as in the original version
* fix typo (reset -> rest)

Addresses: #861
Signed-off-by: Karel Zak <kzak@redhat.com>
@karelzak
Copy link
Collaborator

Thanks for your report! Fixed.

Note that optional arguments in GNU universe requires '=', for example --clear=all. I have fixed man page and --help to make it more obvious for end-users.

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

No branches or pull requests

2 participants