From 8e21d5de92c4c85f55bbef34b6ffadd40a37e3db Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Fri, 17 Jun 2016 13:08:25 -0700 Subject: 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 --- src/common.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/common.h') 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(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. -- cgit v1.2.3