Open basbebe opened 3 years ago
How?
something like
:attach
#!/bin/sh
# Reattach to the session.
kak -c "$KAKOUNE_SESSION" "$@"
exit_status=$?
if [ $exit_status -ne 0 ] ; then
unset IN_KAKOUNE_CONNECT
unset KAKOUNE_SESSION
unset KAKOUNE_CLIENT
fi
(maybe in an extra function – sorry for not opening a PR)
or even
exit_status=$?
if [ $exit_status -ne 0 ] ; then
exit
fi
probably a :quit
function would be a good approach (with alias q
)?
and in each function:
exit_status=$?
if [ $exit_status -ne 0 ] ; then
:quit
fi
different but related (open new issue or put to trash?):
If a session is killed, kill all related windows:
:nnn
that is still open? kill it (pid needs to be remembered)I remember @occivink telling the underlying terminal used in the terminal
alias doesn’t necessarily expose a PID.
I remember @occivink telling the underlying terminal used in the
terminal
alias doesn’t necessarily expose a PID.
then what I had in mind would of course not be feasible without the overhead of loops and hooks or environment variables storing the PIDs.
but nevertheless I would find a :quit
function useful which would automatically be invoked when the session is lost.
What is the content of the :quit
command?
probably just exit
.
maybe also a :kill
which does :send kill
?
But of course both are not necessary for functionality.
How about @
aliased to :send
, so that you can:
@ kill
@ kill
great!
After unsuccesfully trying to reattach to a session, environment variables should be unset I guess.