Re-introduce kill_session::exit_status, @lenormf was right
As discussed in #2186, in the end we need the exit status for the case where the local client exited first (the server forked to background) then another client trigger the kill command.
This commit is contained in:
parent
56a5dc66ff
commit
7195100609
|
@ -446,7 +446,7 @@ void kill(const ParametersParser& parser, Context& context, const ShellContext&)
|
|||
while (not client_manager.empty())
|
||||
client_manager.remove_client(**client_manager.begin(), true, status);
|
||||
|
||||
throw kill_session{};
|
||||
throw kill_session{status};
|
||||
}
|
||||
|
||||
const CommandDesc kill_cmd = {
|
||||
|
|
|
@ -6,7 +6,10 @@ namespace Kakoune
|
|||
|
||||
void register_commands();
|
||||
|
||||
struct kill_session {};
|
||||
struct kill_session
|
||||
{
|
||||
int exit_status;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -760,7 +760,10 @@ int run_server(StringView session, StringView server_init,
|
|||
}
|
||||
}
|
||||
}
|
||||
catch (const kill_session&) {}
|
||||
catch (const kill_session& kill)
|
||||
{
|
||||
local_client_exit = kill.exit_status;
|
||||
}
|
||||
|
||||
{
|
||||
Context empty_context{Context::EmptyContextFlag{}};
|
||||
|
|
Loading…
Reference in New Issue
Block a user