Auto-create an OS Window if none exists on new_tab

This commit is contained in:
Kovid Goyal 2022-12-16 19:34:37 +05:30
parent bb33f6c0ac
commit 6efb5dc2c2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -2072,6 +2072,9 @@ class Boss:
if not self.os_window_map: if not self.os_window_map:
self.add_os_window() self.add_os_window()
tm = self.active_tab_manager tm = self.active_tab_manager
if tm is None and not self.os_window_map:
os_window_id = self.add_os_window()
tm = self.os_window_map.get(os_window_id)
if tm is not None: if tm is not None:
return tm.new_tab(special_window=special_window, cwd_from=cwd_from, as_neighbor=as_neighbor) return tm.new_tab(special_window=special_window, cwd_from=cwd_from, as_neighbor=as_neighbor)
return None return None