Start work on a detach_window command
This commit is contained in:
parent
dda886b97c
commit
20751c2807
@ -1104,7 +1104,10 @@ class Boss:
|
||||
set_colors(self, self.active_window, payload)
|
||||
|
||||
def _move_window_to(self, window=None, target_tab_id=None, target_os_window_id=None):
|
||||
src_tab = self.tab_for_window(window or self.active_window)
|
||||
window = window or self.active_window
|
||||
if not window:
|
||||
return
|
||||
src_tab = self.tab_for_window(window)
|
||||
if src_tab is None:
|
||||
return
|
||||
if target_os_window_id == 'new':
|
||||
@ -1126,6 +1129,12 @@ class Boss:
|
||||
return
|
||||
|
||||
underlaid_window, overlaid_window = src_tab.detach_window(window)
|
||||
target_tab.attach_window(underlaid_window)
|
||||
if underlaid_window:
|
||||
target_tab.attach_window(underlaid_window)
|
||||
if overlaid_window:
|
||||
target_tab.attach_window(overlaid_window)
|
||||
|
||||
def detach_window(self, *args):
|
||||
if not args:
|
||||
return self._move_window_to(target_tab_id='new')
|
||||
# TODO: Implementthis
|
||||
|
||||
@ -92,6 +92,11 @@ def goto_tab_parse(func, rest):
|
||||
return func, args
|
||||
|
||||
|
||||
@func_with_args('detach_window')
|
||||
def detach_window_parse(func, rest):
|
||||
return func, to_cmdline(rest)
|
||||
|
||||
|
||||
@func_with_args('set_background_opacity', 'goto_layout', 'kitty_shell')
|
||||
def simple_parse(func, rest):
|
||||
return func, [rest]
|
||||
|
||||
@ -58,7 +58,7 @@ class Tab: # {{{
|
||||
setattr(self, which + '_window', partial(self.nth_window, num=i))
|
||||
self._last_used_layout = self._current_layout_name = None
|
||||
if no_initial_window:
|
||||
pass
|
||||
self._set_current_layout(self.enabled_layouts[0])
|
||||
elif session_tab is None:
|
||||
self.cwd = self.args.directory
|
||||
sl = self.enabled_layouts[0]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user