summaryrefslogtreecommitdiffstats
path: root/term-utils
Commit message (Collapse)AuthorAgeFilesLines
* textual: remove some inconsistent periods from error messagesBenno Schulenberg2014-08-111-1/+1
| | | | | | While doing so, also improve translatability and some wordings. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* Revert "wall: wrap message header when it exceeds 79 characters"Karel Zak2014-07-291-6/+1Star
| | | | | | This reverts commit 93d7baf250495b2385c369afd48137a7363ae4c2. Ooops... it wasn't my plan to merge this patch. Sorry.
* wall: wrap message header when it exceeds 79 charactersSami Kerola2014-07-281-1/+6
| | | | | | | | Header truncation started to happen more often after commit d81c30553f4fb49173d38f69edff4b0b67a18b65 that made the header to be longer. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* agetty: Reprompt and reprint /etc/issue when askedStef Walter2014-07-282-12/+135
| | | | | | | | | | | | | | | | | | | | | Add an 'agetty --reload' command which asks all running agetty commands to display their prompts again. Several of the /etc/issue escape codes such as \4 and \S depend on variable data which can change after the agetty prompt is displayed. This can cause stale data to be displayed when a user looks at a VT, especially in cases of DHCP racing with system start up. We never want this to occur once the user has started typing a user name. So we detect when the user starts typing, after which no further reprompting occurs after that point. [kzak@redhat.com: - add #ifdefs to make it usable on non-inotify systems, - use futimens() with NULL timespec - add --reaload to usage()] Signed-off-by: Stef Walter <stefw-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* wall: add fallback for failed sysconf()Karel Zak2014-07-171-0/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: bring a few more man pages closer to standard formattingBenno Schulenberg2014-07-167-55/+53Star
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* setterm: remove unnecessary variableSami Kerola2014-07-131-2/+1Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: improve formatting and wording of usage textBenno Schulenberg2014-06-301-17/+17
| | | | | | | | Mainly: showing that the word color is a placeholder by writing <color>, showing some numbers as optional, and message levels and colors as not optional. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* setterm: improve wording and formatting of the man pageBenno Schulenberg2014-06-301-71/+76
| | | | | | | | The main changes are: showing the arguments of boolean options as optional, improving the alphabetization, and restoring the --half-bright option that went missing in 2011. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* script: clean up code to genenrate Star/Done messagesKarel Zak2014-06-231-9/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* script: silence the done message on --quiet as wellAndreas Henriksson2014-06-231-1/+2
| | | | | | | | | | Apparently James Hunts patch (which he provided a long time ago) is no longer covering it all. This followup patch also silences the "Script done ..." message when --quiet is used. Signed-off-by: Andreas Henriksson <andreas@fatal.se>
* script: --quiet option is not quiet.James Hunt2014-06-232-2/+4
| | | | | | | | | | | Specifying 'script --quiet ...' still produces the 'Script started' message in the typescript file. The --quiet option implies that the script program should not log any of its output to the typescript file. Originally reported at: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=693966 Signed-off-by: Andreas Henriksson <andreas@fatal.se>
* build-sys: fixes for non-Linux systemsSamuel Thibault2014-06-191-1/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: fix "behaviour" vs. "behavior"Karel Zak2014-06-062-2/+2
| | | | | | | | Sometimes we use "behaviour" and "behavior" in the same text, let's use "behavior" only everywhere. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1011068 Signed-off-by: Karel Zak <kzak@redhat.com>
* script: fix spurious exit from input read loop on EINTR.Csaba Kos2014-06-021-1/+2
|
* script: fix a rare deadlock after child terminationCsaba Kos2014-06-021-8/+45
|
* docs: setterm.1 clean up manual page groff styleSami Kerola2014-05-261-103/+164
| | | | | | | | Underline option arguments, and use bold for options. Avoid use of \f font style change in paragraphs, but use them when describing options. Reviewed-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* docs: setterm.1 add options compatibility noteSami Kerola2014-05-261-1/+11
| | | | | | | Both --option and -option formats are accepted. Reviewed-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* docs: setterm.1 add missing options to manual page and remove duplicateSami Kerola2014-05-261-4/+16
| | | | | Reviewed-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: add usage() descriptionsSami Kerola2014-05-261-34/+35
| | | | | Reviewed-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: add BUILD_{SCRIPT,SCRIPTREPLAY}Karel Zak2014-05-211-2/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* setterm: fix 'bright' in usage, remove unnecessary error messageKarel Zak2014-05-201-5/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* setterm: remove ulcolor and hbcolor duplicatesSami Kerola2014-05-191-4/+0Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: add set_blanking() actionSami Kerola2014-05-191-21/+36
| | | | | | This make over long perform_sequence() function a little bit shorter. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: mark some options to be exclusive with each otherSami Kerola2014-05-191-0/+9
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: various visual terminal effects are not console specificSami Kerola2014-05-191-8/+8
| | | | | | | Setting colors, making line not to wrap, and so on can be attempted in other than consoles. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: improve error messagesSami Kerola2014-05-191-5/+5
| | | | | | Reuse messages to make translation work easier. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: tell user when options does not effectSami Kerola2014-05-191-38/+45
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: improve perform_sequence() coding styleSami Kerola2014-05-191-57/+35Star
| | | | | | Delete pointless braces, new lines, and add spacing between operators. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: correct usage() bright color argumentSami Kerola2014-05-191-14/+12Star
| | | | | | | This has been wrong since commit 2dc8716. The bright is a prefix attribute to other colors. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: make -msglevel 0 to work as is did earlierSami Kerola2014-05-191-5/+7
| | | | | | | | Commit 3393c136 caused regression. The klogctl() logging range is 1-8, but the value 0 is special according to setterm.1 manual page. It turns on loging, same way as '-msg on' option. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: remove devfs and /dev/vcsa0 supportSami Kerola2014-05-191-27/+10Star
| | | | | | | | | The devfs files /dev/vcc/a* does not need to be supported, and vcsa0 has not existed in years if ever. Reference: http://lwn.net/Articles/65197/ Reference: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devices.txt?id=14186fea0cb06bc43181ce239efe0df6f1af260a#n260 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: clean up screendump()Sami Kerola2014-05-191-45/+47
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: add init_terminal() to make main() shorterSami Kerola2014-05-191-23/+25
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: add option control structureSami Kerola2014-05-191-199/+194Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: remove usage comment segmentSami Kerola2014-05-191-46/+0Star
| | | | | | | | It is enough trouble to keep usage output aligned with getopt() parsing, manual page, and bash-completion, so get rid of the unnecessary effort duplication. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: move show_tabs() and screendump() functionsSami Kerola2014-05-191-95/+92Star
| | | | | | | Earlier the function was in the middle of option parsing code segment, and screendump() required function prototype. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: use string utils to numeric parsingSami Kerola2014-05-192-37/+26Star
| | | | | | | Check the input numbers are numbers, which makes also the code shorter, and user experience better as half invalid imputs will error. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: recommend long options with double hyphenSami Kerola2014-05-192-84/+84
| | | | | | | | While the -version style options will work for next unknown number of years start moving towards user interface that has way of invoking long options as most of the other commands. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: use getopt_long_only() for option parsingSami Kerola2014-05-191-490/+426Star
| | | | | | | | | | | | | | The getopt_long_only() has advantage of allowing one and two hyphen versions of options, for example -help and --help. Secondly the getopt function family from libc can ensure some options requiring arguments, while other are optional, and some should not accept argument at all. That makes option parsing more robust. Unfortunately retiring the old option parsing makes this change greater than preferred. Assuming not mistakes happen the new code works functionally exactly as the old did. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: clean up includesSami Kerola2014-05-191-25/+15Star
| | | | | | | Use klogctl(2) from sys/klog.h just like dmesg(1). The rest is just reordering, and indenting. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* agetty: update man pageKarel Zak2014-05-191-8/+16
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: Update help usage functionBenjamin Robin2014-05-181-2/+5
| | | | Signed-off-by: Benjamin Robin <dev@benjarobin.fr>
* agetty: Fix implementation of option --nonewline. The flag F_NONL was never set.Benjamin Robin2014-05-181-0/+3
| | | | Signed-off-by: Benjamin Robin <dev@benjarobin.fr>
* agetty: use the "best" interface for \4 and \6Karel Zak2014-05-132-42/+67
| | | | | | | | | | | | The issue file escape sequences \4 and \6 prints the host IP when no interface is specified. That's useless on some virtual machines where gethostname()+getaddrinfo() returns 127.0.0.1. The seems better to print IP of the "best" interface (UP, RUNNING, non-LOOPBACK) and use gethostname() as painful fallback only. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1090935 Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: fix odd check for chardev/ttyKarel Zak2014-05-131-2/+2
| | | | | References: https://bugzilla.redhat.com/show_bug.cgi?id=1069902 Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: beside virtual consoles support xvc and hvc device lines as wellWerner Fink2014-05-131-12/+11Star
| | | | | | | | For this approach do not use the ioctl TIOCMGET anymore as this is for real serial lines only. But switch over to use the ioctl KDGKBMODE as this is unique to the virtual console lines only. Signed-off-by: Werner Fink <werner@suse.de>
* agetty: better support of the special system consoles on S390Werner Fink2014-05-131-5/+10
| | | | | | | | | | | | | | | | | That is that there are several consoles, the /dev/ttyS0 which is type of ibm3215 and a dumb terminal, then there is the device /dev/3270/tty1 which can handle ANSI color escape sequences and is a ibm327x terminal, and the /dev/ttyS1 which is a vt220 terminal. The macro is_speed() in agetty.c allows to distinguish between the terminal line (/dev)3270/tty1 and the speed options on the command line used in /run/systemd/generator/getty.target.wants/serial-getty@3270-tty1.service which is a symbolic link to /usr/lib/systemd/system/serial-getty@.service Signed-off-by: Werner Fink <werner@suse.de>
* agetty: avoid that agetty nor sulogin are fooled by a running plymouthWerner Fink2014-05-131-7/+68
| | | | | | | | The nowadays used plymouth locks the devices used for the system console which causes that agetty as well as sulogin can not modify the termios settings of e.g. the serial devices of the systenm console. Signed-off-by: Werner Fink <werner@suse.de>
* setterm: convert remaining magic values to symbolic referencesSami Kerola2014-05-121-20/+47
| | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>