Commit graph

118 commits

Author SHA1 Message Date
Kovid Goyal
e1d8565fb6
Add os_window_title to sessions 2025-09-01 19:30:50 +05:30
Kovid Goyal
cbca4d6593
Implement tab_bar_filter
Useful to manage multiple sessions in a single kitty OS Window.
Add some docs to sessions.rst describing this use case.
2025-08-24 12:25:15 +05:30
Kovid Goyal
d3c46a829d
Add action to close a session 2025-08-23 09:17:27 +05:30
Kovid Goyal
f824cc2453
... 2025-08-22 20:02:32 +05:30
Kovid Goyal
3c5678908a
DRYer 2025-08-22 20:00:48 +05:30
Kovid Goyal
272d98480f
Record startup session in session history as well 2025-08-22 19:52:26 +05:30
Kovid Goyal
b401827881
Fix stupid typo that broke goto_session -1 2025-08-22 19:46:22 +05:30
Kovid Goyal
14cbf5cb73
Ensure newly created session is focused 2025-08-22 19:44:17 +05:30
Kovid Goyal
535a1bf580
Fix session name not being set when creating tabs in existing OS window 2025-08-22 19:39:33 +05:30
Kovid Goyal
3e92d62923
DRYer 2025-08-22 19:29:53 +05:30
Kovid Goyal
3087cbdcec
Ring bell when goto_session -1 has no history 2025-08-22 19:27:13 +05:30
Kovid Goyal
8dac15b8b2
goto_session -1 should not fail when no session history is present 2025-08-22 19:18:11 +05:30
Kovid Goyal
a9d282afd7
DRYer 2025-08-19 22:01:27 +05:30
Kovid Goyal
b28f620c9f
Allow using save_as_session . to save to the path of the currently active session 2025-08-19 21:58:25 +05:30
Kovid Goyal
e43d894dda
Add a --match argument to limit what windows are saved by save_as_session 2025-08-19 21:53:49 +05:30
Kovid Goyal
e7b3fb0197
When serializing foreground process allow serializing shell builtins as well 2025-08-19 16:19:26 +05:30
Kovid Goyal
648886cbd1
Fix windows not being assigned session names 2025-08-19 16:00:38 +05:30
Kovid Goyal
51cc6ec525
Auto create parent directory when saving session file 2025-08-19 07:43:05 +05:30
Kovid Goyal
a2d76a6c34
Document the save_as_session action 2025-08-17 14:44:26 +05:30
Kovid Goyal
d233cd0a53
Make switching OS window focus more robust under Wayland at various call sites 2025-08-17 13:33:16 +05:30
Kovid Goyal
c2389a1adc
Option to make saved session files relocatable 2025-08-17 11:56:32 +05:30
Kovid Goyal
67b2e859f5
Allow using relative paths in cd in sessions files that get resolved relative to the directory containing the session file 2025-08-17 11:23:36 +05:30
Kovid Goyal
f91a0f6986
When saving session add option to save the foreground process running in the shell so that it is also restarted
Useful if user builds up session to save by running programs via
the shell.

