diff options
| author | Maxime Coste <mawww@kakoune.org> | 2018-03-23 07:36:18 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2018-03-23 07:36:18 +1100 |
| commit | db7b43acd5f30186b9a46a0032bca03c40366d7d (patch) | |
| tree | 2104d26892a9c915f5f5d07129b6f164ea98c6bd /src/remote.cc | |
| parent | 796fbc6c1fbc1d94d02c314429cad7f954526713 (diff) | |
Restore client name after converting to client
When Kakoune forked the sever to background, the newly converted
to client process (the original client/server process) was not
preserving its previous client name.
Diffstat (limited to 'src/remote.cc')
| -rw-r--r-- | src/remote.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/remote.cc b/src/remote.cc index 12313d83..521663f6 100644 --- a/src/remote.cc +++ b/src/remote.cc @@ -566,7 +566,7 @@ bool check_session(StringView session) return connect(sock, (sockaddr*)&addr, sizeof(addr.sun_path)) != -1; } -RemoteClient::RemoteClient(StringView session, std::unique_ptr<UserInterface>&& ui, +RemoteClient::RemoteClient(StringView session, StringView name, std::unique_ptr<UserInterface>&& ui, int pid, const EnvVarMap& env_vars, StringView init_command, Optional<BufferCoord> init_coord) : m_ui(std::move(ui)) @@ -576,6 +576,7 @@ RemoteClient::RemoteClient(StringView session, std::unique_ptr<UserInterface>&& { MsgWriter msg{m_send_buffer, MessageType::Connect}; msg.write(pid); + msg.write(name); msg.write(init_command); msg.write(init_coord); msg.write(m_ui->dimensions()); @@ -723,13 +724,14 @@ private: case MessageType::Connect: { auto pid = m_reader.read<int>(); + auto name = m_reader.read<String>(); auto init_cmds = m_reader.read<String>(); auto init_coord = m_reader.read_optional<BufferCoord>(); auto dimensions = m_reader.read<DisplayCoord>(); auto env_vars = m_reader.read_hash_map<String, String, MemoryDomain::EnvVars>(); auto* ui = new RemoteUI{sock, dimensions}; if (auto* client = ClientManager::instance().create_client( - std::unique_ptr<UserInterface>(ui), pid, + std::unique_ptr<UserInterface>(ui), pid, std::move(name), std::move(env_vars), init_cmds, init_coord, [ui](int status) { ui->exit(status); })) ui->set_client(client); |
