aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/screen.cpp
diff options
context:
space:
mode:
authorGravatar Aaron Gyes <me@aaron.gy>2016-06-18 22:21:15 -0700
committerGravatar Aaron Gyes <me@aaron.gy>2016-06-18 22:21:15 -0700
commit4b0f1cf85ba987b09351b4bfe3df3ed9bd59e4de (patch)
tree5d6bd4d28532035c92724964c51be2c2c00af54e /src/screen.cpp
parent7ac32e45cb90118ebbb4d4fe2024fc1751a3b65b (diff)
parent8e21d5de92c4c85f55bbef34b6ffadd40a37e3db (diff)
Diffstat (limited to 'src/screen.cpp')
-rw-r--r--src/screen.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/screen.cpp b/src/screen.cpp
index fc5c927c..a9d9ddcf 100644
--- a/src/screen.cpp
+++ b/src/screen.cpp
@@ -347,12 +347,18 @@ static void s_save_status(screen_t *s) {
static void s_check_status(screen_t *s) {
fflush(stdout);
fflush(stderr);
+ if (!has_working_tty_timestamps) {
+ // We can't reliably determine if the terminal has been written to behind our back so we
+ // just assume that hasn't happened and hope for the best. This is important for multi-line
+ // prompts to work correctly.
+ return;
+ }
fstat(1, &s->post_buff_1);
fstat(2, &s->post_buff_2);
- int changed = (s->prev_buff_1.st_mtime != s->post_buff_1.st_mtime) ||
- (s->prev_buff_2.st_mtime != s->post_buff_2.st_mtime);
+ bool changed = (s->prev_buff_1.st_mtime != s->post_buff_1.st_mtime) ||
+ (s->prev_buff_2.st_mtime != s->post_buff_2.st_mtime);
#if defined HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
changed = changed ||