summaryrefslogtreecommitdiff
path: root/src/json_ui.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2018-04-29 22:27:28 +1000
committerMaxime Coste <mawww@kakoune.org>2018-04-29 22:31:57 +1000
commit178d2d3cd354bc93d82e5cd6269976b2077a66c3 (patch)
treea5e7095f74b6d09c6cd32f5d780d3928acce899e /src/json_ui.hh
parent57112b0845a0ee9957d156fd3812a716c4d97a2c (diff)
Rework the way UI can trigger a client quitting
Add a UserInterface::is_ok method and return false on SIGHUP/stdin closing/socket dropping This should be cleaner and more robust than the previous SIGHUP handling code. Fixes #1594
Diffstat (limited to 'src/json_ui.hh')
-rw-r--r--src/json_ui.hh2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/json_ui.hh b/src/json_ui.hh
index ad887561..5e53ab42 100644
--- a/src/json_ui.hh
+++ b/src/json_ui.hh
@@ -19,6 +19,8 @@ public:
JsonUI(const JsonUI&) = delete;
JsonUI& operator=(const JsonUI&) = delete;
+ bool is_ok() const override { return m_stdin_watcher.fd() != -1; }
+
void draw(const DisplayBuffer& display_buffer,
const Face& default_face,
const Face& buffer_padding) override;