Improve printed output

Get rid of inconsistencies in the printed output (error printing,
colors, etc.).

Prepare for user configurable color.

Cleanup.
This commit is contained in:
Martin Lund 2022-02-12 22:47:38 +01:00
parent 5efd519d2e
commit b6eac3f001
8 changed files with 122 additions and 66 deletions

View file

@ -33,7 +33,7 @@ int main(int argc, char *argv[])
{
int status = 0;
/* Install error exit handler */
/* Add error exit handler */
atexit(&error_exit);
/* Parse options */
@ -55,13 +55,20 @@ int main(int argc, char *argv[])
/* Configure output terminal */
stdout_configure();
/* Install log exit handler */
/* Add log exit handler */
atexit(&log_exit);
/* Create log file */
if (option.log)
log_open(option.log_filename);
/* Enable color printing */
print_set_color_mode(true);
/* Print launch hints */
tio_printf("tio v%s", VERSION);
tio_printf("Press ctrl-t q to quit");
/* Connect to tty device */
if (option.no_autoconnect)
status = tty_connect();