File: console.h

package info (click to toggle)
snapper 0.10.6-1.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,072 kB
  • sloc: cpp: 24,846; ansic: 1,466; sh: 1,410; makefile: 514; python: 127; ruby: 90
file content (31 lines) | stat: -rw-r--r-- 867 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*---------------------------------------------------------------------------*\
                          ____  _ _ __ _ __  ___ _ _
                         |_ / || | '_ \ '_ \/ -_) '_|
                         /__|\_, | .__/ .__/\___|_|
                             |__/|_|  |_|
\*---------------------------------------------------------------------------*/

/** \file console.h
 * Miscellaneous console utilities.
 */

#ifndef SNAPPER_CONSOLE_H
#define SNAPPER_CONSOLE_H


namespace snapper
{

    /**
     * Reads COLUMNS environment variable or gets the screen width from terminfo
     * or readline, in that order. Falls back to 80 if all that fails.
     *
     * \NOTE In case stdout is not connected to a terminal max. unsigned
     * is returned. This should prevent clipping when output is redirected.
     */
    unsigned get_screen_width();

}


#endif