Note that the serialization format for session files has changed
slightly, becoming more robust and allowing us to add more types
of saved data in the future, without overloading user_vars and thus
risking name conflicts.
2025-08-16 16:50:45 +05:30
Kovid Goyal
0fb1835af1
Cache parsed save as session options spec 2025-08-16 09:57:00 +05:30
Kovid Goyal
ca715c4cae
Pass session serialization options into all contexts where they might be needed 2025-08-16 09:15:47 +05:30
Kovid Goyal
24e0bbd50e
Add save_as_session action
Docs need to be updated.
2025-08-16 06:32:42 +05:30
Kovid Goyal
8702057dda
Implement interactive session picking 2025-08-15 16:09:45 +05:30
Kovid Goyal
c8c0201cbb
Handle relative paths in goto_session 2025-08-14 20:57:02 +05:30
Kovid Goyal
7cf53a6a68
Implement goto previous session 2025-08-14 20:28:55 +05:30
Kovid Goyal
0789e62b11
Fix adding of tabs to existing OS Window in create_session 2025-08-14 20:11:43 +05:30
Kovid Goyal
035ce949b4
Start work on goto_session action 2025-08-14 19:43:14 +05:30
Kovid Goyal
97f1d7f436
Implement session command to set layout state 2025-08-06 20:43:12 +05:30
Kovid Goyal
cd872d505f
Better fix for missing cls and name options on macOS 2025-04-29 09:06:52 +05:30
Kovid Goyal
840148c2b8
... 2025-04-29 09:02:54 +05:30
Kovid Goyal
d548a6fcf4
rename typing module to avoid conflicts with stdlib typing 2025-04-28 09:20:10 +05:30
Kovid Goyal
c194dbc9ef
Reset OS window class and name for new single instance OS windows 2025-04-23 22:18:42 +05:30
Kovid Goyal
87b218a40d
Preserve env vars from onvoking env when creating new os window via single instance 2025-04-23 22:14:06 +05:30
George Joseph
d2288ee787 Add support for os_window_name in startup sessions.
You can now specify `os_window_name` in addition to `os_window_class` in
startup sessions.  It works for the initial session as well as new sessions
started with `new_os_window`.

Updated documentation in overview.rst to add `os_window_name` in the
Startup Session examples.

Although not related to this feature. The documentation in launch.py
was updated to note that the `launch --type` `tab` and `os-window` options
aren't supported when launch is invoked from a startup script.  There's
already a note to that effect in the "Startup Sessions" section in
overview.rst but if you're looking at the launch syntax page like I was,
you wouldn't realize the limitation. This was throwing me for a loop while
wotking on this PR.

Resolves: #8387
2025-03-02 14:10:17 -07:00
Kovid Goyal
da1626090a
Update codebase to Python 3.10 using pyupgrade 2025-02-03 10:56:50 +05:30
Kovid Goyal
b479089619
Fix a regression in the previous release that broke use of the cd command in session files
Fixes #7829
2024-09-06 14:50:15 +05:30
Kovid Goyal
f1d0d0949b
Run pyupgrade to update the codebase to python 3.9
Gets rid of a lot of typing ugliness by using type annotations on
builtin types
2024-07-31 07:55:27 +05:30
Kovid Goyal
681a2b7b28
Sessions: A new command focus_matching_window to shift focus to a specific window, useful when creating complex layouts with splits 2024-07-19 14:54:44 +05:30
Kovid Goyal
9be6b9c374
When using --single-instance allow creating sessions with only background processes 2024-06-17 08:01:43 +05:30
Kovid Goyal
88b7595929
Ignore startup_session when kitty is invoked with command line options specifying a command to run 2024-03-10 09:41:08 +05:30
Kovid Goyal
e656a75d5e
Move implementation of --hold into Child
DRYer. Also fixed use of --hold with launch --cwd=current
2024-01-06 13:14:48 +05:30
Kovid Goyal
3c4f2aa1b8
shlex.split -> shlex_split 2023-12-02 15:17:08 +05:30
Kovid Goyal
77292a16d6
Make shebangs consistent
Follow PEP 0394 and use /usr/bin/env python so that the python in the
users venv is respected. Not that the kitty python files are meant to be
executed standalone anyway, but, whatever.

Fixes #6810
2023-11-11 08:32:05 +05:30
Kovid Goyal
f098240ace
... 2023-10-20 08:43:45 +05:30
Kovid Goyal
4b997a961c
A new option single_window_padding_width to use a different padding when only a single window is visible
Fixes #6734
2023-10-20 08:37:45 +05:30
Kovid Goyal
0fb1f17af9
Have --hold wait at a shell prompt 2023-06-26 11:21:57 +05:30