Commit Graph

149 Commits

Author SHA1 Message Date
ash
043f83b189 Avoid producing a nonexistent cwd/exe from e.g. defunct processes 2026-01-30 21:15:29 +00:00
Kovid Goyal
c2fb9f14b5 Only reset termios when user triggers reset action rather than in reponse to reset escape code
Fixes #9126
2025-10-18 08:53:50 +05:30
Kovid Goyal
dd7caaa91b ... 2025-10-15 08:09:29 +05:30
Kovid Goyal
ee9a5386b9 When doing a reset also reset termios to its initial state 2025-10-15 07:56:45 +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
8451ad44b5 Implement running foreground process even on unknown shells
This is not as nice because the environment wont have been setup by
the shell before running the process, but it's the best we can do
for an unknown shell.
2025-08-19 10:37:05 +05:30
Kovid Goyal
d04bb12a09 Use absolute path when serializing foreground process 2025-08-16 17:33:00 +05:30
Kovid Goyal
337cbf1435 Add an env var that can be used to eval an expression at startup of shell
This will come in handy to implement serialization as session
with running of current foreground command.
2025-08-16 11:58:30 +05:30
Barr
ca2232e435 feat: new option --hold-after-ssh to allow spawning a shell after a kitten ssh disconnection
new option to the launch command, the new shell will be in the directory
that launched kitten ssh
2025-07-12 10:07:29 +03:00
Kovid Goyal
7a31dad770 Make mypy happy 2025-04-24 05:08:07 +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
Kovid Goyal
adaa00744c DRYer 2025-03-09 20:12:21 +05:30
Kovid Goyal
dc888a87d6 ... 2025-03-09 20:11:09 +05:30
Kovid Goyal
de1ab142aa Dont propagate VTE_VERSION
VTE stupidly installs the shell integration script system wide keyed on
the presence of VTE_VERSION env var. Which will be set if kitty is
launched from a VTE based terminal. Sigh.
2025-02-26 15:45:09 +05:30
Kovid Goyal
ba31763acf Consider windows with background processes as active for confirm_close
Fixes #8358
2025-02-21 14:26:12 +05:30
Kovid Goyal
ce76c6bc90 Make mypy 1.15 happy 2025-02-05 09:36:21 +05:30
Kovid Goyal
da1626090a Update codebase to Python 3.10 using pyupgrade 2025-02-03 10:56:50 +05:30
Kovid Goyal
b959ac5ab8 And again with mypy 2024-12-21 08:14:56 +05:30
Kovid Goyal
c08fb91b29 Add comments document realpath behavior for cwd_of_process 2024-10-07 21:13:54 +05:30
Kovid Goyal
af83d855de Add a framework for easily and securely using remote control from the main function of a custom kitten 2024-09-29 20:36:12 +05:30
Kovid Goyal
70e068e414 Fix forward_stdio not working on macOS 2024-09-29 12:17:30 +05:30
Kovid Goyal
deeee6b9a6 ... 2024-09-29 10:43:12 +05:30
Kovid Goyal
2d88d46700 Preserve fd numbers in pass_fds
Also cleanup serialization of argv/env string arrays for exec
2024-09-29 10:42:20 +05:30
Kovid Goyal
ced282c06c Infrastructure to pass arbitrary fds to spawned child 2024-09-28 12:37:54 +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
adc457ff0f Dynload libsystemd 2024-05-16 21:13:09 +05:30
Kovid Goyal
39ea084be9 Linux: Run all child processes in their own systemd scope to prevent the OOM killer from harvesting kitty when a child process misbehaves
Fixes #7427
2024-05-16 15:43:25 +05:30
Kovid Goyal
198b69e275 An option to set TERMINFO to the database directly instead of a path 2024-03-21 10:48:53 +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
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
9c25a183db On second thoughts dont use foreground process env vars for kitten @ ls
Since the purpose of the env vars is mostly to recognize windows the
original env vars make more sense. Also I dislike changing behavior for
no good reason.
2023-10-25 12:12:16 +05:30
Kovid Goyal
eefb865e6e kitten @ ls: Return environ of foreground process
This is needed on macOS where we now run the shell via login and we
aren't allowed to read the environ of login because its setuid.

Fixes #6749
2023-10-25 09:54:12 +05:30
Kovid Goyal
32b7be2201 Proper fix for braindead macOS login
Always run it in the home dir as it seems to expect that. Change the
working dir after running login
2023-10-09 11:29:32 +05:30
Kovid Goyal
619d4e3dc4 Run login on macOS with -q
Fixes #6689
2023-10-09 07:05:43 +05:30
Kovid Goyal
68b861b188 macOS: When running the default shell, run it via the login program so that calls to `getlogin()` work
Fixes #6511
2023-09-24 11:12:02 +05:30
Kovid Goyal
59b47a3a8f A facility to easily have child programs print to kitty stdout
Works better than the kitty-print DCS escape code as that tends to get
interleaved with other writes to the tty since the loop infrastructure
writes in a separate I/O thread.
2023-07-30 19:49:44 +05:30
Kovid Goyal
a1e5b72ca5 Remote control launch: Fix --env not implemented when using --cwd=current with the SSH kitten
Fixes #6438
2023-07-11 09:22:15 +05:30
Kovid Goyal
71189aee9f Correct the type signature for callback 2023-05-08 16:03:27 +05:30
Kovid Goyal
34cbf5ceac Get rid of prewarming
Don't need it anymore since all major UI kittens are ported to Go
and so don't have startup latency.
2023-03-10 13:22:10 +05:30
Kovid Goyal
0903ae7b4d Do not use prewarming for wrapped kittens 2023-01-23 15:21:04 +05:30
Kovid Goyal
45b0788f28 Dont rely on existence of sh to report exec failure 2023-01-14 16:03:34 +05:30
Kovid Goyal
7fe5d7b58f Replace isort with ruff 2023-01-09 16:47:42 +05:30
Kovid Goyal
dd4051bfd5 Allow getting the exe name of the active foreground process in the tab title template 2022-11-17 22:06:06 +05:30
Kovid Goyal
58a3baaf0f Wayland: Use XDG_ACTIVATION_TOKEN when present at launch 2022-09-11 13:43:52 +05:30
Kovid Goyal
30e1b4680d Only override LANG in default env if it was not set either in the original os env or via the env config directive 2022-08-30 19:17:53 +05:30
Kovid Goyal
22fbdbca40 Fix a regression in 0.26.0 that caused kitty to no longer set the LANG environment variable on macOS
Happened because reading the locale uses cocoa APIs and they are not fork
safe, so it was moved to after prewarm forking, but at that point the
default child env had already been set.

Fixes #5439
2022-08-29 20:58:48 +05:30
Kovid Goyal
44ccdd36d6 Remove socket prewarming
The potential for breakage is too high, and I am working on an
alternative solution that will be better long term.

Prewarming is still used for kittens launched via keybindings
2022-08-20 13:38:33 +05:30
Kovid Goyal
18bf76d49e Dont set KITTY_LISTEN_ON for windows with --allow-remote-control 2022-08-16 10:50:17 +05:30
Kovid Goyal
4c5f7f50f7 Control KITTY_LISTEN_ON more precisely 2022-08-16 10:16:18 +05:30
Kovid Goyal
814dd8a275 allow_remote_control should be per window not per child 2022-08-15 21:32:14 +05:30