Do not use a shared kakoune/ directory for all users to avoid the
complexity of having to set the sticky bit on that dir, resolve the
session directoy only once by using a static variable and an
immediately evaluated lambda.
This fixes an annoyance whenver using `su` and having Kakoune refuse
to start due to XDG_RUNTIME_DIR still being set.
Falls back on old mechanism if `XDG_RUNTIME_DIR` is not set.
The ability to specify a session as "<user>/<name>" was removed, since
it isn't possible to compute the value of `XDG_RUNTIME_DIR` for another
user, we wouldn't have access to it if we could, and it would be awkward
to support this feature only when `XDG_RUNTIME_DIR` is unset. Also,
`rename-session` did not work when another user's session was specified.
Closes#3019
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.
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.
This round trip through an input callback expected to call
is_key_available and get_key was overcomplicated, just send the
keys as they arrive, the client is already buffering due to urgent
event mode.
We were just treating the next key. Which led to <esc> byte
remaining after suspend, that led that <esc> being interpretted
as <alt> when the following key got available.
Fixes#739
Client quitting no longer immediately unwinds, client is just pushed
for deletion until we get back to the main loop, similarly to what
happens for buffer and window deletion.
Messages now have their size in a header, along with their type
and are only executed once fully received. We dont block anymore
while trying to read a full message.
At connection, a remote client sends all its environement to the
server, which then provides access to client env through
kak_client_env_VAR_NAME variables in the shell.
When exiting kakoune, ClientAccepters (now Server::Accepter) could
stay alive, which left an FDWatcher in the EventManager triggering
an assert. Now Server is handling their lifetime.