Fix error when trying to serialize a tab without any windows

This commit is contained in:
Kovid Goyal
2025-10-10 12:39:09 +05:30
parent 29e80f2c1b
commit c40ff94395

View File

@@ -324,9 +324,11 @@ class Tab: # {{{
if session_base_dir and ser_opts.relocatable:
cwd = os.path.relpath(cwd, session_base_dir)
return cwd
most_common_cwd = ''
cwds = {w.id: make_relative(w.cwd_for_serialization) for g in groups for w in g}
from collections import Counter
most_common_cwd, _ = Counter(cwds.values()).most_common(1)[0]
if cwds:
from collections import Counter
most_common_cwd, _ = Counter(cwds.values()).most_common(1)[0]
for i, g in enumerate(groups):
gw: list[str] = []
for window in g: