When using the --listen-on option have kitty @ automatically connect to the socket even when --to is not specified

The listen on value is set in the env of the child processes, so kitty @
can read it when run from inside kitty.
This commit is contained in:
Kovid Goyal
2018-08-04 22:06:47 +05:30
parent d964146f8c
commit 634d262b64
3 changed files with 15 additions and 7 deletions

View File

@@ -3,6 +3,7 @@
# License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
import json
import os
import re
import sys
import types
@@ -164,6 +165,8 @@ def main(args):
else:
no_response = func.no_response
send['no_response'] = no_response
if not global_opts.to and 'KITTY_LISTEN_ON' in os.environ:
global_opts.to = os.environ['KITTY_LISTEN_ON']
response = do_io(global_opts.to, send, no_response)
if no_response:
return