| Age | Commit message (Collapse) | Author |
|
<memory> is a costly header we can avoid by just implementing
UniquePtr ourselves, which is a pretty straightforward in modern
C++, this saves around 10% of the compilation time here.
|
|
Commit 9cf8a3ccd (Check for buffer overflow when constructing the socket path., 2022-04-07)
made
$ kak -s $(printf %0100d)
fail but forgot to do the same for
$ kak -e "rename-session $(printf %0100d)"
which silently succeeds, only to fail at the next
$ echo nop | kak -p $(printf %0100d)
Fatal error: socket path too long: '/run/user/1000/kakoune/0000...'
Let's fail earlier.
While at it, don't validate "m_session" redundantly.
I'm not sure if we should validate the socket names in "kak -clear";
I guess it doesn't matter.
|
|
Make it possible to move the current session to a daemon one after
the fact, which is useful to ensure the session state survives client
disconnecting, for example when working from ssh.
|
|
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.
|
|
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
|
|
Pass the client stdin fd to the server and open a fifo buffer
from it.
Fixes #3394
|
|
|
|
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.
|
|
Introduce a get_user_name function which parses '/etc/passwd' to find
the username associated with a user id.
|
|
Also, do not quit server while there is a connection being accepted
Fixes #1690
|
|
|
|
As requested in #1414
|
|
The current client exit status can be specified as an optional
parameter, is nothing is given the exit status will be 0.
Fixes #1230
|
|
Fix a crash on daemon quit as well.
|
|
Fixes #1042
|
|
Buffer data (in an horribly innefficient way for now), and use the
event manager to watch for the socket being ready for a write.
Fixes #945
|
|
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.
|
|
|
|
|
|
dead ones
Fixes #689
|
|
That way, other clients can still be serviced by the server.
|
|
Fixes #383
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BufferCoord -> ByteCoord
DisplayCoord -> CharCoord
Moved their definition along with LineAndColumn into coord.hh
|
|
|
|
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.
|
|
|
|
This allows using directly the kak binary in place of socat for piping commands
to a foreing session.
|
|
|
|
|
|
use /tmp/kak-$kak_session to get the socket path
|
|
|
|
|
|
ClientAccepter is now Server's implementation detail and all socket logic
are isolated in remote.cc
|