summaryrefslogtreecommitdiffstats
path: root/src/color.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/color.h')
-rw-r--r--src/color.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/color.h b/src/color.h
index 3278cd6..3550888 100644
--- a/src/color.h
+++ b/src/color.h
@@ -42,6 +42,8 @@ typedef struct CFILE {
const struct colors *colors;
/** A buffer for colored formatting. */
dchar *buffer;
+ /** Cached file descriptor number. */
+ int fd;
/** Whether the next ${rs} is actually necessary. */
bool need_reset;
/** Whether to close the underlying stream. */
@@ -108,4 +110,9 @@ int cfprintf(CFILE *cfile, const char *format, ...);
attr(printf(2, 0))
int cvfprintf(CFILE *cfile, const char *format, va_list args);
+/**
+ * Reset the TTY state when terminating abnormally (async-signal-safe).
+ */
+int cfreset(CFILE *cfile);
+
#endif // BFS_COLOR_H