summaryrefslogtreecommitdiffstats
path: root/include/ttyutils.h
Commit message (Collapse)AuthorAgeFilesLines
* lib/ttyutils: introduce get_terminal_stdfd()Karel Zak2019-05-271-0/+1
| | | | | | Let's use separate function to detect what is the current terminal. Signed-off-by: Karel Zak <kzak@redhat.com>
* include/ttyutils: define values if missing.Sevan Janiyan2018-10-031-0/+34
| | | | | | | Upstreamed from pkgsrc. Addresses: https://github.com/karelzak/util-linux/pull/695 Signed-off-by: Karel Zak <kzak@redhat.com>
* script: add more info to script headerKarel Zak2018-05-141-0/+1
| | | | | | | | | | | | | | | | This patch introduces [...] to store extra information about terminal to the typescript header. For example: Script started on 2018-05-14 12:52:32+02:00 [TERM="xterm-256color" TTY="/dev/pts/3" COLS="190" LINES="53"] or Script started on 2018-05-14 12:54:01+02:00 [<not executed on terminal>] if stdout is not terminal. Addresses: https://github.com/karelzak/util-linux/issues/583 Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/ttyutils: return terminal lines tooKarel Zak2017-06-121-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: try to find tty in get_terminal_name()Sami Kerola2016-07-041-1/+1
| | | | | | | | Try all standard terminal input/output file descriptors when finding tty name in get_germinal_name(). This should make all invocations of the function as robust as they can get. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lib/tty: Pass default width to get_terminal_width()Boris Egorov2016-01-061-1/+1
| | | | | | | | | | Almost any code calling get_terminal_width() checks returned width for non-positive values and sets it to some default value (say, 80). So, let's pass this default value directly to the function. [kzak@redhat.com: - get_terminal_width() refactoring] Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: fixing FTBFS on !linux (Debian util-linux 2.20.1-1.2)Christoph Egger2014-09-171-0/+40
| | | | | | | Handle vc flags missing on FreeBSD Fix tty creation on kFreeBSD taking patch from 2.19 Addresses-Debian-Bug: #650185
* include: Add missing includesMichael Forney2013-10-041-0/+3
| | | | | | | | sys/types.h: For u_char typedef sys/params.h: For MAXNAMLEN sys/ttydefaults.h: For various tty definitions (also add configure check) Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: don't remove ECHOCTL from c_lflagKarel Zak2013-06-031-4/+2Star
| | | | | | | | It's really unexpected that arrows keys move cursor when agetty/login asks for login name or password. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=969458 Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/tty: don't hardcode terminal fd in get_terminal_name()Karel Zak2013-05-131-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include/ttyutils: add default chardataWerner Fink2013-01-081-0/+24
| | | | | | | | | | | | this one moves the init_chardata to include/ttyutils.h as well as to lib/include/ttyutils.c. Also the macros CTL/CTRL are fixed in agetty.c and sulogin.c to use the XOR variant CTL. [kzak@redhat.com: use macro rather than global variable for default chardata] Signed-off-by: Werner Fink <werner@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* include: cleanup copyright headersKarel Zak2013-01-081-0/+6
| | | | | | | We use the code from include/ and lib/ on many places, so use public domain if possible or LGPL for code copied from libs. Signed-off-by: Karel Zak <kzak@redhat.com>
* sulogin: remove consoles.c from libcommonKarel Zak2012-12-231-0/+9
| | | | | | | | - move struct chardata to include/ttyutils.h - move console.{h,c} to login-utils/sulogin-* (it's sulogin specific) - fix sulogin and agetty includes Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/ttyutils: add get_terminal_name()Karel Zak2012-11-221-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/ttyutils: create .c fileKarel Zak2012-11-221-32/+3Star
| | | | | | | | Well, now all tty stuff are incline functions in include/ttyutils.h. It's seems more elegant to create regular lib/ttyutils.c for libcommon and write test program. Signed-off-by: Karel Zak <kzak@redhat.com>
* include/ttyutils: more robust get_terminal_width()Karel Zak2012-05-151-2/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include: move get_terminal_width() to ttyutils.hPetr Uzel2012-05-151-0/+29
| | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* include/ttyutils.h: add include guardsDave Reisner2012-03-201-0/+4
| | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* agetty: move vc initialization to ttyutils.hKarel Zak2012-03-121-0/+73
... to make the code usable for sulogin. Signed-off-by: Karel Zak <kzak@redhat.com>