Commit graph

76 commits

Author SHA1 Message Date
Kovid Goyal
8f5c7544d1
Bash integration: Source the system startup files bash was built with
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
bash is compiled with the paths to its system wide profile and bashrc
(SYS_PROFILE and SYS_BASHRC) and there is no way to query bash for them.
Previously kitty guessed locations in /etc, which fails on distros that
keep these files elsewhere, such as hermetic /usr distros like Clear Linux
(/usr/share/defaults/etc) or Nix (/etc/bashrc).

Now find the paths by scanning the bash executable for them, both in kitty
and in kitten run-shell (so it works on remote hosts via the ssh kitten).
The result is cached per executable in kitty. If the scan fails, or the
locations are explicitly specified via the environment, the previous
behavior is used.

Fixes #10819
2026-11-07 06:25:36 +05:30
Kovid Goyal
98a6b3ccd4
Fix #10768 2026-10-29 17:26:48 +05:30
Kovid Goyal
bd39555779
Cleanup previous PR
Shell integration: Only wrap run0 when it is installed

Do not define the run0 wrapper in bash/zsh when run0 is not on PATH, as
that makes command -v run0 succeed on systems without it. In zsh, do not
clobber a user defined run0 function. Share the TERMINFO/no-sudo guard
between the sudo and run0 wrappers in fish. Add a test and a changelog
entry.
2026-10-18 21:33:34 +05:30
Kovid Goyal
77630f3a67
Fix random test failure when running in parallel on macOS 2026-08-23 20:39:43 +05:30
Hassan Raza
bf18c2b8c1
Fix Bash SSH hostname detection 2026-08-13 07:55:42 +05:00
Hassan Raza
9bbb900e6a
Skip disabled Bash command hook 2026-08-12 20:02:47 +05:00
Kovid Goyal
7f0b072f0d
autoformat 2026-08-05 05:32:56 +05:30
copilot-swe-agent[bot]
a31f9e52f2
Refactor kitty_tests: move __init__.py code to base.py, update all imports 2026-08-05 05:32:54 +05:30
Kovid Goyal
fd7e43ab0c
Make detection of command line flags that prevent sudo from overriding TERMINFO more robust 2026-05-05 09:38:07 +05:30
Kovid Goyal
2f991691f9
Fix test failure with fish >= 4.1
fish now requires a response to a DA1 query
2025-09-29 14:01:57 +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
Jacob Komissar
9549618bc9 Escape user input in zsh integration's _ksi_preexec
Also fix a bug in one of the test assertions to make the test work.
2025-06-23 18:44:52 -04:00
Kovid Goyal
8cbdd003e2
Make deleting test dir suring shell integration tests robust against fish 4 background daemon generating completions 2025-03-08 10:42:18 +05:30
Kovid Goyal
ac9ed921d7
Temp fix for failing fish integration test
fish >= 3.8 wants to send shell integration OSC 133 itself. However it
does not send the cmdline_url parameter, causing our integration tests
to fail. Temporarily fix by commenting out the tests for it.

Fixes #8385
2025-03-02 15:41:47 +05:30
Kovid Goyal
4f0f9b9aff
Fix #8262 2025-01-27 21:13:45 +05:30
Kovid Goyal
2b3f2258ff
More pyugrade to 3.9 2024-08-05 11:00:51 +05:30
Kovid Goyal
1307c2345d
Fix macOS binary build failing because of a test 2024-05-11 08:37:51 +05:30
Kovid Goyal
468d0c69a6
Add tests for cmdline reporting in shell integration 2024-05-09 13:46:19 +05:30
Kovid Goyal
1e528fd299
DRYer 2024-05-09 11:55:17 +05:30
Kovid Goyal
b65a5f78fd
Fix regression causing shells in darwin to not run in login mode 2024-02-25 09:57:43 +05:30
Kovid Goyal
fa11858a72
Make bash integration tests more robust on macOS 2024-02-25 09:57:38 +05:30
Kovid Goyal
52025ff030
misc parser and test fixes 2024-02-25 09:57:22 +05:30
Kovid Goyal
715548b144
Make test robust against wezterm's system wide shell integration
Not only is it system wide but it runs by default, even outside wezterm,
sigh.
2024-01-18 12:52:54 +05:30
Kovid Goyal
da31d21ddb
Port the shell integration tests to use the run-shell kitten 2023-06-26 16:53:08 +05:30
Kovid Goyal
7fe5d7b58f
Replace isort with ruff 2023-01-09 16:47:42 +05:30
Kovid Goyal
51bba9110e
Bash integration: Fix clone-in-kitty not working on bash >= 5.2 if environment variable values contain newlines or other special characters
Bash >= 5.2 changed the export command to output values using $' escaping when they contain special characters.
Fixes #5629
2022-11-22 16:38:24 +05:30
Kovid Goyal
1559a2e15a
Cleanup previous PR 2022-09-05 21:19:58 +05:30
James McCoy
f0d497dfe0
Skip bash shell_integration tests if bash is a debug build
Switch to using BASH_VERSINFO rather than BASH_VERSION, since it
provides structured data.

    BASH_VERSINFO
           A readonly array variable whose members hold version information for this instance of bash.  The values assigned to the array members are as follows:
           BASH_VERSINFO[0]        The major version number (the release).
           BASH_VERSINFO[1]        The minor version number (the version).
           BASH_VERSINFO[2]        The patch level.
           BASH_VERSINFO[3]        The build version.
           BASH_VERSINFO[4]        The release status (e.g., beta1).
           BASH_VERSINFO[5]        The value of MACHTYPE.

