Fix Kakoune client busy looping on SIGHUP
Pure clients never quitted when they got SIGHUP after recent changes to add is_ok to UserInterface. run_client now tracks the UI state as well and quits if the UI gets killed.
This commit is contained in:
parent
878d2a4bdb
commit
4ef5c80724
|
@ -526,7 +526,7 @@ int run_client(StringView session, StringView name, StringView client_init,
|
|||
client_init, std::move(init_coord)};
|
||||
if (suspend)
|
||||
raise(SIGTSTP);
|
||||
while (not client.exit_status())
|
||||
while (not client.exit_status() and client.is_ui_ok())
|
||||
event_manager.handle_next_events(EventMode::Normal);
|
||||
return *client.exit_status();
|
||||
}
|
||||
|
|
|
@ -668,6 +668,11 @@ RemoteClient::RemoteClient(StringView session, StringView name, std::unique_ptr<
|
|||
}});
|
||||
}
|
||||
|
||||
bool RemoteClient::is_ui_ok() const
|
||||
{
|
||||
return m_ui->is_ok();
|
||||
}
|
||||
|
||||
void send_command(StringView session, StringView command)
|
||||
{
|
||||
int sock = connect_to(session);
|
||||
|
|
|
@ -34,6 +34,7 @@ public:
|
|||
int pid, const EnvVarMap& env_vars, StringView init_command,
|
||||
Optional<BufferCoord> init_coord);
|
||||
|
||||
bool is_ui_ok() const;
|
||||
const Optional<int>& exit_status() const { return m_exit_status; }
|
||||
private:
|
||||
std::unique_ptr<UserInterface> m_ui;
|
||||
|
|
Loading…
Reference in New Issue
Block a user