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

@@ -203,10 +203,12 @@ def macos_cmdline():
return ans
def setup_environment(opts):
def setup_environment(opts, args):
extra_env = opts.env.copy()
if opts.editor != '.':
os.environ['EDITOR'] = opts.editor
if args.listen_on:
os.environ['KITTY_LISTEN_ON'] = args.listen_on
set_default_env(extra_env)
@@ -264,7 +266,7 @@ def _main():
return
init_glfw(args.debug_keyboard) # needed for parsing native keysyms
opts = create_opts(args)
setup_environment(opts)
setup_environment(opts, args)
try:
with setup_profiling(args):
# Avoid needing to launch threads to reap zombies