MarDiehl / stdlib_os

MIT License
12 stars 2 forks source link

isatty - determine if a file unit is a terminal (teletypewriter) #12

Open ivan-pi opened 3 years ago

ivan-pi commented 3 years ago

Suggested by @14NGiestas in https://github.com/fortran-lang/stdlib/issues/193#issuecomment-688464019

Many compilers already have their own extensions for this:

Corresponding routines to query the terminal name:

The Intel run-time library actually provides these routines in two places, the IFPOSIX Posix-compliant library and the portabiliy library module IFPORT (under the names isatty and ttynam).

Linux man pages:

Windows:

Other possible enhancements could include functions to query the size of the terminal (an example can be found in @zbeekman's zstdlib project).