Fix using kitty --single-instance to open a new window in a running kitty instance, not respecting the --directory flag. Fixes #429

This commit is contained in:
Kovid Goyal
2018-04-01 12:39:33 +05:30
parent 43ce3ce4b0
commit ce0db16479
3 changed files with 10 additions and 3 deletions

View File

@@ -105,7 +105,7 @@ def parse_session(raw, opts):
return ans
def create_session(opts, args=None, special_window=None, cwd_from=None):
def create_session(opts, args=None, special_window=None, cwd_from=None, respect_cwd=False):
if args and args.session:
with open(args.session) as f:
return parse_session(f.read(), opts)
@@ -122,6 +122,8 @@ def create_session(opts, args=None, special_window=None, cwd_from=None):
cmd = args.args if args and args.args else resolved_shell(opts)
from kitty.tabs import SpecialWindow
k = {'cwd_from': cwd_from}
if respect_cwd:
k['cwd'] = args.directory
if getattr(args, 'title', None):
k['override_title'] = args.title
special_window = SpecialWindow(cmd, **k)