Closed sucrecacao closed 3 years ago
I think it is a race condition introduced by https://github.com/mawww/kakoune/issues/3618.
connect-shell
connects a shell, not a terminal.
Any idea how to fix ?
connect-terminal
Also, there is no prelude
option in the source code, it is prelude_path
.
I have no idea what you are talking about.
Why would I have prelude
instead of prelude_path
in my source code ? it is up to date and I didn't edited the source code.
OK I fixed connect-terminal
by deleting everything and reinstalling,
bug kak-shell
is still buggy: it give me:1:93 'connect-set-detach' wrong argument count
Just added a wait_for_session
function in kak-shell
:
wait_for_session() {
session=$1
# Wait for session
# Grep in quiet mode with fixed strings and whole line switches
while ! kak -l | grep -q -F -x "$session"; do
continue
done
}
@lenormf mentioned flock -E
but I do not know it.
https://github.com/mawww/kakoune/issues/3618
Let me know if you know a better implementation.
Just added a
wait_for_session
function inkak-shell
:wait_for_session() { session=$1 # Wait for session # Grep in quiet mode with fixed strings and whole line switches while ! kak -l | grep -q -F -x "$session"; do continue done }
@lenormf mentioned
flock -E
but I do not know it.Let me know if you know a better implementation.
I'm really late to the party. But to keep this from eating up your CPU needlessly, you should have a sleep
call instead of continue
. If you do a small interval like 0.25s or 0.5s it won't make your CPU go into overload and it'll still be low-latency.
Edit: actually, executing kak
takes a good amount of time in and of itself, so my suggestion would only be a small improvement.
Thanks for the feedback. I tested with a slight amount of time and it looks reasonable. You can test the difference:
Before
while true; do continue; done
After
while true; do sleep 0.1; done
I have install the connect.kak as explain in the readme.
When launching
kak-shell
in a terminal, it start a kakoune instance with the following message in the debug:Also it echo something in the prompt :
1:93 'connect-set-detach' wrong argument count
When trying to pop a terminal from kakoune I get the following;
I do have prelude installed and
require-module connect
in my kakrc