kitty/kitty_tests
Chance Zibolski 1b81045008 Save the layout state of every layout a tab has used to sessions
save_as_session recorded only the state of the tab's active layout, so the state
of any layout the tab had been toggled away from was lost. Toggling a splits tab
to the stack layout and saving discarded the splits tree entirely, because Stack
has no layout_state() of its own, and switching back to splits after restoring
rebuilt the tree from scratch along the default axis.

The session file also carried no last_used_layout, so _last_used_layout was None
after a restore and toggle_layout <current layout> silently did nothing, since it
delegates to last_used_layout() which returns early when unset. The key that
produced the stack layout no longer undid it.

Tab now keeps the layouts it has used, by name, and writes their state plus
last_used_layout into the existing set_layout_state JSON rather than adding new
session commands. Older versions of kitty ignore unknown keys in that dict but
abort on unknown commands, so nesting keeps session files readable by them.

Restoring the state of a layout that is not being made current must not reorder
the window list, since only the current layout determines window order, hence
apply_to_window_list. Splits.set_layout_state also has to accept state for a
layout whose tree is still empty, which is the case for a layout that has not
laid out any windows yet.

Fixes #10320
2026-08-05 07:53:47 -07:00
..
__init__.py Delay load slangc 2026-08-05 05:32:54 +05:30
atexit.py autoformat 2026-08-05 05:32:56 +05:30
base.py ... 2026-08-05 05:32:55 +05:30
CascadiaCode-Regular.otf
check_build.py autoformat 2026-08-05 05:32:56 +05:30
child.py ... 2026-08-05 05:32:57 +05:30
clipboard.py autoformat 2026-08-05 05:32:56 +05:30
ComfyCode-Regular.ttf
command_palette.py autoformat 2026-08-05 05:32:56 +05:30
completion.py autoformat 2026-08-05 05:32:56 +05:30
crypto.py autoformat 2026-08-05 05:32:56 +05:30
datatypes.py Remove NUL from paths received via OSC7 2026-08-05 13:36:18 +05:30
dnd.py autoformat 2026-08-05 05:32:56 +05:30
dnd_kitten.py autoformat 2026-08-05 05:32:56 +05:30
file_transmission.py autoformat 2026-08-05 05:32:56 +05:30
FiraCode-Medium.otf
fonts.py autoformat 2026-08-05 05:32:56 +05:30
glfw.py autoformat 2026-08-05 05:32:56 +05:30
gr.py autoformat 2026-08-05 05:32:56 +05:30
GraphemeBreakTest.json
graphics.py autoformat 2026-08-05 05:32:56 +05:30
iosevka-regular.ttf
keys.py autoformat 2026-08-05 05:32:56 +05:30
layout.py Save the layout state of every layout a tab has used to sessions 2026-08-05 07:53:47 -07:00
LiberationMono-Regular.ttf
main.py ... 2026-08-05 05:32:57 +05:30
mouse.py autoformat 2026-08-05 07:16:05 +05:30
multicell.py autoformat 2026-08-05 05:32:56 +05:30
notifications.py autoformat 2026-08-05 05:32:56 +05:30
open_actions.py autoformat 2026-08-05 05:32:56 +05:30
options.py autoformat 2026-08-05 05:32:56 +05:30
panels.py autoformat 2026-08-05 05:32:56 +05:30
parser.py autoformat 2026-08-05 05:32:56 +05:30
screen.py autoformat 2026-08-05 05:32:56 +05:30
search_query_parser.py autoformat 2026-08-05 05:32:56 +05:30
shell_integration.py autoformat 2026-08-05 05:32:56 +05:30
shm.py autoformat 2026-08-05 05:32:56 +05:30
slang.py fix specialisation not working 2026-08-05 08:17:05 +05:30
ssh.py speedup slow ssh shell integration test by removing redundant entries from test matrix 2026-08-05 05:32:57 +05:30
tab_bar.py autoformat 2026-08-05 07:16:05 +05:30
tui.py autoformat 2026-08-05 05:32:56 +05:30
twemoji_smiley-cff2_colr_1.otf
utmp.py autoformat 2026-08-05 05:32:56 +05:30