When release status is not "release", bash builds are in debug mode and
output extra information which disturbs the integration.

Closes #5473
2022-09-05 11:37:37 -04:00
Kovid Goyal
c455fea729
Also output screen contents when test fails 2022-09-05 07:52:36 +05:30
Kovid Goyal
16da031f68
Wait till prompt appears before issuing clear 2022-08-28 21:54:55 +05:30
Kovid Goyal
43b2935e52
Make fish shell integration test for XDG_DATA_DIRS work even if the shells rc files add to XDG_DATA_DIRS.
My Linux distro has now started installing system wide rc files that do
this :((
2022-08-28 21:15:26 +05:30
Kovid Goyal
21eece4c6d
Ensure no bytecode is written when running shell based tests 2022-08-08 17:50:59 +05:30
Kovid Goyal
d6492264c7
Bash integration: Fix declare not creating global variables in .bashrc
Fixes #5254
2022-07-08 18:55:04 +05:30
Kovid Goyal
6405849a1b
Bash integration clone test was accidentally running zsh
Fixes #5144
2022-05-29 08:46:06 +05:30
Kovid Goyal
e71b9091a3
Dont rely on env -0 for bash either 2022-04-15 13:33:32 +05:30
Kovid Goyal
b866c3e783
Add a zsh test for clone env serialization 2022-04-15 12:04:50 +05:30
pagedown
7160027c14
Use the fish built-in function name to report current working directory
If the feature is enabled by fish in the future, it will override the
built-in one and there will be no duplicate reporting.
2022-03-16 01:03:26 +08:00
Kovid Goyal
c95dca4023
See if we can make the test more robust 2022-03-15 20:38:02 +05:30
Kovid Goyal
47b3c37bf0
Add cwd reporting to fish integration 2022-03-15 20:25:39 +05:30
Kovid Goyal
190666dc8a
Check that non-ascii paths work in cwd reporting 2022-03-15 20:16:09 +05:30
Kovid Goyal
f982e754e4
Enable CWD reporting in bash integration 2022-03-15 15:37:17 +05:30
Kovid Goyal
4a1ad7755a
Enable CWD reporting in the zsh integration 2022-03-15 14:30:21 +05:30
pagedown
1b68e41db4
Remove the fish integration prompt end B prompt marking
Currently kitty does not use the B prompt marking.
This is consistent with the zsh and bash implementations.
Improve compatibility with most user configurations.
2022-03-07 12:12:52 +08:00
pagedown
7c166e2194
Try to make the fish vi cursor test more stable 2022-03-04 23:46:39 +08:00
pagedown
d236b34fd4
Shell integration: Fix running bash non-interactively
In POSIX mode, bash does not perform ENV with non-interactive shell, so
the mode cannot be recovered. Check the arguments and do not change the
execution environment.
2022-03-04 19:47:44 +08:00
Kovid Goyal
4279f20daf
Dont depend on the default bash prompt when testing 2022-03-03 21:24:42 +05:30
Kovid Goyal
d8ed42ae8e
Move setting of ZLE_RPROMPT_INDENT to zshrc which will hopefully prevent it being overriden 2022-03-03 19:16:44 +05:30
Kovid Goyal
297592242c
Fix #4782
Presumably the failure is caused by zsh not having finished drawing the
prompt when the cursor shape is changed. So instead wait till the
expected prompt is drawn. There are probably more places where this
change needs to be made, which I cant tell since I cant reproduce.
2022-03-03 17:22:42 +05:30
Kovid Goyal
e103b280fd
Add test for HISTFILE 2022-02-28 20:09:54 +05:30
pagedown
2d4f7e3446
Disable system startup files in zsh integration test with --noglobalrcs 2022-02-27 20:21:05 +08:00