ssh kitten: Send data without a roundtrip

Send data to the remote side without waiting for a data request. Avoids
an extra roundtrip during initialization.
This commit is contained in:
Kovid Goyal
2022-03-13 13:39:13 +05:30
parent 434ef97952
commit 2b06ca5e1a
4 changed files with 47 additions and 23 deletions

View File

@@ -27,6 +27,7 @@ with SharedMemory(
shm.flush()
with open(os.ctermid(), 'wb') as f:
f.write(f'\x1bP@kitty-ask|{shm.name}\x1b\\'.encode('ascii'))
f.flush()
while True:
# TODO: Replace sleep() with a mutex and condition variable created in the shared memory
time.sleep(0.05)