summaryrefslogtreecommitdiff
path: root/src/remote.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2020-10-19 20:39:25 +1100
committerMaxime Coste <mawww@kakoune.org>2020-10-19 20:39:25 +1100
commit2cd323b314e9f2b2cdf11bbf2974e9390914d5ea (patch)
treecf698d814f131d9e9e5de22186c8671a6a0fe27d /src/remote.hh
parent97e88b60878133bea4b2c3920e5176da97483c12 (diff)
Allow quiting last client with unsaved buffer in daemon mode
Because the server will out-live that client's disconnection it is still ok to have modified buffers, the server will complain on `kill`. Fixes #3801
Diffstat (limited to 'src/remote.hh')
-rw-r--r--src/remote.hh5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/remote.hh b/src/remote.hh
index 89c2f438..661053a8 100644
--- a/src/remote.hh
+++ b/src/remote.hh
@@ -50,7 +50,7 @@ String session_path(StringView session);
struct Server : public Singleton<Server>
{
- Server(String session_name);
+ Server(String session_name, bool daemon);
~Server();
const String& session() const { return m_session; }
@@ -59,11 +59,14 @@ struct Server : public Singleton<Server>
bool negotiating() const { return not m_accepters.empty(); }
+ bool is_daemon() const { return m_is_daemon; }
+
private:
class Accepter;
void remove_accepter(Accepter* accepter);
String m_session;
+ bool m_is_daemon;
std::unique_ptr<FDWatcher> m_listener;
Vector<std::unique_ptr<Accepter>, MemoryDomain::Remote> m_accepters;
};