mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-18 14:34:52 +02:00
Add new actions to open tabs/windows with the working directory set to the working directory of the current window
Fixes #237
This commit is contained in:
@@ -85,7 +85,7 @@ def parse_session(raw, opts):
|
||||
return ans
|
||||
|
||||
|
||||
def create_session(opts, args=None, special_window=None):
|
||||
def create_session(opts, args=None, special_window=None, cwd_from=None):
|
||||
if args and args.session:
|
||||
with open(args.session) as f:
|
||||
return parse_session(f.read(), opts)
|
||||
@@ -100,11 +100,11 @@ def create_session(opts, args=None, special_window=None):
|
||||
ans.tabs[-1].layout = current_layout
|
||||
if special_window is None:
|
||||
cmd = args.args if args and args.args else [shell_path]
|
||||
from kitty.tabs import SpecialWindow
|
||||
if getattr(args, 'title', None):
|
||||
from kitty.tabs import SpecialWindow
|
||||
ans.add_window(SpecialWindow(cmd, override_title=args.title))
|
||||
ans.add_window(SpecialWindow(cmd, override_title=args.title, cwd_from=cwd_from))
|
||||
else:
|
||||
ans.add_window(cmd)
|
||||
ans.add_window(SpecialWindow(cmd, cwd_from=cwd_from))
|
||||
else:
|
||||
ans.add_special_window(special_window)
|
||||
return ans
|
||||
|
||||
Reference in New Issue
Block a user