aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/common.h
diff options
context:
space:
mode:
authorGravatar Kurtis Rader <krader@skepticism.us>2016-06-17 13:08:25 -0700
committerGravatar Kurtis Rader <krader@skepticism.us>2016-06-18 19:33:54 -0700
commit8e21d5de92c4c85f55bbef34b6ffadd40a37e3db (patch)
tree73194959e176a000dd2e73427cab486c2a76cbd0 /src/common.h
parentf04644f749f54a9773884a61e76540c53bf0d42b (diff)
deal with broken ttys on MS Windows
The tty device timestamps on MS Windows aren't usable because they're always the current time. So fish can't use them to decide if the entire prompt needs to be repainted. Fixes #2859
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
index b8791279..0c1b77d4 100644
--- a/src/common.h
+++ b/src/common.h
@@ -21,6 +21,13 @@
#include "fallback.h" // IWYU pragma: keep
#include "signal.h" // IWYU pragma: keep
+// Define a symbol we can use elsewhere in our code to determine if we're being built on MS Windows
+// under Cygwin.
+#if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(__CYGWIN__) || \
+ defined(__WIN32__)
+#define OS_IS_CYGWIN
+#endif
+
/// Avoid writing the type name twice in a common "static_cast-initialization". Caveat: This doesn't
/// work with type names containing commas!
#define CAST_INIT(type, dst, src) type dst = static_cast<type>(src)
@@ -188,6 +195,10 @@ extern const wchar_t *program_name;
void read_ignore(int fd, void *buff, size_t count);
void write_ignore(int fd, const void *buff, size_t count);
+/// Set to false at run-time if it's been determined we can't trust the last modified timestamp on
+/// the tty.
+extern bool has_working_tty_timestamps;
+
/// This macro is used to check that an input argument is not null. It is a bit lika a non-fatal
/// form of assert. Instead of exit-ing on failure, the current function is ended at once. The
/// second parameter is the return value of the current function on failure.