Compare commits

...

4384 Commits

Author SHA1 Message Date
Kovid Goyal
55b53bcac6 version 0.26.4 2022-10-17 08:18:51 +05:30
Kovid Goyal
57d044861f Merge branch 'patch-1' of https://github.com/ms-test/kitty 2022-10-16 13:28:06 +05:30
ms-test
aab149366d Check correct pair member
I haven't looked deeply, but this looked to be a simple typo unless it's checking one both times because of a type invariant. If that is the case, and the check is correct, then a comment and/or code refactoring to call attention to this would likely be a good idea.
2022-10-16 03:53:16 -04:00
Kovid Goyal
896f93822d kitty shell: Also output active tab id
Fixes #5590
2022-10-16 08:52:35 +05:30
Kovid Goyal
6890e265b6 GNOME Wayland: Fix a memory leak in gnome-shell when using client side decorations
destroy CSD buffers that were never attached explicitly, as mutter does
not send release events for these even when the pool is destroyed.
2022-10-12 17:52:47 +05:30
Kovid Goyal
48a4edc199 Merge branch 'action_cwd_doc' of https://github.com/cbosdo/kitty 2022-10-10 14:04:29 +05:30
Cédric Bosdonnat
d63be90a7f Recommend using --cwd=current in open-actions.conf
Editors like Vim are basing path-related commands on the current working
directory. Launching the action with the current CWD in hyperlink opens
makes life easier and would work with every editor.
2022-10-10 10:12:20 +02:00
Kovid Goyal
6af020e4ef Merge branch 'marksisson/simple-docs-change' of https://github.com/marksisson/kitty 2022-10-09 12:18:25 +05:30
Mark Sisson
ca24e9ca67 change linux_package build instructions to use make target 2022-10-09 00:02:38 -05:00
Kovid Goyal
fbfaefd72a Wayland: Fix an abort when changing background colors with wayland_titlebar_color set to background
Fixes #5562
2022-10-07 14:13:12 +05:30
Kovid Goyal
94b3776066 Merge branch 'master' of https://github.com/Diff-fusion/kitty 2022-10-05 09:09:23 +05:30
Felix
15e4be9051 Fix clipboard target properties and memory leak 2022-10-04 17:22:15 +02:00
Kovid Goyal
ae8f3de070 Allow centering the background image
Fixes #5525
2022-10-04 08:26:28 +05:30
Kovid Goyal
c8d18ffe26 Add a note about yet another gnome bug 2022-10-03 22:06:00 +05:30
Kovid Goyal
4d80427908 Wayland: Fix background image scaling using tiled mode on high DPI screens 2022-10-03 21:49:52 +05:30
Kovid Goyal
0e69324469 Fix resize draw strategy == static causing background image/borders to not be drawn 2022-10-03 21:40:00 +05:30
Kovid Goyal
cf22729dfa Fix background_tint not applying to window margins and padding
Fixes #3933
2022-10-03 21:39:57 +05:30
Kovid Goyal
1402c5bbfa Forgot to change check for space for next tab to use its max tab length rather than the current tabs max tab length, since they can now be different 2022-10-03 16:21:50 +05:30
Kovid Goyal
f0f0c8f4fe max_title_length -> max_tab_length 2022-10-03 16:15:24 +05:30
Kovid Goyal
96faac95db DRYer 2022-10-03 15:32:42 +05:30
Kovid Goyal
08041415d1 Document the purpose of for_layout 2022-10-03 13:26:55 +05:30
Kovid Goyal
647b18d345 Tab bar: Improve empty space management when some tabs have short titles, allocate the saved space to the active tab
Fixes #5548
2022-10-03 13:24:21 +05:30
Kovid Goyal
a116e3cadd Merge branch 'patch-1' of https://github.com/sorrycc/kitty 2022-09-30 07:46:32 +05:30
chencheng (云谦)
52c9b5f5b8 Update custom.css 2022-09-30 08:44:09 +08:00
Kovid Goyal
bbc9f588f1 Merge branch 'unicode-15' of https://github.com/page-down/kitty 2022-09-29 09:17:02 +05:30
pagedown
13a3c6b5b2 Update to Unicode 15.0 2022-09-29 10:13:21 +08:00
pagedown
fc15b20f24 Update to Nerd Fonts 2.2.2 2022-09-29 10:13:10 +08:00
Kovid Goyal
cd8f2e5cc6 another mypy update another round of breakage 2022-09-27 07:19:03 +05:30
Kovid Goyal
267798a277 Update the docs of open_url_with to indicate that open-actions.conf is read by the "default" handler 2022-09-26 20:21:44 +05:30
Kovid Goyal
921ac12e90 Clear both actions caches when config file is reloaded 2022-09-26 20:15:08 +05:30
Kovid Goyal
901e00cab1 Cleanup previous PR
1) Dont use deprecated code
2) Always set the dock icon on startup as the dock icon doesnt change
   till the dock is restarted
3) Update the app icon automatically if the mtime on the custom icon in
   the config dir is newer than the mtime of the sentinel file apple
   puts inside the application bundle to indicate it has a custom icon
2022-09-25 18:11:17 +05:30
Kovid Goyal
d0769f3979 ... 2022-09-25 17:36:32 +05:30
Kovid Goyal
7e4dd8cf1e Merge branch 'macos-set-icon' of https://github.com/page-down/kitty 2022-09-25 14:40:36 +05:30
Kovid Goyal
5ea0519f62 Pass through python used for type check to the test code from before the env is sanitized 2022-09-25 14:36:12 +05:30
pagedown
a1029418f8 macOS: Allow to set custom app icon automatically 2022-09-25 15:25:43 +08:00
Kovid Goyal
98eacb2067 panel kitten: Do not depend on xprop 2022-09-24 15:44:54 +05:30
Kovid Goyal
2cef9abbd3 Get rid of one call to xprop in the panel kitten 2022-09-24 15:17:11 +05:30
Kovid Goyal
0fa158c809 Merge branch 'docs' of https://github.com/page-down/kitty 2022-09-24 14:38:42 +05:30
pagedown
c54a6b398b Add some missing no_response for rc commands 2022-09-24 12:43:13 +08:00
pagedown
27ea367123 Docs: Remove the extra backslashes from the install commands 2022-09-24 12:39:05 +08:00
Kovid Goyal
42178a4570 X11: Fix a regression in the previous release that caused pasting from GTK based applications to have extra newlines
Fixes #5528

And let me just re-iterate, GNOME/GTK is developed by morons.
2022-09-24 08:56:50 +05:30
Kovid Goyal
e98ecc1c4f Another auto-indent fix 2022-09-24 08:34:07 +05:30
Kovid Goyal
0d64246209 fix vim autoindent 2022-09-24 08:31:14 +05:30
Kovid Goyal
a0495219ab ... 2022-09-24 08:30:40 +05:30
Kovid Goyal
9d98aa3159 Merge branch 'patch-2' of https://github.com/sashashura/kitty 2022-09-24 07:29:42 +05:30
Alex
5c82f4beca build: harden ci.yml permissions
Signed-off-by: Alex <aleksandrosansan@gmail.com>
2022-09-23 22:14:57 +02:00
Alex
13539bd8c6 build: harden codeql-analysis.yml permissions
Signed-off-by: Alex <aleksandrosansan@gmail.com>
2022-09-23 22:14:16 +02:00
Kovid Goyal
26b8ab9adf Use a regex for bracketed paste sanitization 2022-09-23 22:18:03 +05:30
Kovid Goyal
dbb97a62bf version 0.26.3 2022-09-22 13:48:20 +05:30
Kovid Goyal
b1fa1c9820 Make test a bit more robust 2022-09-21 23:16:34 +05:30
Kovid Goyal
2dc9488909 switch python autoformatter to isort+black+autoflake 2022-09-21 13:40:37 +05:30
Kovid Goyal
e2a251224d ssh kitten: Better error message when tar is missing 2022-09-21 07:34:15 +05:30
Kovid Goyal
2a2dca8a58 ... 2022-09-18 08:26:40 +05:30
Kovid Goyal
e1f3cb85c0 Window for id should not fail when not called from a callback 2022-09-18 08:24:02 +05:30
Kovid Goyal
13cf38d6c6 Update changelog 2022-09-17 18:21:28 +05:30
Kovid Goyal
5180a41e87 Fix a use-after-free when handling fake mouse clicks and the action causes windows to be removed/re-allocated
Fixes #5506
2022-09-17 18:21:10 +05:30
Kovid Goyal
1c44da2b4a Nicer error message when trying to open the config file and no editor is available 2022-09-13 17:24:11 +05:30
Kovid Goyal
bcd78c3940 Fix a regression that caused kitty not to restore SIGPIPE after python nukes it when launching children. Affects bash which does not sanitize its signal mask.
Fixes #5500
2022-09-13 07:51:32 +05:30
Kovid Goyal
fe2f3d9870 Wayland: Remove the mutter specific ignoring of the first empty surface configure event. It seems to be no longer necessary on current mutter, with the recent Wayland changes 2022-09-11 14:37:50 +05:30
Kovid Goyal
dcf2152a7a Wayland: Generate a XDG_ACTIVATION_TOKEN when opening URLs or running programs in the background via the launch action 2022-09-11 14:25:49 +05:30
Kovid Goyal
58a3baaf0f Wayland: Use XDG_ACTIVATION_TOKEN when present at launch 2022-09-11 13:43:52 +05:30
Kovid Goyal
b247759d30 DRYer 2022-09-11 13:15:42 +05:30
Kovid Goyal
ba8d30896b Try to use the activation protocol to focus windows 2022-09-11 10:39:28 +05:30
Kovid Goyal
4d30ae55f3 Wayland: Mark windows in which a bell as urgent on compositors that support the xdg-activation protocol 2022-09-11 09:33:41 +05:30
Kovid Goyal
983ab3c67d build wayland xdg-activation protocol 2022-09-10 16:08:38 +05:30
Kovid Goyal
0bf228b030 Wayland: Micro-optimization: Assume window will be shown on primary monitor so create it with its scale set to that of the primary monitor 2022-09-10 15:23:56 +05:30
Kovid Goyal
29b3a92ffc Wayland: swap buffers immediately on scale change to ensure attached buffer is a multiple of the new scale
Earlier we were only swapping buffers when ready to draw, but the
Wayland protocol  requires the attached buffer to be a multiple of the
scale. We cannot guarantee an application side swap will be triggered
before the next commit, so instead we blank the new buffer swap it in
the GLFW backend itself.

Fixes #5467
2022-09-10 15:09:46 +05:30
Kovid Goyal
23d73ec933 ... 2022-09-10 12:52:27 +05:30
Kovid Goyal
bc650f6230 Output initial window creation size in debug 2022-09-10 12:28:53 +05:30
Kovid Goyal
5272318d67 Update changelog 2022-09-10 12:10:30 +05:30
Kovid Goyal
5ba887ff68 Wayland: Fix for bug in NVIDIA drivers that prevents transparency working
Fixes #5479
2022-09-10 11:57:18 +05:30
Kovid Goyal
67d70f8b8f Apparently on Wayland we need to set the swap interval on every window not just the first. It's somehow not shared even though the context is shared? Fixes #5495 2022-09-10 10:41:31 +05:30
Kovid Goyal
0fac6e4de9 render frames should be always respected on macOS
Only Wayland suffers from flicker on resize when using render frames.
2022-09-10 10:25:42 +05:30
Kovid Goyal
1e7a11b278 Wayland: When swapping buffers in response to a configure event ensure the window is the current context otherwise the swap fails
The swap failing will mean the buffer is not attached which might cause
issues with some compsitors.
2022-09-10 10:22:09 +05:30
Kovid Goyal
6741ac2087 Sessions: Allow controlling which OS Window is active via the focus_os_window directive 2022-09-10 08:27:36 +05:30
Kovid Goyal
7b2e29a6a8 ... 2022-09-10 07:52:26 +05:30
Kovid Goyal
6f147544d2 Add ! to env var serialization test 2022-09-10 07:21:15 +05:30
Kovid Goyal
89570d3b52 ssh kitten: Fix KITTY_PUBLIC_KEY not being encoded properly when transmitting
Fixes #5496
2022-09-10 07:09:58 +05:30
Kovid Goyal
dd4a65e0c9 ... 2022-09-09 15:41:45 +05:30
Kovid Goyal
79fba9dd9a Use the dynamic property instead of testing identifier serialization 2022-09-09 15:39:00 +05:30
Kovid Goyal
b123c21010 Update changelog
Fixes #5483
2022-09-09 13:13:58 +05:30
Kovid Goyal
9c5d1f9771 Pass null bytes through the clipboard on cocoa 2022-09-09 13:12:12 +05:30
Kovid Goyal
5131224b59 Convenience code for debugging 2022-09-09 12:20:28 +05:30
Kovid Goyal
be89da2271 Handle dyn prefixes 2022-09-09 11:59:49 +05:30
Kovid Goyal
45b408a78b Allow setting arbitrary mime types 2022-09-09 11:14:12 +05:30
Kovid Goyal
0e7da8643e Get cocoa clipboard backend working 2022-09-09 10:59:10 +05:30
Kovid Goyal
410b1816ad More work on cocoa clipboard backend 2022-09-09 07:39:38 +05:30
Kovid Goyal
bcfa2a64e4 Start work on new clipboard api support for macos 2022-09-08 21:45:13 +05:30
Kovid Goyal
91c00fb5ac Implement the new clipboard API for Wayland 2022-09-08 17:29:18 +05:30
Kovid Goyal
c58d217d32 Only warn about cursor size once 2022-09-08 16:28:40 +05:30
Kovid Goyal
a9b6047741 Simplify handling of self offers 2022-09-08 15:34:14 +05:30
Kovid Goyal
6b432bee4f Cleanup sending/receiving mimetype atoms 2022-09-08 12:45:35 +05:30
Kovid Goyal
087f0b449f ... 2022-09-08 12:45:35 +05:30
Kovid Goyal
96160b52b6 Code to get the available mime types in the clipboard 2022-09-08 12:45:34 +05:30
Kovid Goyal
d17a6cd3a3 Get reading from clipboard working 2022-09-08 12:45:34 +05:30
Kovid Goyal
7e1380cc0d Start work on giving GLFW a proper clipboard API 2022-09-08 12:45:34 +05:30
Kovid Goyal
9a99554ed3 Also have confirm() and get_line() return their results on overlay removal 2022-09-08 12:06:25 +05:30
Kovid Goyal
19799bd538 When choosing an option call the callback after the popup window is removed. This ensures the active window is unchanged when the callback is called. Fixes #5488 2022-09-08 12:01:38 +05:30
Kovid Goyal
902e94ceac Fix #5484 2022-09-07 15:09:24 +05:30
Kovid Goyal
5bb2cb06a9 Fix #5477 2022-09-05 21:43:56 +05:30
Kovid Goyal
1559a2e15a Cleanup previous PR 2022-09-05 21:19:58 +05:30
Kovid Goyal
35f94963cd Merge branch 'skip-tests-bash-debug' of https://github.com/jamessan/kitty 2022-09-05 21:18:52 +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
5bdf27fd78 version 0.26.2 2022-09-05 10:49:50 +05:30
Kovid Goyal
f05783e64d Sanitize notifications ids as they are retransmitted over the TTY 2022-09-05 10:41:19 +05:30
Kovid Goyal
c455fea729 Also output screen contents when test fails 2022-09-05 07:52:36 +05:30
Kovid Goyal
5bf5454dbe Nicer fix for #5469 2022-09-04 22:15:17 +05:30
Kovid Goyal
b60d9f73ce Wayland: Fix remembering window size not accurate when client side decorations are present 2022-09-04 14:25:04 +05:30
Kovid Goyal
31fe35cd38 Fix #5469 2022-09-04 13:58:16 +05:30
Kovid Goyal
607bc845fc Allow creating overlay-main windows, which are treated as the active window unlike normal overlays
Fixes #5392
2022-09-03 19:04:31 +05:30
Kovid Goyal
a420d9d19c spacing is a clone safe option 2022-09-02 23:28:58 +05:30
Kovid Goyal
4b81e4936e launch: Allow setting the margin and padding for the newly created window
Fixes #5463
2022-09-02 19:41:05 +05:30
Kovid Goyal
295743a96e Fix ref to launch doc 2022-09-02 16:31:21 +05:30
Kovid Goyal
d3a1848c27 Remove markup from ref_hyperlink text 2022-09-02 16:24:50 +05:30
Kovid Goyal
9cec924f32 hints kitten: Allow using launch as the program to run, to open the result in a new kitty tab/window/etc.
Fixes #5462
2022-09-02 16:23:00 +05:30
Kovid Goyal
67c963ab89 Pass KITTY_LISTEN_ON to programs opened via open_url
Useful if those programs want to talk to kitty via the rc socket
2022-09-02 16:01:30 +05:30
Kovid Goyal
0f7ced25c1 ... 2022-09-01 13:55:48 +05:30
Kovid Goyal
42948ffff0 Merge branch 'docs' of https://github.com/page-down/kitty 2022-09-01 13:55:30 +05:30
pagedown
922ce5bdea Docs: Put example commands in code blocks 2022-09-01 15:35:51 +08:00
pagedown
1b42486026 Docs: Remove the extra empty line in the CLI help
Also keep the example code in a code block, in the HTML documentation.
2022-09-01 15:35:41 +08:00
pagedown
95f1a971b2 Docs: Mention clear_all_shortcuts in the FAQ about show_key kitten 2022-09-01 15:35:17 +08:00
Kovid Goyal
7968c88c67 ... 2022-09-01 07:54:36 +05:30
Kovid Goyal
992e90b0a3 Fix a regression in 0.26.0 that broke mapping of native keys who key codes did not fit in 21 bits
Fixes #5452
2022-08-31 22:19:51 +05:30
Kovid Goyal
afada84f52 Cleanup previous PR
Use wcswidth() for line width calculation. Works with emoji and ignores
escape codes automatically. Add changelog entry.
2022-08-31 08:01:52 +05:30
Kovid Goyal
b978ff8930 Merge branch 'fix/hints-next-line' of https://github.com/trygveaa/kitty 2022-08-31 07:56:38 +05:30
Kovid Goyal
053cede581 Use git rev-parse to get nightly commit hash 2022-08-31 07:22:56 +05:30
Trygve Aaberge
03720402a7 Fix hints sometimes matching next line as part of URL
For URLs where there's fewer characters left to the right edge of the
window than the number of escape characters in the line, the next line
would be included in the URL, as if the URL went all the way to the
right edge.

For example with a 40 chars wide terminal, if you run:

    echo -e '\e[31m1\e[m https://github.com/kovidgoyal/kitty\ntest'

And launch the hints kitten, you'll see that test on the next line will
be included in the URL.

This happened because the calculation for filling the rest of the line
with NUL characters counted the escape characters as well as the visible
characters, so it filled in too few characters.

This is a regression introduced in commit 91966712.
2022-08-30 22:24:58 +02:00
Kovid Goyal
fca0999814 Eureka! Figured out why libedit is breaking in prewarm on macOS via launchd
The prewarm zygote imports the world. shell.py had a top level import
for readline. Which means readline was being imported pre-fork. And of
course as is traditional with Apple libedit is not fork safe. Probably
because it initializes its internal IO routines based on the stdio
handles at time of import which are the handles kitty gets from launchd
2022-08-30 19:35:17 +05:30
Kovid Goyal
78056c659c Another place we cant use readline on macOS 2022-08-30 19:27:55 +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
89a0c04d19 Fix exec in prewarm forked process sometimes inheriting env vars from grandparent process 2022-08-30 19:03:32 +05:30
Kovid Goyal
1ba027c277 Dont show LC_CTYPE in show_kitty_env_vars when running with system python on macOS 2022-08-30 16:55:17 +05:30
Kovid Goyal
d8e43a3412 macOS: Fix regression in 0.26.0 that caused asking the user for a line of input such as for set_tab_title to not work
Apparently libedit doesn't work in the forked process when the parent
process is run via Launch Services. I cant be bothered to investigate
why, given that libedit is closed source. macOS users will just have to
live without history/completion in the ask kitten until I get around to
writing a replacement for readline/libedit.

And on a personal note, macOS >> Necrotizing fasciitis

Fixes #5447
2022-08-30 16:45:14 +05:30
Kovid Goyal
644e46e91d Reconfigure all stdio streams in the prefork process 2022-08-30 16:22:59 +05:30
Kovid Goyal
e2a1f8dde7 ... 2022-08-30 10:40:59 +05:30
Kovid Goyal
7d09c6b762 Link to start of actual changelog 2022-08-30 10:27:53 +05:30
Kovid Goyal
6604e0d015 Fix regression in 0.26.0 that caused launching kitty without working STDIO handles to result in high CPU usage and prewarming failing
Fixes #5444
2022-08-30 08:15:13 +05:30
Kovid Goyal
bb2ec9cde7 ... 2022-08-30 07:50:36 +05:30
Kovid Goyal
89a2545855 Cleanup previous PR
Allow disabling hyperlinking of rg output. Also parse
--kitten=hyperlink=... form of CLI args.
2022-08-30 07:41:14 +05:30
Kovid Goyal
49f8c0eae6 Merge branch 'hyperlinked-grep-only-matches' of https://github.com/groves/kitty 2022-08-30 06:59:53 +05:30
Kovid Goyal
268d687814 version 0.26.1
Bloody macOS. I have better things to do that play whack-a-mole with all
the bug reports caused macOS not bothering to set LANG.
2022-08-30 01:04:42 +05:30
Charlie Groves
db5b4da388 Add options for linking different parts of ripgrep output 2022-08-29 13:23:42 -04:00
Kovid Goyal
71f8e50460 Update changelog 2022-08-29 21:01:59 +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
6253ee2a74 Allow resetting the tab title to default 2022-08-29 20:41:07 +05:30
Kovid Goyal
5b28aed0b1 Allow the set_tab_title action to take an argument 2022-08-29 20:11:18 +05:30
Kovid Goyal
9eabc9ecf1 Merge branch 'bash-inherit_errexit' of https://github.com/grimm26/kovidgoyal-kitty 2022-08-29 19:47:24 +05:30
Mark Keisler
a77852466c bash shell integration: Send STDERR of unsetting inherit_errexit to
/dev/null

Some bash versions may not have that option and rather than checking if
they even have it or if it is set, just quiet the STDERR it may throw.

```
$ kssh myhost
bash: shopt: inherit_errexit: invalid shell option name
myhost:~$ bash --version
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
```
2022-08-29 08:58:54 -05:00
Kovid Goyal
c68b82e4d0 ssh kitten: Fix executable permission missing from kitty bootstrap script
Fixes #5438
2022-08-29 18:20:09 +05:30
Kovid Goyal
16a4845a72 version 0.26.0 2022-08-29 05:05:11 +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
Charlie Groves
8c7968a4d6 Describe --hyperlink-only-matches in the docs 2022-08-28 07:02:39 -04:00
Kovid Goyal
fba759a47c missed some at_ -> at- 2022-08-28 12:04:00 +05:30
Kovid Goyal
3bcb694b1b Switch over to at-cmd form for references.
Sphinx anyway converts at_cmd to at-cmd for anchors in HTML so using at-cmd
consistently.
2022-08-28 11:54:32 +05:30
Kovid Goyal
555020cfd5 Also allow using at-cmd 2022-08-28 10:26:38 +05:30
Kovid Goyal
391e2b8488 Fix resolution of anchor names for kitty @ command docs 2022-08-28 10:25:00 +05:30
Kovid Goyal
c856d5c058 Fix hyperlinks not present when fetching text from the history buffer
Fixes #5427
2022-08-28 08:54:53 +05:30
Charlie Groves
f5a70adf0b Add a --hyperlink-only-matches flag to hyperlinked_grep
If it's active, only matching lines get links, not file headers or context lines.
2022-08-26 17:05:50 -04:00
Kovid Goyal
e330c38d4a ssh kitten: Delegate to ssh when -T is used
Fixes #5411
2022-08-24 15:23:41 +05:30
Kovid Goyal
d595084395 DRYer 2022-08-24 15:02:36 +05:30
Kovid Goyal
b32ee5ee46 Forgot to change code to remove markup for github links 2022-08-24 15:00:39 +05:30
Kovid Goyal
098dd10789 ... 2022-08-24 14:42:40 +05:30
Kovid Goyal
b5fa643c5d Allow ignoring failures when mapping remote control commands 2022-08-24 14:21:54 +05:30
Kovid Goyal
664dd29970 Merge branch 'rc-no-response' of https://github.com/page-down/kitty 2022-08-24 14:15:13 +05:30
Kovid Goyal
b7a4281985 Allow ignoring failure to close windows/tabs via rc commands 2022-08-24 14:13:31 +05:30
Kovid Goyal
9e9aa52553 Ensure extract_rt_targets is run only once per build 2022-08-24 14:00:44 +05:30
Kovid Goyal
77fbdfbb53 Fix finding local docs when running from source on macOS 2022-08-24 13:54:14 +05:30
Kovid Goyal
214416f1e3 Fix handling of :doc: in CLI help output 2022-08-24 13:43:47 +05:30
pagedown
800437ec6b Remote control: Add --no-response to some commands 2022-08-24 15:14:53 +08:00
Kovid Goyal
957eafbef0 Merge branch 'docs' of https://github.com/page-down/kitty 2022-08-24 12:35:00 +05:30
pagedown
7f228bcbf5 Docs: Unify the list style of available values
Highlight the value and provide hyperlink in the description.
2022-08-24 13:30:52 +08:00
pagedown
fd4a682c5b Fix doc website URL with duplicate slashes 2022-08-24 13:29:51 +08:00
pagedown
ba9afc61a4 Hyperlink doc text role 2022-08-24 13:29:07 +08:00
pagedown
9a70709bba Shorten the reference link to the top of the page
Reduce the length of the link :ref:`shell_integration` in commented conf.
2022-08-24 13:27:19 +08:00
pagedown
c437a36794 Fix GitHub links in commented configuration
Hyperlink GitHub related text roles: iss, pull, disc
2022-08-24 13:27:12 +08:00
pagedown
0e0578ff49 Docs: Use --help long option name in the document
Remove the extra empty line in the CLI help for `--replay-commands`.
2022-08-24 13:27:06 +08:00
pagedown
64a202a125 Docs: Using the lowercase form of the key name consistently 2022-08-24 13:26:50 +08:00
Kovid Goyal
740d1ca146 Merge branch 'high-sierra-compat' of https://github.com/rkitover/kitty 2022-08-20 22:15:10 +05:30
Rafael Kitover
7b75f055ea Fix build on macOS High Sierra
Check for >= 10.14 using Availability.h to use the accessibilityRole
callback which does not seem to be available in 10.13.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-20 16:08:28 +00:00
Kovid Goyal
8d6a3cff25 Fix docs build error 2022-08-20 16:26:49 +05:30
Kovid Goyal
10fdde6647 Hyperlink :envvar: as well 2022-08-20 16:24:46 +05:30
Kovid Goyal
e1c45dc23f ... 2022-08-20 16:20:30 +05:30
Kovid Goyal
2efb8f6dc2 Create an API to easily use remote control commands from kittens 2022-08-20 16:19:16 +05:30
Kovid Goyal
3b77f3b4bc Also hyperlink :term: 2022-08-20 15:40:39 +05:30
Kovid Goyal
31f763282f Document the show help shortcut 2022-08-20 14:03:16 +05:30
Kovid Goyal
39434fb1f6 A new default shortcut to show the kitty documentation 2022-08-20 13:55:10 +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
4cc0138a28 Delete the frozen python dir
I verified that all the files remaining in it are loaded via the python
resource system and so are not needed.
2022-08-20 13:05:12 +05:30
Kovid Goyal
6ca39d9d83 Move code to delete empty folders into bypy
So it applies to both linux and mac builds automatically
2022-08-20 12:46:55 +05:30
Kovid Goyal
26c099639c Remove empty folders from macOS package builds 2022-08-20 12:20:18 +05:30
Kovid Goyal
329043ba08 Cleanup build documentation
Note how to build the kitty docs wherever needed instead of in a
separate section
2022-08-20 12:09:36 +05:30
Kovid Goyal
e289f4959f DRYer 2022-08-20 12:03:33 +05:30
Kovid Goyal
b6760a59fa Another bug in resolve_ref 2022-08-20 11:45:48 +05:30
Kovid Goyal
cd35f92607 Fix resolve_ref() 2022-08-20 11:29:40 +05:30
Kovid Goyal
ea8f223298 Cleanup the wrap implementation
Make it more efficient and add support for hyperlink escapes
2022-08-20 09:17:05 +05:30
Kovid Goyal
a4c3154dab ... 2022-08-20 08:27:24 +05:30
Kovid Goyal
6aa3405c78 Clean up build docs a bit 2022-08-20 08:13:42 +05:30
Kovid Goyal
da618584af Fix some outdated docs 2022-08-19 15:48:17 +05:30
Kovid Goyal
9bc31a5651 Use locally built docs when running from source if they exist 2022-08-19 15:01:20 +05:30
Kovid Goyal
314dd97059 Command line tools shouldnt need to resolve documentation refs
Instead use a new kitty+doc protocol and have kitty navigate to the
docs. Uses a default open action for the protocol, which can be
overriden by the user should they so desire.
2022-08-19 14:35:17 +05:30
Kovid Goyal
0b66f20934 Fix mapping of ref targets with underscores 2022-08-19 14:34:25 +05:30
Kovid Goyal
aba634ce88 Fix building of docs on macOS without warnings
--detach doesnt exist on macOS
2022-08-19 14:16:28 +05:30
Kovid Goyal
033950dae9 Only hyperlink when stdout is a tty 2022-08-19 14:05:53 +05:30
Kovid Goyal
a59e1adee1 Also hyperlink the :ac: role in CLI help output 2022-08-19 14:05:11 +05:30
Kovid Goyal
5350eb29c1 A new mappable action to show kitty docs in the browser 2022-08-19 14:00:30 +05:30
Kovid Goyal
2bb42e67d7 We have to build docs to test building of package now 2022-08-19 13:51:35 +05:30
Kovid Goyal
8745c4cd4a Make the kitty man pages automatically available inside kitty when using a binary build 2022-08-19 12:59:10 +05:30
Kovid Goyal
3288400005 Make the docs and man pages available in the macos bundle as well 2022-08-19 12:38:10 +05:30
Kovid Goyal
1f499a7c6c Add newline to end of generated file 2022-08-19 11:29:47 +05:30
Kovid Goyal
012731c3be Clean _generated.h files 2022-08-19 11:22:30 +05:30
Kovid Goyal
5deed81737 Dont maintain ref_map manually 2022-08-19 11:20:50 +05:30
Kovid Goyal
6f6e23bf61 Update docs 2022-08-19 10:00:06 +05:30
Kovid Goyal
d2d0487356 Hyperlink :ref: roles in CLI help 2022-08-19 09:57:52 +05:30
Kovid Goyal
30df4e5de2 Improve formatting of --stdin-source 2022-08-19 09:34:52 +05:30
Kovid Goyal
3f4588c408 Improve formatting of launch --type help message 2022-08-19 09:30:22 +05:30
Kovid Goyal
4e4ca366d9 Merge branch 'docs' of https://github.com/page-down/kitty 2022-08-18 17:52:24 +05:30
pagedown
040ff0cc9d For running the new code KITTY_PREWARM_SOCKET needs to be dropped 2022-08-18 17:06:07 +08:00
pagedown
b01ad4bb3b ... 2022-08-18 17:05:35 +08:00
pagedown
4476251b76 List the available data names for tab_title_template in commented conf
List syntax starting with * becomes a block of text in the commented
configuration file.
2022-08-18 17:05:24 +08:00
pagedown
0f4cb1955f Use the plus sign to connect shortcut keys consistently 2022-08-18 17:05:00 +08:00
Kovid Goyal
c161ee7b5e Merge branch 'rc-password' of https://github.com/page-down/kitty 2022-08-17 18:41:48 +05:30
pagedown
a5bb2548a6 Do not set KITTY_LISTEN_ON after the window rc password is configured 2022-08-17 19:37:52 +08:00
Kovid Goyal
2898a3ef8c Some documentation cleanup 2022-08-17 06:48:33 +05:30
Kovid Goyal
a0568334b5 Change the default for allow_remote_control back to no
That way if there are any bugs in the implementation, we wont be
exposing users by default. In the future after the implementation has
been battle tested, we can revisit.
2022-08-17 06:42:51 +05:30
Kovid Goyal
4005cfdff2 Disallow passwords that start with - to allow for future addition of options 2022-08-17 00:58:11 +05:30
Kovid Goyal
1d8c5e65b9 Ignore generated .go files 2022-08-17 00:55:12 +05:30
Kovid Goyal
56f45e8b0f Fix unhandled exceptions not being printed to stderr on macOS when run from launch services and using prewarming 2022-08-16 15:28:07 +05:30
Kovid Goyal
48a9584688 Hide the password when asking for rc permission
Can press a key or click on it to reveal it
2022-08-16 14:07:36 +05:30
Kovid Goyal
bfcd324993 ask kitten: allow having hidden text in the message 2022-08-16 13:57:58 +05:30
Kovid Goyal
a75235a260 rcp ars should be a sequnce not a set 2022-08-16 12:10:15 +05:30
Kovid Goyal
e8de2def96 Fix --allow-remote-control not working with allow_remote_control=no 2022-08-16 11:42:39 +05:30
Kovid Goyal
5ffc4c6498 DRYer 2022-08-16 11:37:31 +05:30
Kovid Goyal
d0c50248ea Graphics protocol: Only delete temp files if they have the string tty-graphics-protocol in their file paths.
This prevents deletion of arbitrary files in /tmp via the graphics
protocol.
2022-08-16 11:25:33 +05:30
Kovid Goyal
ca2a121696 Nicer error when listen on socket is not found 2022-08-16 10:59:51 +05:30
Kovid Goyal
02d06d6726 Fix --allow-remote-control without passwords not working 2022-08-16 10:51:54 +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
6961845167 ask kitten: fix button click area offset vertically 2022-08-16 10:35:51 +05:30
Kovid Goyal
4c5f7f50f7 Control KITTY_LISTEN_ON more precisely 2022-08-16 10:16:18 +05:30
Kovid Goyal
572e920466 Allow restricting the remote control actions in specific windows 2022-08-16 07:08:51 +05:30
Kovid Goyal
b81fb3c865 Disable pre-warming when running gen-config.py 2022-08-16 05:41:46 +05:30
Kovid Goyal
814dd8a275 allow_remote_control should be per window not per child 2022-08-15 21:32:14 +05:30
Kovid Goyal
1619687d1d Allow specifying allowed actions when no password is sent 2022-08-15 21:05:53 +05:30
Kovid Goyal
65fc61a507 Remove unused code 2022-08-15 20:54:17 +05:30
Kovid Goyal
d027f524ce Make allow_remote_control a little more fine grained
Also, only respect listen_on if there is a possiblility of rc commands
over it being accepted
2022-08-15 20:51:11 +05:30
Kovid Goyal
df5e6e1563 simpler ignore pattern 2022-08-15 20:15:30 +05:30
Kovid Goyal
5541e3c2ff More robust cleaning of launcher dir 2022-08-14 23:39:26 +05:30
Kovid Goyal
57dfc379ae Fix cocoa being loaded before the fork on macOS 2022-08-14 22:17:27 +05:30
Kovid Goyal
b5467b8e26 Set the cocoa uncaught exception handler during glfw init not at module import time 2022-08-14 19:33:32 +05:30
Kovid Goyal
a9f1928913 ... 2022-08-14 19:16:47 +05:30
Kovid Goyal
ae16fed39b Fix repeated make app failing on macOS 2022-08-14 19:01:58 +05:30
Kovid Goyal
848a795d26 Fix minimal macos bundle build 2022-08-14 13:48:45 +05:30
Kovid Goyal
deb8c3dacd Dont put the launcher source files in the root directory 2022-08-14 13:01:29 +05:30
Kovid Goyal
3cb572b47a Fix build on older gcc 2022-08-14 10:12:17 +05:30
Kovid Goyal
df3846fbb8 Add instructions on how to install the man pages under desktop integration 2022-08-12 23:33:06 +05:30
Kovid Goyal
d73ceb26ae Use the RFC as the reference for base-85 encoding 2022-08-12 15:38:28 +05:30
Kovid Goyal
da9ffc9b93 Allow using IV and tags longer than the minimum lengths 2022-08-12 13:21:57 +05:30
Kovid Goyal
63fa0c4e94 Nicer fix for human_repr of keys defined with kitty_mod 2022-08-12 12:37:15 +05:30
Kovid Goyal
ce91b6d9d9 Switch to using the new SingleKey implementation 2022-08-12 12:21:06 +05:30
Kovid Goyal
c982f24faf Add some tests for hashing and __eq__ 2022-08-12 12:02:22 +05:30
Kovid Goyal
9f865adb83 DRYer 2022-08-12 11:39:26 +05:30
Kovid Goyal
b54dd1cb48 Increase the max key num that is storeable 2022-08-12 11:37:54 +05:30
Kovid Goyal
ef621aa099 DRYer
Also dont store negative values for key. Unset is 0 not -1
2022-08-12 11:35:45 +05:30
Kovid Goyal
df4738f080 ... 2022-08-12 11:24:18 +05:30
Kovid Goyal
8d0a06325c Update config types for new value of KITTY_MOD 2022-08-12 11:07:11 +05:30
Kovid Goyal
f3329fcd34 Fix storage for GLFW_MOD_KITTY 2022-08-12 09:58:50 +05:30
Kovid Goyal
af48547d8b Implement SingleKey._replace 2022-08-12 09:40:58 +05:30
Kovid Goyal
f228f8368a A faster version of SingleKey 2022-08-12 09:17:42 +05:30
Kovid Goyal
9bb2c1a27b Type objects should be static 2022-08-12 08:32:11 +05:30
Kovid Goyal
aa0b07a90d Fix #5371 2022-08-12 08:15:25 +05:30
Kovid Goyal
d4075bfa9a ... 2022-08-12 07:01:40 +05:30
Kovid Goyal
2b7455e353 Use kitty_mod in debug config output
Fixes #5367
2022-08-11 23:45:23 +05:30
Kovid Goyal
f42d2c63a6 Add type annotations to rc protocol field definitions 2022-08-11 22:14:33 +05:30
Kovid Goyal
6be3ae9efc Start work on standalone remote control script 2022-08-11 21:05:04 +05:30
Kovid Goyal
2fd2e07342 Fix #5366 2022-08-11 15:47:06 +05:30
Kovid Goyal
1e0e32e282 DRYer 2022-08-11 13:42:38 +05:30
Kovid Goyal
b2d8f24499 Clean up the text a bit 2022-08-11 07:47:15 +05:30
Kovid Goyal
12c99741a0 Add an example of restricting the launch command 2022-08-11 07:35:18 +05:30
Kovid Goyal
91dbcf4df0 Link to encryption spec 2022-08-11 07:29:56 +05:30
Kovid Goyal
6ebd82a84c Note which version remote_control_password was added 2022-08-11 06:52:37 +05:30
Kovid Goyal
c07178f43a Avoid transmitting the currently un-needed enc_proto 2022-08-11 06:48:35 +05:30
Kovid Goyal
78a5957863 Highlight the JSON blocks appropriately 2022-08-11 06:46:42 +05:30
Kovid Goyal
cd6882d21e ... 2022-08-11 06:40:44 +05:30
Kovid Goyal
926a2828ab 5 minutes does not actually prevent replay just minimise it 2022-08-11 06:38:59 +05:30
Kovid Goyal
daa7df96d1 ... 2022-08-11 06:38:04 +05:30
Kovid Goyal
84ca83ef69 Document the encryption used by remote_control_password 2022-08-11 06:35:25 +05:30
Kovid Goyal
ac9c85e783 Add a note about password auth over SSH 2022-08-11 06:08:28 +05:30
Kovid Goyal
331f6d4903 Document remote_control_password more thoroughly
Also ignore failures in custom auth functions
2022-08-11 05:58:02 +05:30
Kovid Goyal
2e422e5ba8 Use getpass() to read the password from STDIN when it is a tty 2022-08-11 05:20:05 +05:30
Kovid Goyal
20cffc728e Close tty_fd after dup2 2022-08-11 05:10:15 +05:30
Kovid Goyal
b06cbc9465 Use the OS secure random number generator rather than the OpenSSL one to generate IVs
The OpenSSL one is not fork safe, and in general I trust kernel CSRNG
more than OpenSSL
2022-08-11 05:07:38 +05:30
Kovid Goyal
1348327414 Pressing esc for the permission dialog should be same as reject this request 2022-08-10 20:36:15 +05:30
Kovid Goyal
cd3eeb7a95 Center choice message correctly when it is multi-line
Also fix button wrap calculation. It was not taking the borders into
account.
2022-08-10 20:34:25 +05:30
Kovid Goyal
7be6b28011 Preserve blanks lines and per line formatting in the ask kitten for the message with choices 2022-08-10 20:10:17 +05:30
Kovid Goyal
ef1bee0f48 Shorten text 2022-08-10 20:00:20 +05:30
Kovid Goyal
702da542dd Use a as the default accelerator rather than t 2022-08-10 19:11:18 +05:30
Kovid Goyal
5ba92d06cf Get async response working with sockets 2022-08-10 19:10:04 +05:30
Kovid Goyal
34a7b42063 Dont print traceback when socket is unexpectedly closed 2022-08-10 19:06:57 +05:30
Kovid Goyal
963d1b58f8 Better error message when socket is closed without response 2022-08-10 18:53:15 +05:30
Kovid Goyal
fe598bac8a Quote ^ as it is a special char in some shells 2022-08-10 17:39:05 +05:30
Kovid Goyal
45736d7f1d ... 2022-08-10 17:28:22 +05:30
Kovid Goyal
0fe4f5a686 Fix password based rc not working with generator responses 2022-08-10 17:24:10 +05:30
Kovid Goyal
e9ce5c02d0 Allow remote control commands to be interrupted by ctrl-c while waiting for a response 2022-08-10 17:00:04 +05:30
Kovid Goyal
5916d82580 Send disallowed responses when permission for rc is denied 2022-08-10 16:28:14 +05:30
Kovid Goyal
2c83b9902e Implement the permissions system for password based rc requests 2022-08-10 15:49:50 +05:30
Kovid Goyal
fe07825ad9 Work on new permissions framework for rc commands 2022-08-10 12:36:04 +05:30
Kovid Goyal
56e83d7d07 Write code to decrypt commands received in kitty 2022-08-10 12:36:04 +05:30
Kovid Goyal
c7e3c92a0a Allow listen_on to be used even without allow_remote_control
Since we intend to allow password based access, which works regardless
of the value of allow_remote_control
2022-08-10 12:36:04 +05:30
Kovid Goyal
1a643441f3 Make the kitty public key available as an env var to child processes 2022-08-10 12:36:04 +05:30
Kovid Goyal
2aee746da9 Write the code to encrypt rc messages to kitty 2022-08-10 12:36:04 +05:30
Kovid Goyal
e64b1ba67c Start work on remote control passwords 2022-08-10 12:36:04 +05:30
Kovid Goyal
31be4f041e remove unused code 2022-08-10 12:31:47 +05:30
Kovid Goyal
1f5ebc408d When searching macOS for openssl search for the same version as used by the python we are running 2022-08-10 12:30:36 +05:30
Kovid Goyal
b4d9a22df8 Install the same version of OpenSSL as used by python on brew based CI 2022-08-10 12:21:01 +05:30
Kovid Goyal
d4168e3b80 Dont add openssl to the brewfile
We only need to install it on CI because the python on CI doesnt come
from brew. Normal brewfile based installation will install openssl as a
dependency of python
2022-08-10 12:02:43 +05:30
Kovid Goyal
241c7af855 DRYer 2022-08-10 11:45:07 +05:30
Kovid Goyal
080fcd8fc1 Link against newer rather than older openssl 2022-08-10 11:36:56 +05:30
Kovid Goyal
1aad4c7ec3 Only search for brew openssl on failure 2022-08-10 11:35:43 +05:30
Kovid Goyal
e0e0582b53 Fix #5364
macOS is *the* worst UNIX I have ever seen.
2022-08-10 11:33:30 +05:30
Kovid Goyal
0a6276b007 Implement completion for kitty @ global options 2022-08-09 18:54:38 +05:30
Kovid Goyal
2a2256f7d9 ... 2022-08-09 16:11:23 +05:30
Kovid Goyal
ed81a60065 Add keywords completion for --cwd and --config 2022-08-09 16:07:04 +05:30
Kovid Goyal
5ad55dd165 Allow using file completion for any type of command line arg 2022-08-09 15:57:01 +05:30
Kovid Goyal
6860f7ffd6 fix zsh serialization of directory candidates ending with / 2022-08-09 14:51:14 +05:30
Kovid Goyal
33a3e3fb61 Add completion for kitty @ launch --logo 2022-08-09 14:30:13 +05:30
Kovid Goyal
d4df3f67b6 Allow specifying completion for command line arguments that expect paths 2022-08-09 14:21:12 +05:30
Kovid Goyal
f15a2f0c1f Change --session to resolve relative paths from the kitty config dir 2022-08-09 12:36:16 +05:30
Kovid Goyal
252288aff2 kitten completion: Fix --long-opt <TAB> not working 2022-08-09 12:02:25 +05:30
Kovid Goyal
65a20a2407 Merge branch 'show-key-kitten' of https://github.com/page-down/kitty 2022-08-09 11:32:10 +05:30
pagedown
5f180dbd9a ... 2022-08-09 12:29:22 +08:00
pagedown
ee4e9aa678 Add missing modifier key aliases 2022-08-09 12:15:55 +08:00
pagedown
9f1c9529aa Allow completion for show_key kitten
Use the lowercase form of kitty.
2022-08-09 12:15:48 +08:00
Kovid Goyal
5bba1a0851 get_current_selection should return char* not const char* 2022-08-09 09:05:13 +05:30
Kovid Goyal
e9823eb40c Cleanup previous PR 2022-08-09 08:54:47 +05:30
Kovid Goyal
14fc3f6ac4 Merge branch 'macos-accessibility' of https://github.com/page-down/kitty 2022-08-09 08:52:44 +05:30
pagedown
74714f942a Implement macOS accessibility protocol to provide selected text
Allow "Speak selection" (Option+Esc) to work properly.
2022-08-09 11:02:12 +08:00
pagedown
0d116e6ef0 Use four spaces to indent 2022-08-08 22:31:55 +05:30
pagedown
06108d66b1 Replace tab with four spaces indent 2022-08-08 22:31:55 +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
4dd696e4e0 Add API to glfw to get the currently active text selection 2022-08-08 15:52:34 +05:30
Kovid Goyal
d04d4444af implement primary selection api on cocoa as stubs, can be useful for #5357 2022-08-06 12:59:15 +05:30
Kovid Goyal
a487a78200 Add type definitions for the crypto data types 2022-08-05 14:39:20 +05:30
Kovid Goyal
f06a72b418 OpenSSL 3.0 apparently has API to get rid of the tag length magic number. Lets hope it works 2022-08-05 14:28:56 +05:30
Kovid Goyal
3270c9a527 Get rid of various magic length constants 2022-08-05 14:17:42 +05:30
Kovid Goyal
a7b7fb560a Add tests for AES256GCM 2022-08-05 13:50:03 +05:30
Kovid Goyal
384eba6cd4 Wrap the OpenSSL API for AES 256 GCM encryption 2022-08-05 13:14:25 +05:30
Kovid Goyal
dc7e3ba1ec DRYer 2022-08-05 08:57:22 +05:30
Kovid Goyal
b1e0adcfdc ... 2022-08-05 08:14:29 +05:30
Kovid Goyal
2a5922ce92 Cleanup previous PR
The reason maxsplit is 1 is because some layout action in the future may need more
sophisticated args processing, for example, shlex.split() instead of
plain split(), or even a full command line parser.
2022-08-05 08:12:05 +05:30
Kovid Goyal
93694925ce Merge branch 'feature/toggle_bias' of https://github.com/mong8se/kitty 2022-08-05 08:11:35 +05:30
Steven Moazami
adfcbb004f Add layout_action to change bias on tall layout
Can specify 1 bias to toggle between that and 50%.

Can specify multiple biases to rotate through them with each call to the
layout_action.

Left a comment regarding working around either a possible bug or a
design decision.
2022-08-04 19:29:17 -04:00
Kovid Goyal
6595898b73 Merge branch 'patch-4' of https://github.com/ctrlcctrlv/kitty 2022-08-04 20:45:29 +05:30
Fredrick Brennan
81b33f1f6f Document how to build docs 2022-08-04 11:12:04 -04:00
Kovid Goyal
a1c4ffec20 Private raw key should be returned as a secret 2022-08-04 20:27:38 +05:30
Kovid Goyal
89854cca8b Test for secret derivation 2022-08-04 20:05:19 +05:30
Kovid Goyal
4fe5211ed7 Code to derive the shared secret with elliptic curve keys 2022-08-04 19:42:38 +05:30
Kovid Goyal
795b32efd7 Bash integration: Fix the inherit_errexit option being set by shell integration
Fixes #5349
2022-08-04 16:23:52 +05:30
Kovid Goyal
153064ef3a Fail if mlock fails 2022-08-04 11:16:36 +05:30
Kovid Goyal
183a31c884 mlock() the returned private key to prevent it from being saved to swap 2022-08-04 11:08:54 +05:30
Kovid Goyal
adf47bed89 Use an actual type for the EC key rather than a capsule 2022-08-04 11:01:14 +05:30
Kovid Goyal
cc297a8984 Merge branch 'patch-1' of https://github.com/TomFaulkner/kitty 2022-08-04 07:39:38 +05:30
Tom Faulkner
4ef17edace Fix doc typo: throught to throughout
Just a typo in the docs. Kitty is great, thanks for all the hard work.
2022-08-03 23:52:00 +00:00
Kovid Goyal
e56fa9d31f Try and get Homebrew installed OpenSSL to work 2022-08-03 23:17:47 +05:30
Kovid Goyal
791d4b30fb We need openssl installed via brew 2022-08-03 22:47:11 +05:30
Kovid Goyal
a9a9f1ac00 Add a mappable action to toggle the mirrored setting for the tall and fat layouts
Fixes #5344
2022-08-03 22:45:38 +05:30
Kovid Goyal
fd6bc55db6 Start work on implementing public key crypto
Will come in handy for various things in the future, so lets just setup
the API now. No new dependencies are needed since Python already depends
on OpenSSL.
2022-08-03 22:37:35 +05:30
Kovid Goyal
97d7329d14 A nicer fix for kitty @ ls | less
We rely on the fact that cfmakeraw() and less's code to put the tty in
raw state diverge. This is obv a hack but then so is kitty @ ls | less

This hack allows

kitty +kitten clipboard --get-clipboard > output

to work.
2022-08-02 18:33:53 +05:30
Kovid Goyal
609d42e2bc Ignore EAGAIN when doing tty io 2022-08-02 17:21:28 +05:30
Kovid Goyal
3463931dad Rewrite clipboard kitten to only change termios settings while it is actually reading from terminal 2022-08-02 17:14:27 +05:30
Kovid Goyal
f637bf2377 socket prewarm: Dont control the tty if STDOUT is not a tty
This is because we could be being piped to a program like less that does
want to control the tty itself
2022-08-02 14:09:34 +05:30
Kovid Goyal
2271eb5e60 Document KITTY_PREWARM_SOCKET_REAL_TTY 2022-08-02 08:38:07 +05:30
Kovid Goyal
a5cbb552f0 Allow prewarming of kitty @ commands 2022-08-01 19:47:28 +05:30
Kovid Goyal
e43ca5b031 Add an implementation using splice() for in-kernel tty copies
Sadly splice is currently not functional in Linux, so the implementation
is turned off
2022-08-01 19:16:51 +05:30
Kovid Goyal
cc7e668ad6 Cleanup editing of proc environ 2022-08-01 19:03:03 +05:30
Kovid Goyal
a01dbbdf04 Fix launcher not building universal 2022-08-01 19:03:03 +05:30
Kovid Goyal
e0ce0a67cc ensure setting KITTY_PREWARM_SOCKET_REAL_TTY does not clobber the environ 2022-08-01 19:03:03 +05:30
Kovid Goyal
0d83a8866b Make setting the real tty name more robust 2022-08-01 19:03:03 +05:30
Kovid Goyal
f7a7e39a36 prewarm wrapper should indicate it is active via the process environment 2022-08-01 19:03:03 +05:30
Kovid Goyal
67cb466ea9 ... 2022-08-01 19:03:03 +05:30
Kovid Goyal
376688ab9f Add a test for SIGTSTP via ctrl-z 2022-08-01 19:03:03 +05:30
Kovid Goyal
8668087d15 flush data when exiting on signal as well
should make the signal tests less flaky
2022-08-01 19:03:03 +05:30
Kovid Goyal
9b1c23987c Fix stdout line_buffering incorrect when parent kitty instance has its stdout redirected to a file 2022-08-01 19:03:03 +05:30
Kovid Goyal
784daa1a4b Update changelog for socket prewarm 2022-08-01 19:03:03 +05:30
Kovid Goyal
06f9b73a7b Workaround mypy bug 2022-08-01 19:03:03 +05:30
Kovid Goyal
62c0272df2 Get test.py working when prewarm socket is in operation 2022-08-01 19:03:03 +05:30
Kovid Goyal
7ce2b4c641 Indicate in kitty_run_data we are prewarmed 2022-08-01 19:03:03 +05:30
Kovid Goyal
08c2de541f Nicer establish_controlling_tty 2022-08-01 19:03:03 +05:30
Kovid Goyal
94551623ec Make JSON reading test a bit more robust 2022-08-01 19:03:02 +05:30
Kovid Goyal
cb0d23bae8 Use sub tests for the various prewarm things 2022-08-01 19:03:02 +05:30
Kovid Goyal
cb5157f2d1 Nicer implementation of eintr_retry that does not prevent type checking of wrapped functions arguments 2022-08-01 19:03:02 +05:30
Kovid Goyal
32dcbbb5e1 ... 2022-08-01 19:03:02 +05:30
Kovid Goyal
4eedf0d36c macOS needs SIGTTOU SIGTTIN explicitly ignored to allow the supervisor to use TIOCSWINSZ 2022-08-01 19:03:02 +05:30
Kovid Goyal
be458303c5 Debounce WINSZ events 2022-08-01 19:03:02 +05:30
Kovid Goyal
78542ede14 Separate test for SIGWINCH handling 2022-08-01 19:03:02 +05:30
Kovid Goyal
df8800b7ff tcsetpgrp can raise EINTR despite python claiming to auto retry 2022-08-01 19:03:02 +05:30
Kovid Goyal
9c30cd8891 Use a process supervisor for socket workers
This simplifies the code and also allows SIGTSTP to work as the worker
process is no longer in an orphaned process group.
2022-08-01 19:03:02 +05:30
Kovid Goyal
dda28efd66 Use the same signal to stop as stopped the child 2022-08-01 19:03:02 +05:30
Kovid Goyal
b78183972c Report child stop to wrapper process 2022-08-01 19:03:02 +05:30
Kovid Goyal
fc06196a3e Restore termios state when stopping 2022-08-01 19:03:02 +05:30
Kovid Goyal
2a1809a2d8 When exiting with a signal run cleanup 2022-08-01 19:03:02 +05:30
Kovid Goyal
ac5c312267 Work on handling child stop events 2022-08-01 19:03:02 +05:30
Kovid Goyal
8f3174038b Fix running of test suite inside kitty 2022-08-01 19:03:02 +05:30
Kovid Goyal
2d8113e0e0 Give up on signal delivery tests 2022-08-01 19:03:02 +05:30
Kovid Goyal
e881850bb4 ... 2022-08-01 19:03:02 +05:30
Kovid Goyal
4cbae1db89 ... 2022-08-01 19:03:02 +05:30
Kovid Goyal
97bce7be18 and again 2022-08-01 19:03:01 +05:30
Kovid Goyal
5d2a276172 ... 2022-08-01 19:03:01 +05:30
Kovid Goyal
762dfe8315 increase timeout since signal delivery on CI is flakey 2022-08-01 19:03:01 +05:30
Kovid Goyal
1c0d1ec8a9 wait for child events explicitly 2022-08-01 19:03:01 +05:30
Kovid Goyal
e650699217 py3.8 compat 2022-08-01 19:03:01 +05:30
Kovid Goyal
5ff2b5be1c Clear out any signals before ending test 2022-08-01 19:03:01 +05:30
Kovid Goyal
f1841d7c81 DRYer 2022-08-01 19:03:01 +05:30
Kovid Goyal
fd6231a778 Fix signal reading in prewarm wrapper 2022-08-01 19:03:01 +05:30
Kovid Goyal
751a52153d Restore python signal handlers properly after the test 2022-08-01 19:03:01 +05:30
Kovid Goyal
61b733bae9 Add a test for SIGCHLD on SIGTSTP 2022-08-01 19:03:01 +05:30
Kovid Goyal
624e96df9b wrapper process should exit with signal if prewarmed worker exits with signal 2022-08-01 19:03:01 +05:30
Kovid Goyal
a3f1a44d83 OK I give up I cant get signal delivery to work reliably 2022-08-01 19:03:01 +05:30
Kovid Goyal
ed1547938e When running tests ensure the signal mask is empty for processes run in the testing pty 2022-08-01 19:03:01 +05:30
Kovid Goyal
f96a13e9e4 mask handled signals when running signal handler 2022-08-01 19:03:01 +05:30
Kovid Goyal
7b70ed96b6 DRYer 2022-08-01 19:03:01 +05:30
Kovid Goyal
9379853d47 Get the SIGINT test working on macOS 2022-08-01 19:03:01 +05:30
Kovid Goyal
6ccfebd9e3 ... 2022-08-01 19:03:01 +05:30
Kovid Goyal
45186a17ca macOS doesnt allow TIOCSWINSZ from any process other than the process connected to the terminal or its parent
So send it over the socket to the zygote and have it resize the
terminal. Sigh.
2022-08-01 19:03:00 +05:30
Kovid Goyal
24bb4585af Allow easily skipping tests when updating on ox 2022-08-01 19:03:00 +05:30
Kovid Goyal
feb96f1be8 Use O_CLOEXEC for temp ctty fds 2022-08-01 19:03:00 +05:30
Kovid Goyal
b7d3d64975 Ignore error condition on master fd of testing pty 2022-08-01 19:03:00 +05:30
Kovid Goyal
6114b49630 Ensure pty is in utf8 2022-08-01 19:03:00 +05:30
Kovid Goyal
87d95caae0 Dont bother sending slave fd over the socket as it doesnt help on macOS anyway 2022-08-01 19:03:00 +05:30
Kovid Goyal
9535bc94ff Use both open and the ioctl to set the controlling terminal 2022-08-01 19:03:00 +05:30
Kovid Goyal
0841be7803 Test sigwinch handling 2022-08-01 19:03:00 +05:30
Kovid Goyal
6cec89181b dont abort when failing to write to a tty 2022-08-01 19:03:00 +05:30
Kovid Goyal
cb78e17594 dont break when socket is pre-closed 2022-08-01 19:03:00 +05:30
Kovid Goyal
285c399ae5 ... 2022-08-01 19:03:00 +05:30
Kovid Goyal
c9b14f6f78 Switch to using select() instead of poll() in prewarm wrapper
This is because poll() is broken on macOS with pty fds
2022-08-01 19:03:00 +05:30
Kovid Goyal
6a101c51d2 Close tty_fd in master on fork() rather than on close() 2022-08-01 19:03:00 +05:30
Kovid Goyal
8998970adc Make the socket prewarm test a bit more robust 2022-08-01 19:03:00 +05:30
Kovid Goyal
991fbacb99 Fix ttyfd passing 2022-08-01 19:03:00 +05:30
Kovid Goyal
72f3e8cd40 Avoid passing around pty paths, instead send the pty fd 2022-08-01 19:03:00 +05:30
Kovid Goyal
cf8113ea24 Even more flexible management of poll data 2022-08-01 19:03:00 +05:30
Kovid Goyal
5d1cf49fb6 Only set control msg metadata when actually sending a control msg 2022-08-01 19:03:00 +05:30
Kovid Goyal
90f3c0f9af Workaround macOS weirdness 2022-08-01 19:02:59 +05:30
Kovid Goyal
d02598688a Show full traceback for failures to fork socket child 2022-08-01 19:02:59 +05:30
Kovid Goyal
1991f1ccd7 Better handling of multiple optional to poll fds 2022-08-01 19:02:59 +05:30
Kovid Goyal
8fad8972d5 ... 2022-08-01 19:02:59 +05:30
Kovid Goyal
fc3e78e226 Also handle SIGQUIT 2022-08-01 19:02:59 +05:30
Kovid Goyal
15aace29a1 Restore python signal handlers in forked workers 2022-08-01 19:02:59 +05:30
Kovid Goyal
12a3a2d7fe Only set switch interval after prewarm fork 2022-08-01 19:02:59 +05:30
Kovid Goyal
7e26a340a3 Try to read from child pty even after zygote signals its death 2022-08-01 19:02:59 +05:30
Kovid Goyal
f0764c24d2 Retry read/write while there is space 2022-08-01 19:02:59 +05:30
Kovid Goyal
d080bf3b9c Forward termination signals 2022-08-01 19:02:59 +05:30
Kovid Goyal
51698dff07 ... 2022-08-01 19:02:59 +05:30
Kovid Goyal
4154926be7 Get the test to pass on macOS 2022-08-01 19:02:59 +05:30
Kovid Goyal
806ca2b224 Fix atexit handlers being called in forked children
In particular the atexit handler for random_unix_socket()
2022-08-01 19:02:59 +05:30
Kovid Goyal
92bbf08343 Fix socket connect call on non-linux 2022-08-01 19:02:59 +05:30
Kovid Goyal
dc84e3de67 Do not hang forever waiting for child death 2022-08-01 19:02:59 +05:30
Kovid Goyal
8011801549 re-init openssl PRNG when forking for prewarm 2022-08-01 19:02:59 +05:30
Kovid Goyal
dfec88ed15 Inherit full outside env 2022-08-01 19:02:59 +05:30
Kovid Goyal
5d3e2c7111 ... 2022-08-01 19:02:58 +05:30
Kovid Goyal
af1c48e0f7 Dont rely on having source of test modules available 2022-08-01 19:02:58 +05:30
Kovid Goyal
d4bc906c5c Fix launcher build with sanitize 2022-08-01 19:02:58 +05:30
Kovid Goyal
62fe467336 ... 2022-08-01 19:02:58 +05:30
Kovid Goyal
ef3e9d1c2e make various compilers happy 2022-08-01 19:02:58 +05:30
Kovid Goyal
09ddbbf600 Finish move of prewarm launcher into its own compilation unit 2022-08-01 19:02:58 +05:30
Kovid Goyal
4195c239c8 Start moving prewarm launcher into its own compilation unit 2022-08-01 19:02:58 +05:30
Kovid Goyal
a6c3c57d40 Test stdio redirection with socket prewarm 2022-08-01 19:02:58 +05:30
Kovid Goyal
de9263a117 Verify uid/gid of connection from a prewarm client 2022-08-01 19:02:58 +05:30
Kovid Goyal
7b7f1ecc54 Add basic tests for socket prewarm 2022-08-01 19:02:58 +05:30
Kovid Goyal
d1b028c27a Dont pass inherited KITTY_PREWARM_SOCKET 2022-08-01 19:02:58 +05:30
Kovid Goyal
055aae2382 Use correct exit codes for signals 2022-08-01 19:02:58 +05:30
Kovid Goyal
dbb084da7a Cleanup closing of socket child 2022-08-01 19:02:58 +05:30
Kovid Goyal
8332cd2f79 Avoid needing to call os.getpid() repeatedly 2022-08-01 19:02:58 +05:30
Kovid Goyal
4e29c0c16b Propagate SIGWINCH 2022-08-01 19:02:58 +05:30
Kovid Goyal
320d45a3f5 Only use prewarm socket if uid and gid match 2022-08-01 19:02:58 +05:30
Kovid Goyal
73795b5257 detect when socket child closes its tty 2022-08-01 19:02:58 +05:30
Kovid Goyal
16e59784c6 handle failures to send data over socket gracefully 2022-08-01 19:02:58 +05:30
Kovid Goyal
65a7ec3f85 move socket launch handling into its own function 2022-08-01 19:02:57 +05:30
Kovid Goyal
360ff35061 Better error logging from prewarm zygote 2022-08-01 19:02:57 +05:30
Kovid Goyal
5098792723 Make the tty pipes non-blocking 2022-08-01 19:02:57 +05:30
Kovid Goyal
a4883e6d41 Transfer data between ttys 2022-08-01 19:02:57 +05:30
Kovid Goyal
44c9d66dd4 Use a map for pid -> socketchild 2022-08-01 19:02:57 +05:30
Kovid Goyal
c7718d078c Fix parsing of child pid and exit code 2022-08-01 19:02:57 +05:30
Kovid Goyal
2525994db4 ... 2022-08-01 19:02:57 +05:30
Kovid Goyal
81e6afa9b3 Cleanup fd transmit 2022-08-01 19:02:57 +05:30
Kovid Goyal
d8f5ccf9e4 Make master tty raw and print error messages with more context 2022-08-01 19:02:57 +05:30
Kovid Goyal
774489c578 ... 2022-08-01 19:02:57 +05:30
Kovid Goyal
39bb0ecfcf more work on socket based prewarm 2022-08-01 19:02:57 +05:30
Kovid Goyal
b222ab1bf6 Start work on socket based prewarm 2022-08-01 19:02:57 +05:30
Kovid Goyal
7a31c7ff50 Start work on everywhere prewarm 2022-08-01 19:02:57 +05:30
Kovid Goyal
132f87d152 show_key: use a better representation of the space key when 2022-08-01 13:25:56 +05:30
Kovid Goyal
aedda4bf9b ... 2022-07-31 10:36:03 +05:30
Kovid Goyal
40bba70bfe Wayland IME: Avoid printing errors for compositors that pointlessly acknowledge previous IME commits rather than just the current one. Apparently kwin is one such. Fixes #5339 2022-07-31 10:22:40 +05:30
Kovid Goyal
8202247b27 DRYer 2022-07-29 12:51:36 +05:30
Kovid Goyal
e2117ee8a4 ssh kitten: Allow completion of ssh options between the destination and command
This contravenes the documented command line parsing behavior of ssh but
matches its actual implementation. Sigh.

Fixes #5322
2022-07-29 08:29:49 +05:30
Kovid Goyal
e3a4150fea Second draw attempt has single fade edge 2022-07-29 08:15:38 +05:30
Kovid Goyal
0ce2a23af3 Allow tab title templates to use the current max title length 2022-07-29 07:43:55 +05:30
Kovid Goyal
6b2337c9c0 Merge branch 'master' of https://github.com/newbee1905/kitty-1 2022-07-26 20:27:59 +05:30
newbee1905
54661b7fc4 reflector: replace unecessary while loop 2022-07-26 21:47:52 +07:00
Kovid Goyal
a1f895b781 Merge branch 'master' of https://github.com/nullchilly/kitty 2022-07-26 19:10:34 +05:30
nullchilly
199c271edc Fix modify_font underline_position 1 2022-07-26 20:08:04 +07:00
Kovid Goyal
9ac744ae63 DRYer 2022-07-26 16:10:43 +05:30
Kovid Goyal
93b05bcd1e Make the calculation of the bound for underline_position more precise
Fixes #5308
2022-07-26 16:07:01 +05:30
Kovid Goyal
546cdbefae Don't expose all Tab methods in title template
They can have side effects so prevent user from foot shot
2022-07-26 13:13:00 +05:30
Kovid Goyal
352c07987b Nicer fix for showing cwd in tab titles 2022-07-26 12:35:07 +05:30
Kovid Goyal
f6a1eb19d7 Only import ReferenceType when type checking 2022-07-26 11:06:19 +05:30
Kovid Goyal
a352804c14 Merge branch 'misc' of https://github.com/page-down/kitty 2022-07-26 11:04:01 +05:30
pagedown
28ae8c4d20 Expand ~ when resolving editor path and applying exe_search_path 2022-07-26 13:21:50 +08:00
pagedown
1eef584382 Replace tr with string built-in in fish integration 2022-07-26 13:21:36 +08:00
pagedown
4e1cd0590b Use builtin to call read in zsh integration and bash integration 2022-07-26 13:20:50 +08:00
pagedown
fa670e1f5d ... 2022-07-26 13:20:41 +08:00
Kovid Goyal
c7fa6f620a py3.8 compat 2022-07-26 08:39:33 +05:30
Kovid Goyal
04690c8c7c Dont incur the cost of checking the cwd of a process on every tabbar update unless actually needed 2022-07-26 08:19:14 +05:30
Kovid Goyal
4345ea6602 Remove debugging code I left in the last commit accidentally 2022-07-26 08:17:44 +05:30
Kovid Goyal
d39c212336 Merge branch 'add-cwd-TabBarData' of https://github.com/nxvxl/kitty 2022-07-26 08:08:14 +05:30
Kovid Goyal
54d2f06abe remote files kitten: Fix working with files whose names have characters that need to be quoted in shell scripts
Fixes #5313
2022-07-26 08:06:25 +05:30
noval
237bfc9a6e add cwd to TabBarData
this option add current working directory to the tab by using active windows child directory.
2022-07-26 09:33:55 +07:00
Kovid Goyal
29b3d49cd5 Note that the crossterm library has added support for the kitty keyboard protocol 2022-07-26 07:45:57 +05:30
Kovid Goyal
fe8892ec54 Update changelog for previous PR 2022-07-21 20:03:46 +05:30
Kovid Goyal
2d8dd7a53e Merge branch 'rc-scroll-window' of https://github.com/page-down/kitty 2022-07-21 20:03:05 +05:30
pagedown
b493599690 Remote control: Allow half-scrolling when scrolling window by page 2022-07-21 21:05:56 +08:00
Kovid Goyal
d9371dc265 ssh kitten: Better handling of exit on keyboard interrupt 2022-07-20 21:40:51 +05:30
Kovid Goyal
ef2a12fbdf Ignore sigint while draining the tty 2022-07-20 19:40:23 +05:30
Kovid Goyal
7215c6d6be ssh kitten: Allow pressing Ctrl-C to abort ssh before the connection is completed
Fixing this involved adding a new mode to kitty where it handles
ctrl-c/z/q by sending signals to the tty foreground process group
instead of delegating to the kernel to do that. Since the pipe may be
full we have no way of knowing when the kernel will get around to
reading the signal byte. So send the signal ourselves.

Fixes #5271
2022-07-20 19:11:14 +05:30
Kovid Goyal
bd9e1f58fe ssh kitten: Make discarding of garbage data after ssh fails more robust
We now roundtrip an UUID via the terminal and only exit after receiving
it back. This guarantees that any pending data in the pipe is discarded.
2022-07-20 13:28:51 +05:30
Kovid Goyal
79dec269e1 ... 2022-07-16 10:25:18 +05:30
Kovid Goyal
d6ffbf4f3c Rebuild before and after publishing if a branch change was needed
Sometimes branches break things
2022-07-16 10:18:05 +05:30
Kovid Goyal
32588939ae Deprecate the adjust_baseline adjust_line_height and adjust_column_width options in favor of modify_font
Unifies handling and allow using pt units for those adjustments.
Note that the behavior of percentage sizes for adjust baseline is
backwards incompatible. It now uses the baseline value as the base
rather than the cell height.
2022-07-15 15:29:42 +05:30
Kovid Goyal
a02e07bfe8 Add modify_fonts to the changelog
Fixes #5265
2022-07-15 12:29:08 +05:30
Kovid Goyal
03df0c3cca Actually implement modify_font 2022-07-15 12:27:42 +05:30
Kovid Goyal
1aa50b73a1 Allow pixel based adjustments as well 2022-07-15 11:45:43 +05:30
Kovid Goyal
c910f483bf Improve formatting of config diff for modify_font 2022-07-15 11:15:57 +05:30
Kovid Goyal
14f4a8d28e Make modify_font available to C code 2022-07-15 11:06:24 +05:30
Kovid Goyal
ee931a17b0 Start work on option to modify font characteristics
Implement parsing of the option
2022-07-15 08:54:53 +05:30
Kovid Goyal
0a2ba3fb66 Merge branch 'fix-macos-launch' of https://github.com/page-down/kitty 2022-07-14 16:45:08 +05:30
pagedown
512db660a1 macOS: Fix unable to open new tab/window when there is no OS window 2022-07-14 18:25:00 +08:00
Kovid Goyal
b0666c9180 test.py now needs kitty built 2022-07-13 20:00:54 +05:30
Kovid Goyal
57d3d09679 DRYer 2022-07-13 19:49:40 +05:30
Kovid Goyal
3a17f54bca Add a note about how to exclude directories in the copy command 2022-07-12 16:23:48 +05:30
Kovid Goyal
4c2800b294 mask handled signals when running the signal handler 2022-07-10 12:52:51 +05:30
Kovid Goyal
8358377ec3 Fix reading multiple signals from buffer on macOS 2022-07-10 12:07:54 +05:30
Kovid Goyal
3ab12c616c Merge branch 'patch-1' of https://github.com/kidonng/kitty 2022-07-09 14:45:48 +05:30
Kid
ef4e784121 Fix link formatting in docs 2022-07-09 16:00:51 +08:00
Kovid Goyal
1ead20a5b9 Add a GitHub icon to the docs footer 2022-07-08 20:36:32 +05:30
Kovid Goyal
31dfee8a95 Nicer error message for zsh versions before 5.1 2022-07-08 20:28:42 +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
7281b9dbb1 Ensure local kitty is used when running the tests 2022-07-05 21:09:09 +05:30
Kovid Goyal
4b63ee036e Run the test suite using the kitty binary 2022-07-05 21:05:03 +05:30
Kovid Goyal
fb8eb69c20 ... 2022-07-03 20:51:59 +05:30
Kovid Goyal
4b1fa2609d Match behavior of who when getting num_users by ignoring zombie pids 2022-07-03 14:46:54 +05:30
Kovid Goyal
a8b756f040 ssh kitten: A new option :code:--symlink-strategy to control how symlinks are copied to the remote machine
Fixes #5249
2022-07-03 14:03:56 +05:30
Kovid Goyal
a94a0f3026 Fix fd leak in prewarm zygote 2022-07-03 13:32:09 +05:30
Kovid Goyal
71c902eaf8 Build the launcher with debug symbols when using --debug 2022-07-03 13:28:57 +05:30
Kovid Goyal
6e7af8ce2e Merge branch 'fix-last-cmd-output' of https://github.com/page-down/kitty 2022-07-02 10:18:16 +05:30
pagedown
6c80cd040c Fix missing last line when getting output of the running command 2022-07-02 12:33:58 +08:00
Kovid Goyal
4ed413eaa7 Switch to GA2 2022-06-30 17:00:14 +05:30
Kovid Goyal
86357d2c38 ... 2022-06-29 18:53:11 +05:30
Kovid Goyal
c0d4d01b88 ... 2022-06-29 18:41:39 +05:30
Kovid Goyal
b3fcb53625 ssh kitten: Allow ssh kitten to work from inside tmux, provided the tmux session inherits the correct KITTY env vars
Fixes #5227
2022-06-29 18:40:22 +05:30
Kovid Goyal
4f29dea8ef Utility function to detect when running inside tmux 2022-06-29 17:51:38 +05:30
Kovid Goyal
4f8ef05058 Linux: Update cursor position after all key presses not just pre-edit text changes
Fixes #5241
2022-06-29 11:37:35 +05:30
Kovid Goyal
7fc1735a21 swaps_disallowed is used only on wayland 2022-06-28 20:19:52 +05:30
Kovid Goyal
1e49038747 Fix edit-in-kitty not working with editors that use file replace to save changes 2022-06-28 11:51:03 +05:30
Kovid Goyal
295fbe42ad Merge branch 'misc' of https://github.com/page-down/kitty 2022-06-28 11:42:37 +05:30
Kovid Goyal
60d33f2847 Wayland: Reduce flicker at startup by not using render frames immediately after a resize
Fixes #5235
2022-06-28 11:29:57 +05:30
Kovid Goyal
cd369f633a Wayland: Ensure that opengl buffer swapping does not happen till the xdg surface is configured 2022-06-28 10:47:33 +05:30
pagedown
c3df6d2fe3 Remove executable perms from kitten files 2022-06-28 11:59:47 +08:00
Kovid Goyal
72dfa74b3e Avoid an extra buffer swap during startup
glfw should not be swapping buffers behind the clients back. Since we
control the client, we can ensure that the OpenGL VRAM is cleared before
the window is shown.

Also fixes the issue with the glfw wayland backend where the buffer was
being created before the surface was configured
2022-06-28 09:25:24 +05:30
pagedown
1411269187 Docs: Improve documentation for remote commands
Use text roles in the document to apply the style in the cli output.
Add more links.
Unify the text roles.
Use code blocks instead of quote blocks.
Use '+' to connect the shortcut key names.
2022-06-28 11:52:20 +08:00
pagedown
185d959f25 ssh kitten: Add MacPorts paths to the common locations for login shell 2022-06-28 11:43:19 +08:00
pagedown
1652d41992 Fix edit-in-kitty not working when option editor comes with arguments 2022-06-28 11:41:27 +08:00
pagedown
297dea881d Use the same fish completion function for commands 2022-06-28 11:35:11 +08:00
pagedown
01df828353 Refactor the fish implementation of edit-in-kitty
Clean up global variable and signal handling function before exit.
For commands allowing the use of valid functions or binary executables.
2022-06-28 11:31:42 +08:00
pagedown
617115d447 Docs: edit-in-kitty works with neovim 2022-06-28 11:22:52 +08:00
Kovid Goyal
31f9978599 Merge branch 'patch-1' of https://github.com/AnonymouX47/kitty 2022-06-27 15:54:23 +05:30
My Avatar ;D
dc068c16e8 Update projects using kitty graphics protocol
Add `term-image` to the list of projects using the kitty graphics protocol.
2022-06-27 10:35:39 +01:00
Kovid Goyal
89626a462f ... 2022-06-25 20:46:02 +05:30
Kovid Goyal
a043588b4a Update changelog for last PR 2022-06-25 16:50:46 +05:30
Kovid Goyal
2e08ee16c2 Merge branch 'fix-macos-jis-kbd' of https://github.com/page-down/kitty
Fixes #5232
2022-06-25 16:49:46 +05:30
pagedown
2cc506476b macOS: Fix JIS Eisu and Kana keys not working 2022-06-25 19:01:02 +08:00
Kovid Goyal
0a462ad706 Forgot one place to change over to kitty_run_data 2022-06-24 10:31:55 +05:30
Kovid Goyal
81c1bfe1c5 ... 2022-06-24 09:26:38 +05:30
Kovid Goyal
8ce80e39d9 kitty now needs python >= 3.8 2022-06-24 00:01:35 +05:30
Kovid Goyal
fa823a37ae Backport 6281f498c8 2022-06-23 13:00:28 +05:30
Kovid Goyal
17f67fbe28 Add a note that WezTerm implements the kitty keyboard protocol as well 2022-06-23 11:22:01 +05:30
Kovid Goyal
560b78bc35 Dont leak kitty_run_data on error 2022-06-23 08:59:31 +05:30
Kovid Goyal
f023f047ff Workaround for Python 3.11 breaking sys._xoptions
Apparently in Python-land its acceptable behavior to break backward
compatibility with documented interfaces on a whim. Bloody joke.
https://github.com/python/cpython/pull/28823

Fixes #5223
2022-06-23 08:44:34 +05:30
Kovid Goyal
5673359be2 Merge branch 'sam/modern-whiskers-icon' of https://github.com/samholmes/kitty 2022-06-22 04:11:41 +05:30
Samuel Holmes
666696d142 Add "modern whiskers" alternative icon to FAQ 2022-06-21 11:04:24 -07:00
Kovid Goyal
f95bc48f9b kitty @ set-colors: Fix changing inactive_tab_foreground not working
Fixes #5214
2022-06-19 20:20:58 +05:30
Kovid Goyal
8d18fc09fa Merge branch 'fix-rc-new-window' of https://github.com/page-down/kitty 2022-06-19 18:21:22 +05:30
Kovid Goyal
a3d42a90f2 Get rid of os.waitid() since its not present on macOS we cannot rely on it anyway 2022-06-19 18:11:23 +05:30
pagedown
1da5f2ecc6 Fix the rc command new-window does not open the shell by default 2022-06-19 20:25:12 +08:00
Kovid Goyal
d226e82f68 It is only possible to not have an OS Window on macOS 2022-06-19 09:39:40 +05:30
Kovid Goyal
60cc2cb26c Merge branch 'fix-rc-launch' of https://github.com/page-down/kitty 2022-06-19 09:38:30 +05:30
pagedown
1ac90cf464 Allow remote control to launch a new OS window when there is none 2022-06-19 11:51:58 +08:00
Kovid Goyal
d3ffaebd17 Ignore exceptions in kitten result processors 2022-06-18 08:20:01 +05:30
Kovid Goyal
bf01c549f5 Allow kittens to handle multiple results in a window 2022-06-18 08:18:25 +05:30
Kovid Goyal
6912d8c086 No need for entire screen object when scaling a scroll 2022-06-18 06:55:28 +05:30
Kovid Goyal
a89e1b5573 Fix horizontal wheel events not being reported to client programs when they grab the mouse
Fixes #2819
2022-06-18 06:47:42 +05:30
Kovid Goyal
3a9c6088b2 Add debug output for scroll events 2022-06-18 05:54:26 +05:30
Kovid Goyal
fba629f385 Merge branch 'globinclude-sorted' of https://github.com/amarshall/kitty 2022-06-18 04:59:25 +05:30
Andrew Marshall
90477825c2 Make globinclude sort files before loading
`Path.glob` gives no guarantee about the order results are returned in.
This means that if files included by `globinclude` override each other,
the resulting config was non-deterministic. Resolve this by sorting the
results from `glob` to give consistent, well-defined order.
2022-06-17 18:50:16 -04:00
Kovid Goyal
1e56d39777 Wakeup main loop when refreshing window as well as io loop 2022-06-17 19:33:43 +05:30
Kovid Goyal
2829971412 Merge branch 'expose-wakeup-main-loop' of https://github.com/sirno/kitty 2022-06-17 19:09:07 +05:30
Nicolas Ochsner
c147fda6ca Expose wakeup main loop in python api. 2022-06-17 15:26:16 +02:00
Kovid Goyal
a27dfd8b7c Increase the timeout for prewarm I/O on CI 2022-06-14 21:17:28 +05:30
Kovid Goyal
a7c65efc45 Ensure local kitty is used in tests even when another kitty is present in the system PATH
Fixes #5194
2022-06-14 21:08:58 +05:30
Kovid Goyal
646a524c8e Sort imports 2022-06-14 20:06:12 +05:30
Kovid Goyal
f8d01d2c4f Use the same parser for resize_window actions and session setting 2022-06-14 20:03:21 +05:30
Kovid Goyal
1d846f3744 Cleanup previous PR
Merge branch 'session-resize-window' of https://github.com/sirno/kitty
2022-06-14 19:59:01 +05:30
Nicolas Ochsner
6bbe58f876 Change to pass window specs. 2022-06-14 12:28:41 +02:00
Nicolas Ochsner
36719fb086 Cleanup. 2022-06-14 11:23:35 +02:00
Nicolas Ochsner
78fd7a8458 Enable resizing in session files. 2022-06-14 11:09:26 +02:00
Kovid Goyal
f5976d0d63 Remove unneeded code 2022-06-13 21:33:07 +05:30
Kovid Goyal
b313fc3fbe Forgot to also add SIGUSR1 handler 2022-06-13 21:09:32 +05:30
Kovid Goyal
cf667b8c47 Use a signal handler instead of a pipe for child death notification 2022-06-13 20:40:04 +05:30
Kovid Goyal
7e3bd8586f Dont use SIGTSTP and SIGCONT in the test as they are very flaky 2022-06-13 20:29:58 +05:30
Kovid Goyal
d5df301317 Finer grained polling 2022-06-13 19:41:40 +05:30
Kovid Goyal
628246c3da Workaround for python 3.8 that doesnt have the CLD_* constants 2022-06-13 19:22:37 +05:30
Kovid Goyal
d228acd30a Use a busy loop for signaled process 2022-06-13 19:11:29 +05:30
Kovid Goyal
18cd97d914 Skip SIGSTSTP test when CLD_STOPPED is not available 2022-06-13 19:05:49 +05:30
Kovid Goyal
5f13946bac Allow using our signal handlers in python event loops via an fd
pythons signal fd only return signal numbers not the full siginfo struct
2022-06-13 18:52:23 +05:30
Kovid Goyal
8fb24fbc1e poll() takes times in ms not seconds 2022-06-13 18:51:35 +05:30
Kovid Goyal
f0d4952055 Use an iterator 2022-06-13 08:14:51 +05:30
Kovid Goyal
7113580db2 macOS has no waitid
Le Sigh
2022-06-13 02:19:51 +05:30
Kovid Goyal
163c211219 Use waitid() rather than waitpid() to get full exit status 2022-06-13 00:19:56 +05:30
Kovid Goyal
6993157b3a ... 2022-06-13 00:15:07 +05:30
Kovid Goyal
e2efdf674d Reap prewarmed processes 2022-06-13 00:11:16 +05:30
Kovid Goyal
9fcb8e5b6e Close unneeded fds in forked children 2022-06-12 20:26:20 +05:30
Kovid Goyal
a1a637c7f1 Restore SIGUSR1 handling in prewarmed child 2022-06-12 18:59:55 +05:30
Kovid Goyal
4f87f3e9f4 ... 2022-06-12 18:15:23 +05:30
Kovid Goyal
da6faa656c Use a fork() without exec() to create prewarm process
This has the advantages:

1) Even first kitten use is fast
2) Computer has to do less work overall since prewarm process is itself prewarmed
2022-06-12 18:06:51 +05:30
Kovid Goyal
e1ad75e932 Graphics protocol: Make it explicit what is supposed to happen when two images with the same z-index overlap
Fixes #5187
2022-06-10 22:10:11 +05:30
Kovid Goyal
646bdbd002 Wayland: Fix a regression in the previous release that caused mouse cursor animation and keyboard repeat to stop working when switching seats
Fixes #5188
2022-06-10 21:38:30 +05:30
Kovid Goyal
9184de1997 ... 2022-06-10 18:44:23 +05:30
Kovid Goyal
eabc29ec4d Changelog entry for prewarming 2022-06-09 10:43:00 +05:30
Kovid Goyal
e338cdab31 Increase the timeout when talking to prewarm process 2022-06-09 07:01:42 +05:30
Kovid Goyal
7001d609fa Fix spurious warning from runpy module when prewarmed 2022-06-09 07:01:42 +05:30
Kovid Goyal
c8399ce3d2 clear signal handlers in prewarm controller 2022-06-09 07:01:42 +05:30
Kovid Goyal
3e1d701dce DRYer 2022-06-09 07:01:41 +05:30
Kovid Goyal
a385c39c2e Fix reading of dead prewarmed child pids 2022-06-09 07:01:41 +05:30
Kovid Goyal
5d1cf339a7 Simplify child death tracking
Re-use the existing fd instead of catching signals
2022-06-09 07:01:41 +05:30
Kovid Goyal
fafb8518e0 Fix compilation on platforms without SO_PASSCRED 2022-06-09 07:01:41 +05:30
Kovid Goyal
6807f4d4ea Report the correct cmdline for prewarmed processes 2022-06-09 07:01:41 +05:30
Kovid Goyal
0ed7b2f3c0 Manage fd lifecycles a bit better 2022-06-09 07:01:41 +05:30
Kovid Goyal
116128ebb5 Get prewarm working
Needed to wait in the control process for child to set its controlling
terminal so that closing the slave fd in kitty is safe.
2022-06-09 07:01:41 +05:30
Kovid Goyal
0c870c5fcd handle child death and config reload for prewarmed processes 2022-06-09 07:01:41 +05:30
Kovid Goyal
90bc3ab770 Function to create a randomly named UNIX domain socket 2022-06-09 07:01:41 +05:30
Kovid Goyal
0021b0c242 Prewarm all kittens 2022-06-09 07:01:41 +05:30
Kovid Goyal
6dc076f5d1 Complete move to prewarm.py 2022-06-09 06:54:05 +05:30
Kovid Goyal
2dd1201c3f Dont use a kitten for prewarm 2022-06-09 06:53:51 +05:30
Kovid Goyal
9be68966b4 Also detect ssh kitten run as an overlay 2022-06-08 18:53:54 +05:30
Kovid Goyal
47d482dca9 Clear signal handlers when running processes 2022-06-08 17:50:42 +05:30
Kovid Goyal
18dd13c872 Make init_loop_data a little safer to use 2022-06-08 15:10:52 +05:30
Kovid Goyal
c71bb877c3 Handle SIGHUP gradefully 2022-06-08 09:06:28 +05:30
Kovid Goyal
eee8106f9e Fix a regression that broke completion when using a kitty alias instead of having kitty on PATH 2022-06-08 07:36:09 +05:30
Kovid Goyal
80ad596d3d Yet another place where macos_colorspace was broken 2022-06-08 07:17:34 +05:30
Kovid Goyal
9dbafcc368 Remove unneccessary argument to connection_sharing_args() 2022-06-07 20:40:01 +05:30
Kovid Goyal
9f5f113840 ... 2022-06-07 13:05:07 +05:30
Kovid Goyal
6afbdbe94f Use correct kitty config in prewarmed process 2022-06-07 12:53:39 +05:30
Kovid Goyal
061a0c8cb6 Reset global options object in the tests 2022-06-07 10:58:03 +05:30
Kovid Goyal
ad128a3c29 version 0.25.2 2022-06-07 07:32:35 +05:30
Kovid Goyal
b71d2e04ca Clarify behavior of placement id when image id is zero 2022-06-07 07:22:12 +05:30
Kovid Goyal
cc3c7b0286 Fix waitpid() call on python 3.8 2022-06-06 21:22:04 +05:30
Kovid Goyal
bf6c90a69a Compare realpaths for cwd test 2022-06-06 20:46:49 +05:30
Kovid Goyal
4c9a75c1ba Remove unused code 2022-06-06 20:45:40 +05:30
Kovid Goyal
98f46f8bd7 Start work on prewarming
The prewarm process and its controller are implemented with some basic
tests.
2022-06-06 20:39:36 +05:30
Kovid Goyal
dec62b1929 Allow ignoring SHM close failures
Useful if we export the mmap beyond the lifetime of the shm object
2022-06-06 20:31:13 +05:30
Kovid Goyal
79f7954048 Cleanup previous PR 2022-06-06 17:19:52 +05:30
Kovid Goyal
fc217dafba Merge branch 'master' of https://github.com/suvayu/kitty 2022-06-06 16:55:08 +05:30
Kovid Goyal
a6aff817cf Prepare for prewarm testing 2022-06-06 15:59:34 +05:30
Suvayu Ali
38cb18fe92 diff kitten: tests for directory walking 2022-06-06 11:01:45 +02:00
Suvayu Ali
20b6a97159 Update in response to feedback
- one configuration option: ignore_paths
- use shlex to parse option to support whitespace and in-line comments
- change option type to Tuple[str, ...]
- remove ignored directories from dirnames to prevent scanning
2022-06-06 11:00:45 +02:00
Kovid Goyal
98f6e24106 Move block outside try/except as it doesnt need to be in there 2022-06-06 08:17:15 +05:30
Kovid Goyal
4ed6364b61 Fix compiler warning on 32bit builds 2022-06-06 07:19:52 +05:30
Kovid Goyal
cd7751681d hints kitten: Fix surrounding quotes/brackets and embedded carriage returns not being removed when using line number processing
Fixes #5170
2022-06-05 18:07:16 +05:30
Kovid Goyal
76531d2f7a Python wrapper function to establish controlling tty 2022-06-05 15:36:05 +05:30
Suvayu Ali
eea652f1d0 kittens/diff: move empty pattern check to dir tree walk 2022-06-05 10:11:21 +02:00
Kovid Goyal
f20f4762a8 Use builtin facility for removing cloexec 2022-06-05 12:33:34 +05:30
Kovid Goyal
c004fd1f4d Declare the set of handled signals in only one place 2022-06-05 08:01:26 +05:30
Kovid Goyal
f29039db29 Make the full signal info available in our signal handler 2022-06-05 07:22:38 +05:30
Suvayu Ali
fbf1ec43c7 diff kitten: add options to ignore paths when comparing directories
Tested locally & over SSH:

    $ kitty +kitten diff /local/path /local/path2
    $ kitty +kitten diff /local/path ssh:remote:/path
2022-06-05 00:11:30 +02:00
Kovid Goyal
a42200a430 Use the log_error function to log SIGUSR2 2022-06-04 15:38:56 +05:30
Kovid Goyal
ad576c333c Also restore signal handlers for SIGUSR1 and SIGUSR2 2022-06-04 15:15:39 +05:30
Kovid Goyal
5a0a980648 Make getting cmdline of a PID a bit more convenient 2022-06-04 15:07:08 +05:30
Kovid Goyal
b3578a4fa5 ... 2022-06-04 14:54:32 +05:30
Kovid Goyal
3c952b01d3 Fix reloading in all kitties skipping kitty processes started as kitty +open 2022-06-04 14:53:13 +05:30
Kovid Goyal
b1453a51f6 Better error message for kitty + 2022-06-04 14:47:13 +05:30
Kovid Goyal
2c3a7b5f41 Restore a couple more signal handlers that python nukes 2022-06-04 14:30:08 +05:30
Kovid Goyal
0df5a6c6c8 Utility function to test if PID is alive 2022-06-04 14:14:24 +05:30
Kovid Goyal
bf4dc6365a Add support for sigqueue() and also handle SIGUSR2
I anticipate using sigqueue() for simpler handling of SIGCHLD
notifications from the prewram process to the its parent.
2022-06-04 14:09:45 +05:30
Kovid Goyal
ce3322bf91 Remote control: Fix commands with asynchronous payloads not sending responses
Fixes #5165
2022-06-04 10:13:21 +05:30
Kovid Goyal
835cb31501 Fix incorrect dispatch of poll events when more than one peer is present 2022-06-04 09:26:57 +05:30
Kovid Goyal
762dd065f3 Nicer reverse loop 2022-06-04 09:06:35 +05:30
Kovid Goyal
7b91447d89 Use a full chekcout in CI when building docs
The :commit: docs role requires it
2022-06-04 08:00:00 +05:30
Kovid Goyal
1146c4ea3f Merge branch 'ignore-fig-osc' of https://github.com/grant0417/kitty 2022-06-04 07:44:17 +05:30
grant0417
729f7b8e03 Add custom message for Fig OSC 2022-06-03 18:57:53 -07:00
grant0417
d3ec632b9f Ignore Fig OSC codes 2022-06-03 17:07:44 -07:00
Kovid Goyal
cb01b5ee44 DRYer 2022-06-03 21:38:49 +05:30
Kovid Goyal
0828096e9e ... 2022-06-03 18:30:14 +05:30
Kovid Goyal
ebcbed290f Make loading of kitty options in kitten re-useable 2022-06-03 17:49:58 +05:30
Kovid Goyal
d6afe6f2cb Move entrypoints into their own module 2022-06-03 11:12:13 +05:30
Kovid Goyal
4daf70f636 ... 2022-06-03 11:08:41 +05:30
Kovid Goyal
2f3dd72c84 Weston: Fix client side decorations flickering on slow computers during window resize
Fixes #5162
2022-06-03 11:00:56 +05:30
Kovid Goyal
dca8c65376 Fix display of url open failures not working 2022-06-02 10:41:08 +05:30
Kovid Goyal
12d8175d9a Use inode/executable rather than application/executable 2022-06-02 10:33:56 +05:30
Kovid Goyal
609bcd68dd Fix #5161 2022-06-02 10:32:43 +05:30
Kovid Goyal
313136803c DRYer 2022-06-02 10:21:34 +05:30
Kovid Goyal
b937033411 macOS: Allow opening executables without a file extension with kitty as well
Fixes #5160
2022-06-02 09:25:30 +05:30
Kovid Goyal
55eeb9c11e Dont import kitty.complete in ssh.main 2022-06-02 08:08:33 +05:30
Kovid Goyal
8fbec2dfd5 remove unused arg 2022-06-02 08:07:53 +05:30
Kovid Goyal
c4521290b8 ... 2022-06-01 19:43:41 +05:30
Kovid Goyal
e12a9f3caf Iosevka: Fix incorrect rendering when there is a combining char that does not group with its neighbors
Fixes #5153
2022-06-01 12:00:53 +05:30
Kovid Goyal
56f8a06362 DRYer 2022-06-01 08:47:19 +05:30
Kovid Goyal
5c4abe749b Merge branch 'fontconfig-special-sources' of https://github.com/leungbk/kitty 2022-06-01 08:33:13 +05:30
Brian Leung
62c27b3db7 Add kitty/fontconfig.c to SPECIAL_SOURCES
Fixup of bec620a8d3.
2022-05-31 19:58:42 -07:00
Kovid Goyal
1283a2b7e5 ... 2022-06-01 08:21:23 +05:30
Kovid Goyal
bec620a8d3 Fix #5154 2022-06-01 08:19:11 +05:30
Kovid Goyal
6b0bb2e845 Sphinx v5 needs language to be not None 2022-06-01 06:47:06 +05:30
Kovid Goyal
135818f34b Note about __main__.py with +launch 2022-05-31 07:56:01 +05:30
Kovid Goyal
2a361d1de1 Update changelog for last PR 2022-05-31 07:46:00 +05:30
Kovid Goyal
761a941d43 Merge branch 'kovidgoyal-master' of https://github.com/jimbob3806/kitty 2022-05-31 07:41:40 +05:30
Kovid Goyal
c03630a487 ... 2022-05-31 07:26:04 +05:30
James Reid
0b79cbdb3b Add "user" tab to themes kitten
Add new tab named "user" to the built-in themes kitten - new tab
filters and displays only user-defined color themes, identified by
adding "is_user_defined" property to "Theme" class which defaults
to False, and is set True when a theme is fetched using the
"load_from_dir" method.
2022-05-30 19:25:09 +01:00
James Reid
1dc6b49e02 Remove hard coded tab string in ThemesHandler
Remove hard coded tab string and replace with self.tabs, which is
a reference to the same tab string defined in the __init__ of
ThemesHandler
2022-05-30 19:17:07 +01:00
Kovid Goyal
1962f8e5a0 Advertise edit-in-kitty a bit more 2022-05-30 15:27:23 +05:30
Kovid Goyal
cabfcbcb69 macOS: When pasting text and the clipboard has a filesystem path, paste the full path instead of the text, which is sometimes just the file name
Fixes #5142
2022-05-30 14:40:45 +05:30
Kovid Goyal
48bb43a2c4 fish: completion for edit-in-kitty clone-in-kitty
fish's wrapping facility does not preserve argv[0] so it cannot be used
unlike for zsh and bash
2022-05-30 10:50:19 +05:30
Kovid Goyal
af5e3e0c18 Add a reference to edit-in-kitty to the remote file kitten docs 2022-05-30 08:19:33 +05:30
Kovid Goyal
fb8398c2eb bash: completion for edit/clone-in-kitty 2022-05-30 08:16:51 +05:30
Kovid Goyal
eefd4bb3e3 zsh: Completion for edit-in-kitty and clone-in-kitty 2022-05-30 08:12:09 +05:30
Kovid Goyal
581c388838 ... 2022-05-29 15:02:37 +05:30
Kovid Goyal
7a63ea6480 Drop python 3.7 from CI 2022-05-29 14:54:51 +05:30
Kovid Goyal
65f1329635 Wayland: When the seat is closed remove any pending pointer animation and key repeat timers
Fixes #5145
2022-05-29 14:50:34 +05:30
Kovid Goyal
0df9a5d5c5 Fix compilation on Python 3.11
Python 3.11 deprecates the supposedly "stable API" PySys_AddXOption().
So switch to using PyConfig.xoptions instead. This means dropping
support for python 3.7 since PyConfig is not available there. So it
rolls.

Fixes #5143
2022-05-29 14:37:14 +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
e9340dfaaf Some more tests for last non empty command output 2022-05-28 15:22:17 +05:30
Kovid Goyal
0509855930 Allow getting the last non-empty command output easily via an action or remote control
Fixes #4973
2022-05-28 15:19:24 +05:30
Kovid Goyal
4c74462763 ssh kitten: Look in common locations for login shell if it is not in PATH 2022-05-28 11:29:09 +05:30
Kovid Goyal
7f69381221 Update changelog 2022-05-28 11:13:35 +05:30
Kovid Goyal
75942fb47e Implement edit-in-kitty for fish 2022-05-28 11:12:11 +05:30
Kovid Goyal
0893d7164a _run_kitten -> run_kitten_with_metadata 2022-05-28 11:00:25 +05:30
Kovid Goyal
27906ea853 Skip login shell detection when login shell is set to nologin 2022-05-28 08:09:30 +05:30
Kovid Goyal
8540ca3990 Workaround for nix package messing with kitty file permissions 2022-05-28 08:03:17 +05:30
Kovid Goyal
e82c5a63b5 Avoid unnecessary use of cat 2022-05-27 14:18:16 +05:30
Kovid Goyal
83602d7e53 Make chunked transmit code re-useable in fish integration script 2022-05-27 13:21:26 +05:30
Kovid Goyal
64e30e5299 Ignore permission errors when stating file to edit 2022-05-27 13:04:02 +05:30
Kovid Goyal
83ce23ff9f Use zsh's builtin stat instead of relying on the stat command 2022-05-27 12:50:52 +05:30
Kovid Goyal
c5e5ec618d Also trap SIGTERM to cleanup 2022-05-27 12:39:22 +05:30
Kovid Goyal
bd84ec03ce Implement edit-in-kitty for bash 2022-05-27 12:38:26 +05:30
Kovid Goyal
d71f18566e forgot to declare data local 2022-05-27 12:29:11 +05:30
Kovid Goyal
76e75d9f89 Ensure self.tdir exists in __del__ 2022-05-27 10:48:16 +05:30
Kovid Goyal
f5695ac4f4 Increase edit file size limit to 8MB 2022-05-27 10:45:36 +05:30
Kovid Goyal
b748cd21cf Allow opening files at a spedific line number with edit-in-kitty 2022-05-27 09:53:43 +05:30
Kovid Goyal
3a8bdf3b48 React instantly to editor window being closed 2022-05-27 09:15:16 +05:30
Kovid Goyal
196c6b07aa Merge branch 'fix-window-menu' of https://github.com/henryhchchc/kitty 2022-05-27 09:12:56 +05:30
Henry Chu
1978cc5b55 Fixed #5132 2022-05-27 11:15:16 +08:00
Kovid Goyal
ea47cee23f Document edit-in-kitty 2022-05-27 07:41:54 +05:30
Kovid Goyal
e6844ad6f2 ssh kitten: Run bash as a login shell
This fell through the cracks in the rewrite for automatic shell
integration. Fixes #5130
2022-05-26 21:24:32 +05:30
Kovid Goyal
02d5b3eafa Fix shebang 2022-05-26 21:21:36 +05:30
Kovid Goyal
151dacf17f Update changelog 2022-05-26 21:21:27 +05:30
Kovid Goyal
117d1b02be Start work on edit-in-kitty 2022-05-26 21:16:42 +05:30
Kovid Goyal
cb55878efd Fix #5129 2022-05-26 19:42:20 +05:30
Kovid Goyal
ea4751eae5 Move logic for handling chunked remote data into a separate function
Use the existing clipboard_max_size as the limit for remote data
2022-05-26 08:52:20 +05:30
Kovid Goyal
cc4f1c0a24 version 0.25.1 2022-05-26 07:59:25 +05:30
Kovid Goyal
3eb5320e29 Add tpix to list of programs that speak the graphics protocol 2022-05-25 12:27:38 +05:30
Kovid Goyal
4f63cff1a4 Make _run_kitten public API 2022-05-25 07:14:18 +05:30
Kovid Goyal
8381171c8d Forgot trailing newline 2022-05-24 06:54:53 +05:30
Kovid Goyal
1b2d54d97a Output a warning when libwayland-cursor returns incorrectly sized cursor images 2022-05-23 12:50:47 +05:30
Kovid Goyal
e7da874b82 GNOME: Workaround for GNOME's text input system going into an infinite loop if cursor position is updated in response to a done event
Fixes #5105
2022-05-23 10:36:58 +05:30
Kovid Goyal
ea8bed2a71 Fix #5113 2022-05-20 20:45:08 +05:30
Kovid Goyal
c747e681a2 Merge branch 'patch-1' of https://github.com/jack1142/kitty 2022-05-20 20:42:11 +05:30
Jakub Kuczys
a9a9ec80b5 Support the short pretty flag (-p) in hyperlinked_grep kitten 2022-05-20 10:57:42 +02:00
Kovid Goyal
eb84990f5a Fix #5110 2022-05-19 09:55:12 +05:30
Kovid Goyal
1938ba3108 Add changelog entry for previous PR 2022-05-18 20:04:09 +05:30
Kovid Goyal
0eee2db199 Merge branch 'add-option-select_by_word_characters_forward' of https://github.com/kgraefe/kitty 2022-05-18 20:02:11 +05:30
Kovid Goyal
bba1455e28 Dont import all of the ssh kitten just to detect commandlines 2022-05-18 15:58:06 +05:30
Konrad Gräfe
8c41cc8d3e Add option select_by_word_characters_forward
This adds an option to select separate characters for forward and
backward word extension on double click. If it is empty the old behavior
is preserved. This is the default.

If it is not empty, select_by_word_characters_forward will be used for
extending the selection in forward direction (right) and
select_by_word_characters will be used for extending in backward
direction (left).

Signed-off-by: Konrad Gräfe <kgraefe@paktolos.net>
2022-05-16 11:09:36 +02:00
Kovid Goyal
5efcb35cfb Only integrate with ssh kitten if shared connections are enabled for that host 2022-05-14 10:37:05 +05:30
Kovid Goyal
1b4cf1fea7 Remote file kitten: Integrate with the ssh kitten 2022-05-14 10:31:18 +05:30
Kovid Goyal
d3656bf7e9 Linux: Load libfontconfig at runtime to allow the binaries to work for running kittens on servers without FontConfig 2022-05-13 19:56:19 +05:30
Kovid Goyal
aaffec1cbc Better error message 2022-05-13 19:25:37 +05:30
Kovid Goyal
ed9391d4d6 Add a note explaining why fontconfig is not bundled 2022-05-13 17:45:16 +05:30
Kovid Goyal
58333f260b Fix spurious error print in test 2022-05-13 17:42:00 +05:30
Kovid Goyal
cf8ccabad9 Fix deleting images by row not calculating image bounds correctly
Fixes #5081
2022-05-13 09:51:25 +05:30
Kovid Goyal
600c595fdf Fix reloading of config not working when kitty.conf does not exist when kitty is launched
Fixes #5071
2022-05-08 20:57:23 +05:30
Kovid Goyal
2427d2d9da Workaround Apple's "hardening" breaking the platform module
Fix #5065
Fix #5051
2022-05-07 20:43:10 +05:30
Kovid Goyal
4ca70bfa26 ... 2022-05-04 13:21:17 +05:30
Kovid Goyal
4e8eb2f7f0 Merge branch 'rc-match' of https://github.com/page-down/kitty 2022-05-01 21:23:58 +05:30
pagedown
b6cf4bc78f ... 2022-05-01 23:27:33 +08:00
pagedown
622cd5531a Raise an exception when not in broadcast and no match for send-text
send-text still won't return an error code when there is no match,
since no_response is True by default.
2022-05-01 23:05:44 +08:00
pagedown
ec35b0cc7c Fix remote command --match=all returns empty 2022-05-01 23:05:22 +08:00
pagedown
0719c7f8bb DRYer: Use window matching function in remote commands 2022-05-01 23:04:50 +08:00
Kovid Goyal
bb7e4039e8 Merge branch 'rc-err' of https://github.com/page-down/kitty 2022-05-01 07:11:21 +05:30
pagedown
a0559e506b Show error message when remote command arguments are invalid 2022-04-30 22:01:58 +08:00
Kovid Goyal
4ce4176bbe cleanup previous PR 2022-04-30 15:03:27 +05:30
Kovid Goyal
99409f0a8b Merge branch 'docs' of https://github.com/page-down/kitty 2022-04-30 14:41:12 +05:30
pagedown
13303416b8 Docs: Improve the documentations
Add more text roles and links.
Fix typos.
Adjust the default shortcut order in overview.
Notes on the impact of kitty-open.desktop on the default open apps.
Document KITTY_DEVELOP_FROM in glossary.
Add Python type hints to the watcher example.
Mention clone-in-kitty in launch --copy-env.
Fix remote control ls example does not work, by escaping the backslash.
2022-04-30 17:07:36 +08:00
Kovid Goyal
9811d677e5 query terminal kitten: Return fast when run in non-kitty terminals 2022-04-30 14:25:39 +05:30
pagedown
b9fd039668 Docs: Document the env vars set by kitty for auto shell integration 2022-04-30 16:54:53 +08:00
pagedown
6c1f20bb27 Docs: Mention close_shared_ssh_connections in ssh kitten config docs 2022-04-30 16:54:46 +08:00
pagedown
2b58316c64 ... 2022-04-30 16:54:41 +08:00
Kovid Goyal
f2df629634 ... 2022-04-30 09:38:08 +05:30
Kovid Goyal
8f46505a50 Header to print stack traces in C 2022-04-30 09:28:05 +05:30
Kovid Goyal
c48bf4fd85 Output debug lines for when kitty sets the pointer in Wayland 2022-04-30 09:13:08 +05:30
Kovid Goyal
8c67f5aea8 Merge branch 'fix-gen-conf' of https://github.com/page-down/kitty 2022-04-30 07:35:15 +05:30
pagedown
76f84e32c4 Fix the generated sample kitty.conf containing invalid options 2022-04-30 02:23:33 +08:00
Kovid Goyal
4a7125ec92 ssh kitten: Suppress error prints about invalid items in kitty.conf
Fixes #4985
2022-04-29 20:39:32 +05:30
Kovid Goyal
92c3af6a92 Allow using --match=all in all rc commands 2022-04-29 17:17:07 +05:30
Kovid Goyal
443f36ebc7 Merge branch 'docs' of https://github.com/page-down/kitty 2022-04-29 07:11:40 +05:30
pagedown
17632dea3c Docs: Improve remote control command documentation
Improve the --match option description.
Add more text roles and links.
Fix typos.
2022-04-29 01:31:11 +08:00
pagedown
bb78dc5ccb Docs: Fix the help text of query_terminal and other minor tweaks
Use --match-tab in broadcast kitten example.
2022-04-29 01:30:45 +08:00
Kovid Goyal
2737cb7dd0 Fix #5026 2022-04-28 22:12:43 +05:30
Kovid Goyal
08b2ce444f Also dont apply umask when extracting bootstrap data 2022-04-28 17:28:40 +05:30
Kovid Goyal
289028b468 Prevent umask from interfering with tar file extraction
Fixes #5025
2022-04-28 17:21:34 +05:30
Kovid Goyal
2b3be147e6 Allow three combining chars per cell
Makes use of otherwise wasted padding in the CPUCell struct
2022-04-28 09:45:34 +05:30
Kovid Goyal
1a2d9c6fba Fix a couple of issues highlighted by updated mypy 2022-04-28 07:03:35 +05:30
Kovid Goyal
af15b0313a Ensure there are no duplicate watchers for send-text sessions 2022-04-27 22:17:09 +05:30
Kovid Goyal
b080296326 Remove unused code 2022-04-27 21:25:39 +05:30
Kovid Goyal
516e0e8bb3 broadcast kitten: Keep the ghost cursors in target windows as long as broadcast window has focus 2022-04-27 21:24:18 +05:30
Kovid Goyal
57e23bd4e3 Handle zero blink time correctly 2022-04-27 20:37:23 +05:30
Kovid Goyal
59534d620e Use cursor blink interval as TIMEOUT_FOR_SESSION 2022-04-27 20:31:16 +05:30
Kovid Goyal
068b7e8d63 remove unused adjust_line_height() function 2022-04-27 20:21:36 +05:30
Kovid Goyal
2c1edb9611 Merge branch 'docs' of https://github.com/page-down/kitty 2022-04-27 20:18:39 +05:30
pagedown
510022c3c1 Docs: Improve the documentation for kittens
Add more text roles and links.
Add an example that broadcasts only to other windows in the current tab.
Initial capitalization of the key names in the kbd text role.
Add Python type hints for custom kittens.
Note about hyperlink support for ls on macOS.
Add description text for show_key.
2022-04-27 16:14:54 +08:00
Kovid Goyal
627c79ffbb Show detailed traceback when using show_error() 2022-04-26 13:58:57 +05:30
Kovid Goyal
e80cd36237 Show traceback on stderr for action failures 2022-04-26 11:58:17 +05:30
Kovid Goyal
92ebada9a6 ... 2022-04-26 11:15:45 +05:30
Kovid Goyal
462ae3bb58 ... 2022-04-26 11:15:33 +05:30
Kovid Goyal
6d6d9cc26b macOS: Add the macos_colorspace option to control what color space colors are rendered in
Fixed #4686
2022-04-26 11:14:01 +05:30
Kovid Goyal
a36d5dcde1 GLFW API for changing colorspace of windows on cocoa 2022-04-26 10:56:34 +05:30
Kovid Goyal
f9f6f98527 Note that neovim is also getting support for the kitty keyboard protocol 2022-04-26 08:39:44 +05:30
Kovid Goyal
ee94114eb2 Fix #5016 2022-04-26 08:20:24 +05:30
Kovid Goyal
8e98fcf2f6 Merge branch 'docs' of https://github.com/page-down/kitty 2022-04-25 14:16:16 +05:30
pagedown
c4710bf9cb Docs: Add text to the ref text role and minor tweaks
The text will be used when generating the commented configuration file.
Use inline literal to quote codes with spaces, as the `code` text role
will be removed when the commented configuration is generated, making it
indistinguishable from normal text.
2022-04-25 15:36:57 +08:00
pagedown
97a568a405 Docs: Improve the FAQ
Add more text roles and links.
Document `PATH` in the glossary.
2022-04-25 15:36:51 +08:00
pagedown
7bace19aed clone-in-kitty: Skip more SSH env vars to use the correct values 2022-04-25 15:36:43 +08:00
pagedown
7282f1f684 Docs: Improve ssh kitten documentation
Add more text roles.
Put the env example at the end.
The alias syntax of fish and bash requires quotation marks.
Document `SSH_ASKPASS` in the glossary.
2022-04-25 15:36:37 +08:00
Kovid Goyal
9edb772a81 Merge branch 'fix-launch-cwd-oldest' of https://github.com/rafikdraoui/kitty 2022-04-24 22:04:05 +05:30
Rafik Draoui
d123b6c377 Fix launch --cwd=oldest 2022-04-24 13:19:22 -03:00
Kovid Goyal
c9ba3695d3 ... 2022-04-24 15:50:02 +05:30
Kovid Goyal
0ee970b418 --hold is not suitable for replay commands as it outputs to the terminal 2022-04-24 15:37:20 +05:30
Kovid Goyal
8239cb1b5a Merge branch 'docs' of https://github.com/page-down/kitty 2022-04-24 15:36:35 +05:30
pagedown
97caa073b0 Docs: Improvements to the configuration documentation
Slightly adjust and simplify the config option descriptions.
Add more text roles.
Initial capitalized key names.
Change some examples to better demonstrate configurations.
Fix listen_on description.
Also document cmd+c and cmd+v.
Fix doc text role links in commented out configuration file.
2022-04-24 17:32:49 +08:00
pagedown
45bbe17559 Docs: Minor improvements to the kitty cli help documentation
Add some text roles.
Use `kitty --hold`.
Use `appname` and `conf_name`.
`appname` is also applied to the system-wide configuration path.
2022-04-24 17:18:55 +08:00
pagedown
288d16f7be Docs: Minor tweaks to the help documentation of hints kitten 2022-04-24 17:18:45 +08:00
pagedown
ecb60b313e Docs: Improve clone-in-kitty documentation and fix LANG descriptions
Reduce duplicate `launch`.
Add links to python venv and conda.
Adjust the order of env vars, `.._CODE` takes precedence over `.._PATH`.
Add clone-in-kitty env vars to glossary.
Correct the description of the LANG env var.
2022-04-24 17:18:31 +08:00
Kovid Goyal
cf2a20e4ea Merge branch 'fix-f-string' of https://github.com/page-down/kitty 2022-04-24 08:03:51 +05:30
pagedown
bc4f40fea7 ... 2022-04-24 09:34:22 +08:00
Kovid Goyal
102097da5a DRYer 2022-04-23 12:51:02 +05:30
Kovid Goyal
0e3528df14 Merge branch 'feat-macos-open-website' of https://github.com/page-down/kitty 2022-04-23 12:49:21 +05:30
Kovid Goyal
214631c2dd Sort frozenset literals in generated options class definition 2022-04-23 11:23:21 +05:30
pagedown
e919857dfc macOS: Make the global menu shortcut to open kitty website configurable
This allows remapping the key combination shift+cmd+/
2022-04-23 13:22:27 +08:00
pagedown
a5bd1dcb08 Add a new mappable action open_url 2022-04-23 13:17:28 +08:00
Kovid Goyal
37cdaea9ed Also save command history before cloning in bash 2022-04-22 23:40:59 +05:30
Kovid Goyal
6bbaf5f1cf zsh cloning: save history so that it is up-to-date in cloned shell 2022-04-22 23:34:34 +05:30
Kovid Goyal
8808a252ae Merge branch 'docs' of https://github.com/page-down/kitty 2022-04-22 13:29:24 +05:30
pagedown
5f1376b9a0 ... 2022-04-22 15:02:23 +08:00
Kovid Goyal
efa873bf50 DRYer 2022-04-22 10:53:25 +05:30
Kovid Goyal
714461de76 Also ensure oldest cwd request type is honored by modify_argv 2022-04-22 08:40:18 +05:30
Kovid Goyal
b753cf6879 Forgot to implement at_prompt use of reported cwd in modify_argv 2022-04-22 08:25:46 +05:30
Kovid Goyal
27010d0446 Merge branch 'docs' of https://github.com/page-down/kitty 2022-04-21 15:24:18 +05:30
Kovid Goyal
bdc039fbf5 Fix docstring 2022-04-21 14:51:23 +05:30
pagedown
72f92f3174 Docs: Mention again that kitty.conf will be created if not present 2022-04-21 16:45:12 +08:00
Kovid Goyal
8fcd5e40d4 Proper fix for reporting button in drag events to children 2022-04-21 11:41:57 +05:30
Kovid Goyal
b76319b7e8 Update changelog 2022-04-21 11:34:18 +05:30
Kovid Goyal
feeb8f28c4 Fix #4993 2022-04-21 11:00:34 +05:30
Kovid Goyal
55b21b741e Fix a regression in the previous release that caused mouse move events to be incorrectly reported as drag events even when a button is not pressed
Fixes #4992

Will need to investigate a different fix for #4925. xterm does report
the button press that caused the drag to start with move events, so we
will have to track that to match its behavior as glfw does not track it
for us.
2022-04-21 07:53:37 +05:30
Kovid Goyal
6941884221 ... 2022-04-20 13:36:26 +05:30
Kovid Goyal
6174c2008f ... 2022-04-20 10:10:05 +05:30
Kovid Goyal
1a32e79470 ... 2022-04-19 21:14:34 +05:30
Kovid Goyal
dd032db89c Merge branch 'docs' of https://github.com/page-down/kitty 2022-04-19 21:07:03 +05:30
pagedown
f70e0e216c Docs: Show copy button for installation command snippets 2022-04-19 23:28:51 +08:00
Kovid Goyal
51362706d7 Fix closing a tab incorrectly storing the tab to its right in the active tab history 2022-04-19 17:44:01 +05:30
Kovid Goyal
b2c317ebc6 ... 2022-04-19 17:38:16 +05:30
Kovid Goyal
90acbd0dd5 Add a note about ssh kitten colors to FAQ 2022-04-19 15:21:05 +05:30
Kovid Goyal
402fac3edf ... 2022-04-19 10:53:18 +05:30
Kovid Goyal
c4c62c1505 When using --keep-focus ensure active history list is not affected
Fixes #4987
2022-04-18 20:23:15 +05:30
Kovid Goyal
b569c01b49 Fix #4986 2022-04-18 17:04:05 +05:30
Kovid Goyal
c0d9b6e979 Merge branch 'docs' of https://github.com/page-down/kitty 2022-04-18 12:41:05 +05:30
pagedown
b94afbba13 ... 2022-04-18 14:51:15 +08:00
Kovid Goyal
1994c17c75 Note on how clone-in-kitty works 2022-04-18 12:08:32 +05:30
Kovid Goyal
f88a4fe986 ... 2022-04-18 11:13:16 +05:30
Kovid Goyal
25616aaa7b Merge branch 'clone-in-kitty' of https://github.com/page-down/kitty 2022-04-18 10:57:55 +05:30
pagedown
19fdcec358 ... 2022-04-18 11:54:14 +08:00
pagedown
45eb4a0760 clone-in-kitty: Remove duplicate PATH entries in fish implementation 2022-04-18 11:46:29 +08:00
pagedown
9e026983e6 clone-in-kitty: Remove CONDA_PREFIX_* env vars 2022-04-18 11:42:22 +08:00
Kovid Goyal
be0a524e23 Yet another try to get zsh to de-dup $PATH 2022-04-18 07:40:37 +05:30
Kovid Goyal
339af1b4b2 Add more send_text examples 2022-04-17 22:48:03 +05:30
Kovid Goyal
31fda568e4 typeset -U both path and PATH 2022-04-17 21:27:08 +05:30
Kovid Goyal
3efbccc850 ... 2022-04-17 20:56:24 +05:30
Kovid Goyal
93c23f99cb conda activate now works under fish so use it 2022-04-17 20:55:53 +05:30
Kovid Goyal
6590d0690e Document venv and sourcing behavior of clone-in-kitty 2022-04-17 19:51:27 +05:30
Kovid Goyal
230a9f4678 Implement option to control clone sourcing strategies 2022-04-17 19:39:32 +05:30
Kovid Goyal
f2189b3e70 only pass VIRTUAL_ENV if it is currently active 2022-04-17 15:43:57 +05:30
Kovid Goyal
0ee5712e00 Start work on option to control sourcing strategies 2022-04-17 15:30:57 +05:30
Kovid Goyal
f9cad2c4ea Add a note about show__key limitations 2022-04-17 08:45:27 +05:30
Kovid Goyal
4372cf2893 ... 2022-04-17 08:43:23 +05:30
Kovid Goyal
34c18bacd8 Free up memory used to store copy of child env block 2022-04-17 08:35:55 +05:30
Kovid Goyal
3af11e92d6 Ensure the clone launch env var is not set accidentally 2022-04-17 08:29:47 +05:30
Kovid Goyal
74d5f2c259 Dont allow inappropriate types for cloning 2022-04-17 08:19:01 +05:30
Kovid Goyal
291f9e9a5e Make cloning safer
Now env vars are set after shell rc files are sourced. And the clone
request cannot specify the cmdline to execute.
2022-04-17 07:49:58 +05:30
Kovid Goyal
38e1d32065 Actually implement allow_cloning 2022-04-16 22:40:05 +05:30
Kovid Goyal
b45fedd794 Infrastructure for serializing env blocks 2022-04-16 22:16:20 +05:30
Kovid Goyal
df9b13fb74 Ask for confirmation before doing a clone by default 2022-04-16 20:04:26 +05:30
Kovid Goyal
53788c4c89 Get conda working with fish 2022-04-16 15:16:53 +05:30
Kovid Goyal
831043b773 Implement venv detection for fish 2022-04-16 14:45:02 +05:30
Kovid Goyal
1daf745d74 Add explicit support for python and conda venvs to clone-in-kitty
Still needs to be implemented for fish
2022-04-16 13:15:10 +05:30
Kovid Goyal
d6c5b40ead ... 2022-04-16 09:26:53 +05:30
Kovid Goyal
57ea524464 Merge branch 'clone-in-kitty' of https://github.com/page-down/kitty 2022-04-15 20:27:36 +05:30
pagedown
e19ce6cce6 clone-in-kitty: Skip some user-related environment variables 2022-04-15 22:47:57 +08:00
Kovid Goyal
8d4f6681e8 Merge branch 'clone-in-kitty' of https://github.com/page-down/kitty 2022-04-15 19:49:33 +05:30
pagedown
9c855a8377 Skip environment variables such as SSH_TTY when using clone-in-kitty 2022-04-15 19:43:40 +08:00
Kovid Goyal
716813e38a Proper fix for macOS argv[0] 2022-04-15 15:23:45 +05:30
Kovid Goyal
e5322cdc52 Fix clone-in-kitty --env not working over ssh 2022-04-15 15:20:38 +05:30
Kovid Goyal
b5701691c6 Dont clone prompt related env variables
These really shouldnt be exported but people often do
2022-04-15 15:18:43 +05:30
Kovid Goyal
aab9482e31 ... 2022-04-15 15:01:13 +05:30
Kovid Goyal
775584b5a5 Use literal quoting for env vars sent over ssh by clone 2022-04-15 14:34:21 +05:30
Kovid Goyal
25f022cc14 Ensure copy_env is False 2022-04-15 14:04:52 +05:30
Kovid Goyal
981ad88309 Allow nuking expandvars globally 2022-04-15 13:58:01 +05:30
Kovid Goyal
e71b9091a3 Dont rely on env -0 for bash either 2022-04-15 13:33:32 +05:30
Kovid Goyal
bde468594e ssh kitten: handle newlines in env vars 2022-04-15 12:49:35 +05:30
Kovid Goyal
0fcfe104e3 Handle argv[0] being buggered on macOS 2022-04-15 12:25:05 +05:30
Kovid Goyal
4cf54d2dfb Dont rely on env -0 in zsh
zsh outputs env vars in a nice one per line format using $'' encoding.
So exploit it
2022-04-15 12:17:59 +05:30
Kovid Goyal
b866c3e783 Add a zsh test for clone env serialization 2022-04-15 12:04:50 +05:30
Kovid Goyal
c15a31e725 Ensure colors are copied form the correct window when cloning
Also, encapsulate clone command into its own class to ease testing
2022-04-15 11:53:28 +05:30
Kovid Goyal
afaf866b15 Merge branch 'ksi-fish-clone-in-kitty' of https://github.com/page-down/kitty 2022-04-14 19:47:41 +05:30
pagedown
af6b1837cb Minor refactoring for fish clone-in-kitty and allow use without env -0
The builtin option from the latest version of fish is not used for now.
clone-in-kitty has been tested with fish 3.2.x.
BusyBox env does not support the -0 option.
2022-04-14 21:32:28 +08:00
Kovid Goyal
aab6f3e450 ... 2022-04-14 17:28:41 +05:30
Kovid Goyal
829ed0ec0d Fix #4964 2022-04-14 17:20:30 +05:30
Kovid Goyal
d9899cb489 Add missing item to changelog 2022-04-14 15:04:48 +05:30
Kovid Goyal
1a370ea9b6 Put the examples front and center 2022-04-14 07:59:32 +05:30
Kovid Goyal
cc07b1f79d Use 2048 chunk size in fish as well 2022-04-13 22:50:24 +05:30
Kovid Goyal
3ddea42660 ... 2022-04-13 22:45:36 +05:30
Kovid Goyal
236dbd95c9 ... 2022-04-13 22:34:23 +05:30
Kovid Goyal
6b078c4267 Implement clone-in-kitty for the fish shell 2022-04-13 22:33:21 +05:30
Kovid Goyal
1dec5f2e08 Help message for clone-in-kitty 2022-04-13 21:38:33 +05:30
Kovid Goyal
e5f70b7306 ... 2022-04-13 21:22:27 +05:30
Kovid Goyal
e2bb856e41 Document clone-in-kitty 2022-04-13 21:01:45 +05:30
Kovid Goyal
88d597f6b2 Dont define clone-in-kitty in POSIX mode
POSIX mode doesnt allow - in identifiers
2022-04-13 20:55:00 +05:30
Kovid Goyal
d0c0b01724 Get clone-in-kitty working for bash as well 2022-04-13 20:38:04 +05:30
Kovid Goyal
4b7c50518e Fix usage of chunk_num 2022-04-13 20:16:51 +05:30
Kovid Goyal
a1bfcd9fc5 Also transfer env vars when cloning over ssh kitten 2022-04-13 20:08:06 +05:30
Kovid Goyal
eb024fa40a ... 2022-04-13 15:51:00 +05:30
Kovid Goyal
122475ad4d Work on getting cloning working with the SSH kitten
Still need to do environment passing
2022-04-13 15:41:42 +05:30
Kovid Goyal
f7114bc1c5 ... 2022-04-13 15:35:06 +05:30
Kovid Goyal
feea6998f8 Allow using the cwd of the oldest as well as the newest foreground process for launch --cwd 2022-04-13 15:31:17 +05:30
Kovid Goyal
e187110611 Use $PWD instead of pwd -P as we want the exact same cwd not the resolved one when cloning 2022-04-13 15:13:58 +05:30
Kovid Goyal
c19e69855a Start work on a command to clone the current working env into a new kitty window 2022-04-13 15:02:22 +05:30
Kovid Goyal
7788f48dd5 Ensure IFS is correct when iterating over KITTY_SHELL_INTEGRATION 2022-04-12 23:03:05 +05:30
Kovid Goyal
073eecb6bb Also package kitty.termcap 2022-04-12 22:43:22 +05:30
Kovid Goyal
030e7e2db3 termcap should be generated in generate not compile 2022-04-12 22:41:19 +05:30
Kovid Goyal
aead3c1c35 Also generate a termcap database entry when building terminfo 2022-04-12 22:38:52 +05:30
Kovid Goyal
587f44ad4e A working implementation of cwd_of_process for FreeBSD 2022-04-12 22:06:46 +05:30
Kovid Goyal
c9ef4aa8c8 Sessions: Fix os_window_size and os_window_class not applying to the first OS Window
Fixes #4957
2022-04-12 21:38:29 +05:30
Kovid Goyal
aabadd8517 ... 2022-04-12 21:19:28 +05:30
Kovid Goyal
b8866371a3 avoid unneccessary session creation during startup 2022-04-12 21:18:18 +05:30
Kovid Goyal
0f3883af02 ... 2022-04-12 21:13:56 +05:30
Kovid Goyal
5876ce0845 Remove --target-group in favor of the new boolean search expressions with matching on window/tab state 2022-04-12 20:41:17 +05:30
Kovid Goyal
2c72c56e22 Add a couple more states to match against
So we can now select windows/tabs that are not active/focused but are in
the active/focused tab/os window.
2022-04-12 20:35:31 +05:30
Kovid Goyal
f15ce21da1 Markup the --match options help text a bit more 2022-04-12 20:20:29 +05:30
Kovid Goyal
b3fa7310cb Allow matching on window/tab state 2022-04-12 20:14:01 +05:30
Kovid Goyal
ade38870a0 Allow using boolean operators when matching windows or tabs 2022-04-12 19:55:20 +05:30
Kovid Goyal
11bc1b100c Handle <> inside :ref: on the CLI 2022-04-12 19:48:09 +05:30
Kovid Goyal
93a7b220c9 Fix parsing of quoted words 2022-04-12 19:31:56 +05:30
Kovid Goyal
8f92c594f2 Create a search query parser 2022-04-12 19:26:25 +05:30
Kovid Goyal
afebea8635 --tab-title=current should respect any override title set on the tab 2022-04-12 12:53:59 +05:30
Kovid Goyal
5d76cfb578 Remove output start mark from last command output 2022-04-12 08:55:07 +05:30
Kovid Goyal
f085f853bd unactive -> inactive 2022-04-12 06:35:29 +05:30
Kovid Goyal
4ac2312b2a Fix #4954 2022-04-12 06:33:35 +05:30
Kovid Goyal
c6dcbe6521 Dont check if running in kitty when updating
I dont actually know if it causes any problems and its fairly
inconvenient to use another terminal.
2022-04-11 22:07:36 +05:30
Kovid Goyal
49efbf0c6e Remove the code to generate installer.sh from installer.py 2022-04-11 21:35:59 +05:30
Kovid Goyal
1d8d669a43 version 0.25.0 2022-04-11 19:31:45 +05:30
Kovid Goyal
f4d44f30b4 Allow copying current window/tab/os window titles when creating new ones via the launch command. Fixes #4933 2022-04-11 15:38:33 +05:30
Kovid Goyal
4c77b0c562 Fix #4947 2022-04-11 15:00:27 +05:30
Kovid Goyal
2f367fa90c Note that wayst also has graphics protocol support 2022-04-10 07:38:55 +05:30
Kovid Goyal
970ec9c839 Merge branch 'feat-close-other-tabs' of https://github.com/page-down/kitty 2022-04-10 07:17:31 +05:30
pagedown
be52f29792 ... 2022-04-09 18:27:32 +08:00
pagedown
8ae2f06828 Add a new mappable action close_other_tabs_in_os_window 2022-04-09 18:26:31 +08:00
Kovid Goyal
601b2a05ac Add instructions for how to do debug builds 2022-04-09 08:07:29 +05:30
Kovid Goyal
b78fbb4521 Fix #4938 2022-04-08 15:44:33 +05:30
Kovid Goyal
c40ef01445 Fix resizing window that is extra tall/wide because of left-over cells not working reliably
Fixes #4913
2022-04-08 15:41:53 +05:30
Kovid Goyal
ab8a4c6b9f Make per cell bias calculation overridable more easily 2022-04-08 14:52:53 +05:30
Kovid Goyal
dd331ca12e ssh kitten: Allow changing terminal colors when connecting 2022-04-08 12:10:59 +05:30
Kovid Goyal
c3b23679f3 Make some themes code re-useable 2022-04-08 11:33:50 +05:30
Kovid Goyal
d0398dca28 Bash shell integration: Fix yet another inconsistent use of SYS_BASHRC
Why Linux distros are constitutionally incapable of using consistent
names and values for anything is beyond me.

Fixes #4934
Fixes #4935
2022-04-07 17:54:52 +05:30
Kovid Goyal
e66c732b41 Forgot to adjust test for new mouse encoding 2022-04-07 17:23:23 +05:30
Kovid Goyal
e7b216ba68 DRYer 2022-04-07 16:24:57 +05:30
Kovid Goyal
838a85ee8b Fix drag event reporting not specifying the current button.
xterm does this, so in the absence of a spec we copy xterm. Fixes #4925
2022-04-07 16:22:26 +05:30
Kovid Goyal
3ec93e0b4e Fix #4932 2022-04-07 15:29:15 +05:30
Kovid Goyal
e8a9bbb51d Merge branch 'fix-inactive-text-alpha' of https://github.com/page-down/kitty
Fixes #4928
2022-04-07 15:16:26 +05:30
pagedown
25c2a0e241 Update cursor focus flag when preparing to render OS window
Fix inactive text alpha always being applied when starting a program
with cursor hidden via session.
2022-04-07 11:48:53 +08:00
Kovid Goyal
de12dddbef Better error message when ripgrep is not found 2022-04-06 16:38:18 +05:30
Kovid Goyal
24eeeedb1f ... 2022-04-05 16:08:24 +05:30
Kovid Goyal
c2bc24de35 Read appearance setting from desktop portal as well 2022-04-05 15:44:27 +05:30
Kovid Goyal
21446e36c1 Restore invalid LANG after trying to get python to set the locale without it 2022-04-04 20:01:01 +05:30
Kovid Goyal
0f734719e7 ... 2022-04-04 19:09:13 +05:30
Kovid Goyal
f3c96f308d Only do update checking in binary builds
Distro packages and source builds will no longer do update checking.
Remove the packaging defaults instructions since they are not needed
any more. The shell integration scripts shouldnt be installed system
wide anyway.
2022-04-04 16:02:38 +05:30
Kovid Goyal
8ff841f1ac ... 2022-04-04 15:34:07 +05:30
Kovid Goyal
709c4abb53 Do not do automatic upgrades of remote kitty
Can be disruptive, since upgrading outputs to the terminal.
Instead updating can be triggerred manually with kitty update-kitty
2022-04-04 14:51:49 +05:30
Kovid Goyal
c1f06941f5 Do not depend on python to install kitty
Now the installer is implemented as pure POSIX sh. This makes it
possible to install kitty on systems without python, easily.
2022-04-04 13:42:20 +05:30
Kovid Goyal
ecb74aed29 ... 2022-04-04 11:05:36 +05:30
Kovid Goyal
c72154782b Simplify getting released kitty version
Also if fetching release version fails and local version exists, use it
2022-04-04 10:22:25 +05:30
Kovid Goyal
9520006466 Dont use alternate screen as it is too disruptive 2022-04-04 07:53:48 +05:30
Kovid Goyal
40f04284d4 Update the text to reflect current support status 2022-04-04 07:51:22 +05:30
Kovid Goyal
832534aac9 Show installation output in alternate screen 2022-04-03 22:13:02 +05:30
Kovid Goyal
6cc89416ce Implement locking for the kitty bootstrap install 2022-04-03 21:53:23 +05:30
Kovid Goyal
b3fc2cb118 Avoid executing kitty just to read installed kitty version 2022-04-03 20:47:02 +05:30
Kovid Goyal
69efd9801b Add a mention of on-demand kitty in the features list 2022-04-03 20:35:48 +05:30
Kovid Goyal
c07f164154 Implement an option to control the installation of the kitty bootstrap script 2022-04-03 20:30:16 +05:30
Kovid Goyal
a2d1140229 Forgot to run gen-config.py after changing default for confirm_os_window_close 2022-04-03 19:57:54 +05:30
Kovid Goyal
bae9b095b4 Start work on kitty launcher for remote servers
This will automatically download kitty and run it. The ssh kitten
can add it to PATH thereby making kitty available on the remote machine
at low cost.
2022-04-03 15:10:20 +05:30
Kovid Goyal
efe6ff6188 Try to ensure builtin command is used 2022-04-03 12:16:13 +05:30
Kovid Goyal
3257fdf24f Merge branch 'master-macos_option_as_alt_docs' of https://github.com/miguno/kitty 2022-04-01 18:27:14 +05:30
Michael G. Noll
3284d71300 Clarify documentation of macos_option_as_alt
See discussion at https://github.com/kovidgoyal/kitty/issues/4908
2022-04-01 14:52:12 +02:00
Kovid Goyal
cdb3e2c1cd Added a version added note for the ssh kitten 2022-04-01 14:23:31 +05:30
Kovid Goyal
57cffc71b7 Fix building on macOS with a non-framework Python
Fixes #289
2022-04-01 07:39:54 +05:30
Kovid Goyal
a4f1caeb4e Missed a couple of actions invocations 2022-04-01 07:31:10 +05:30
Kovid Goyal
45de091ee6 Use versioned actions as master for setup-python is currently broken 2022-04-01 07:19:41 +05:30
Kovid Goyal
00c1802319 Change the default for confirm_os_window_close
Now that the new ssh kitten makes shell integration easy even on remote
servers, it makes sense to change the default behavior to ask for
confirmation when closing windows not at a shell prompt.
2022-03-31 20:33:58 +05:30
Kovid Goyal
02c2d24360 Merge branch 'feat-vis-sel-chars' of https://github.com/page-down/kitty 2022-03-31 15:15:00 +05:30
pagedown
499c255e81 Use the configured chars when visually selecting windows on stack layout
Also list the current active window in the candidates and gray it out to
make sure the order is consistent.
2022-03-31 17:32:10 +08:00
Kovid Goyal
30cad2e0a6 select_tab: Use stable numbers when selecting the tab
Fixes #4792
2022-03-31 13:16:08 +05:30
Kovid Goyal
6e838b83d8 Add a note about how to use a new target tab to --target-tab docs 2022-03-31 12:52:08 +05:30
Kovid Goyal
5297223ee3 Dont use a blank line for empty subtitle 2022-03-31 12:43:28 +05:30
Kovid Goyal
2340d5be8d Merge branch 'ksi-fish' of https://github.com/page-down/kitty 2022-03-30 18:51:16 +05:30
Kovid Goyal
7de1a145aa Merge branch 'docs' of https://github.com/page-down/kitty 2022-03-30 18:44:41 +05:30
pagedown
32426d61c3 Shell integration: Mark fish prompt on cancel or syntax error
The fish_prompt event will not be fired, even if a new prompt has been
drawn.
2022-03-30 20:49:48 +08:00
pagedown
3ce47660a0 Docs: Add instructions for compiling terminfo under macOS 2022-03-30 20:12:18 +08:00
Kovid Goyal
0dff455ffa declare oldval local 2022-03-30 11:57:46 +05:30
Kovid Goyal
81739288e8 handle multiple trailing spaces and semi-colons 2022-03-30 11:54:06 +05:30
Kovid Goyal
5641668bc1 Bash integration: Handle existing PROMPT_COMMAND ending with a literal newline 2022-03-30 10:44:59 +05:30
Kovid Goyal
5c03a52a0b ... 2022-03-29 15:34:34 +05:30
Kovid Goyal
087b52e3e0 Merge branch 'feat-scroll-prompt-to-top' of https://github.com/page-down/kitty 2022-03-29 15:00:46 +05:30
pagedown
733b8e7c1c Update changelog 2022-03-29 17:01:41 +08:00
pagedown
aa83f42f2d Avoid using already defined shortcuts in examples 2022-03-29 16:45:02 +08:00
pagedown
4ed2854791 Add a new standalone action scroll_prompt_to_top
Refactor clear_terminal to move the functions to Window.
Fix the action not scrolling to the bottom when the screen is scrolled.
2022-03-29 16:42:29 +08:00
Kovid Goyal
73cdd87d91 Fix completion for kitty +open 2022-03-29 13:04:55 +05:30
Kovid Goyal
51c8e3b2c6 Add some more debug about scale changes 2022-03-29 09:47:48 +05:30
Kovid Goyal
e522095fae ... 2022-03-26 07:39:16 +05:30
Kovid Goyal
6fc1226028 Merge branch 'fix-overlay-ready' of https://github.com/page-down/kitty 2022-03-26 07:38:01 +05:30
Kovid Goyal
fb40280d3c Use x-shellscript in addition to x-sh
/etc/mime.types uses x-sh and file --mime-type uses x-shellscript. Sigh.
Fixes #4881
2022-03-26 07:35:42 +05:30
pagedown
746cb3684a Eliminate flickering when hints kitten exits 2022-03-25 22:53:38 +08:00
pagedown
16c6545e93 Report overlay ready in case of no match 2022-03-25 22:52:35 +08:00
Kovid Goyal
0c4b20aa4e typo 2022-03-25 16:30:48 +05:30
Kovid Goyal
15e3e8d8b1 typo 2022-03-25 16:18:00 +05:30
Kovid Goyal
6123de52c2 Merge branch 'fix-macos-drop-files' of https://github.com/page-down/kitty 2022-03-25 07:29:07 +05:30
pagedown
3db0aab24b macOS: Fix the path encoding issue from drag and drop files 2022-03-25 09:14:56 +08:00
Kovid Goyal
ae77f696ce Merge branch 'ssh-kitten' of https://github.com/page-down/kitty 2022-03-24 20:14:22 +05:30
pagedown
98369db7f5 Unset shell integration env var before exec command 2022-03-24 22:01:11 +08:00
pagedown
bc9d6892d4 Clean up login shell environment variable earlier
Does not pollute the environment when executing commands.
2022-03-24 22:00:51 +08:00
pagedown
5c02c370d4 ssh kitten: Allow to configure HOME environment variable
Useful if the user does not have a home directory or the directory is
not writable.
2022-03-24 22:00:41 +08:00
pagedown
b944cdddeb ssh kitten: Fix python bootstrap checking zsh rc files with ZDOTDIR 2022-03-24 22:00:16 +08:00
Kovid Goyal
a1d203d34a Clean up paste_actions docs 2022-03-24 17:35:07 +05:30
Kovid Goyal
e151b8e604 Make detection of pasted URLs a little stricter 2022-03-24 17:30:47 +05:30
Kovid Goyal
3c67e991c2 Allow defining actions to take when pasting
Fixes #4873
2022-03-24 17:22:46 +05:30
Kovid Goyal
cb7aed3234 DRYer 2022-03-24 11:54:13 +05:30
Kovid Goyal
ff80b906d0 Report full traceback when highlighting fails 2022-03-24 11:39:31 +05:30
Kovid Goyal
8300436481 Make setting kitten_result more robust 2022-03-24 11:34:12 +05:30
Kovid Goyal
6b13454091 ... 2022-03-24 09:50:50 +05:30
Kovid Goyal
9eae4ad913 ... 2022-03-24 09:37:13 +05:30
Kovid Goyal
bfb8532c52 Jump through the hoops needed to ensure error reporting is done in case of early termination of kittens that use overlay ready notifications 2022-03-24 08:49:36 +05:30
Kovid Goyal
c41405fd57 Merge branch 'ssh-kitten' of https://github.com/page-down/kitty 2022-03-23 18:19:12 +05:30
pagedown
276ba7754a Add ssh kitten URL test 2022-03-23 20:08:50 +08:00
pagedown
8569be81ea ... 2022-03-23 19:49:34 +08:00
pagedown
a765d551e4 Fix bash integration cwd reporting missing hostname 2022-03-23 19:29:18 +08:00
pagedown
4309aa1ace ssh kitten: Fix SSH URL hostname matching 2022-03-23 18:39:27 +08:00
Kovid Goyal
6ef83a09d3 Avoid clearing the screen when exiting a kitten as its not needed any more 2022-03-23 16:06:38 +05:30
Kovid Goyal
adcc616c92 ... 2022-03-23 16:04:01 +05:30
Kovid Goyal
6dc1617429 Avoid flicker when starting kittens such as the hints kitten
Fixes #4674
2022-03-23 15:55:11 +05:30
Kovid Goyal
1837168b0b Micro optimization 2022-03-23 14:51:22 +05:30
Kovid Goyal
1be1864657 Allow sending more than a screenful of output from a kitten
Also Fixes #4866
2022-03-23 14:33:53 +05:30
Kovid Goyal
49c335972f Update padding color on colorprofile pop 2022-03-23 08:35:36 +05:30
Kovid Goyal
aabc99c7bf ... 2022-03-22 21:12:35 +05:30
Kovid Goyal
7c91dc6183 Merge branch 'docs' of https://github.com/page-down/kitty 2022-03-22 21:07:05 +05:30
pagedown
ff8a99211d Docs: Unify and generalize the terms remote computer, machine and host 2022-03-22 23:26:15 +08:00
pagedown
efda0ea455 Docs: Categorize the ssh kitten configuration options and minor tweaks 2022-03-22 23:25:59 +08:00
Kovid Goyal
906be21b8d Make GNOME detection a bit more tolerant 2022-03-22 11:36:09 +05:30
Kovid Goyal
5a36fbfe7b Only move overlay line/pre-edit position when cursor is visible
This might help with #4849
2022-03-22 10:35:55 +05:30
Kovid Goyal
f9f69a0577 ... 2022-03-22 10:28:41 +05:30
Kovid Goyal
8ccbb96b8d Update changelog for last PR
Fixes #4853
2022-03-22 08:22:15 +05:30
Kovid Goyal
8ae7256fd6 Merge branch 'fix-ime' of https://github.com/page-down/kitty 2022-03-22 08:21:31 +05:30
Kovid Goyal
ba401c19c2 Pass mode when opening existing shm buffer 2022-03-21 16:12:26 +05:30
pagedown
11343d42c3 Wayland: Fix backspace cannot clear the last character of pre-edit text 2022-03-21 18:36:35 +08:00
pagedown
6c628bc594 Wayland: Fix IME is not enabled after switching the focus 2022-03-21 18:36:25 +08:00
Kovid Goyal
f6cbca1aeb ... 2022-03-20 14:50:04 +05:30
Kovid Goyal
51e7c8c136 Move the splitting code into python
Less code and more robust
2022-03-20 14:40:02 +05:30
Kovid Goyal
f952694ffd Merge branch 'macos-multi-dirs-here' of https://github.com/page-down/kitty 2022-03-20 14:12:08 +05:30
pagedown
59afdfc4e9 macOS: Allow the New kitty Here services to open multiple folders 2022-03-20 14:51:47 +08:00
Kovid Goyal
27ec1e4b3c Clean up logic for getting CWD 2022-03-18 12:25:01 +05:30
Kovid Goyal
e791a8a7bb Add the SSH kitten to the Changelog 2022-03-18 10:45:16 +05:30
Kovid Goyal
66fe53ceb1 Merge branch 'docs' of https://github.com/page-down/kitty 2022-03-18 09:36:36 +05:30
Kovid Goyal
de3cc11423 Merge branch 'version-check' of https://github.com/page-down/kitty 2022-03-18 09:35:49 +05:30
pagedown
901eae9604 Docs: no-cwd will not disable fish's built-in CWD reporting 2022-03-18 11:10:21 +08:00
pagedown
1962519666 Only write to the OpenSSH version sentinel file once 2022-03-17 22:23:48 +08:00
pagedown
1e84cbe2ab Check macOS less version 2022-03-17 22:23:37 +08:00
Kovid Goyal
06da2b88ff Also check if states are empty 2022-03-17 17:51:21 +05:30
Kovid Goyal
91b9110dcc Workaround for bug in mutter that caused first OS window to not have functional CSD when launched from activities
Fixes #4802
2022-03-17 17:35:56 +05:30
Kovid Goyal
d57abb56ce Dont use remote cwd as child cwd 2022-03-17 16:42:11 +05:30
Kovid Goyal
f6edb774fc Merge branch 'ssh-cwd' of https://github.com/page-down/kitty 2022-03-17 15:34:11 +05:30
pagedown
ec0f3e9128 Allow *_with_cwd to work with ssh kitten when the shell is configured 2022-03-17 16:40:55 +08:00
Kovid Goyal
6f1404d17b typo 2022-03-17 10:59:41 +05:30
Kovid Goyal
3d9e47c295 typo 2022-03-17 10:52:09 +05:30
Kovid Goyal
afa6128155 Implement --cwd=last_reported 2022-03-17 10:29:31 +05:30
Kovid Goyal
72b1996423 Allow different kinds of cwd requests 2022-03-17 10:24:34 +05:30
Kovid Goyal
6b1a9d635e ... 2022-03-17 09:33:12 +05:30
Kovid Goyal
dea79f16d0 Update the how it works section 2022-03-17 09:31:03 +05:30
Kovid Goyal
2d772d7243 ... 2022-03-16 21:42:37 +05:30
Kovid Goyal
09fb246c8f ... 2022-03-16 21:30:16 +05:30
Kovid Goyal
0a5c16363c Fix continued lines not having their continued status reset on line feed
Fixes #4837
2022-03-16 15:20:25 +05:30
Kovid Goyal
b444f4636e Move another function into bootstrap-utils.sh 2022-03-16 07:37:56 +05:30
Kovid Goyal
2b8acebd6e Make bootstrap.sh even smaller 2022-03-16 07:31:33 +05:30
Kovid Goyal
766010c292 ... 2022-03-16 07:27:52 +05:30
Kovid Goyal
0a2768e496 Split up the bootstrap script to keep its size down 2022-03-16 07:17:12 +05:30
Kovid Goyal
0fd7f3f7b5 Merge branch 'ksi' of https://github.com/page-down/kitty 2022-03-16 07:02:18 +05:30
pagedown
d3472966d3 Fix generating terminfo on NetBSD 2022-03-16 09:15:31 +08:00
pagedown
576ab24609 Preserve line breaks to keep the line numbers in error messages 2022-03-16 08:58:50 +08:00
pagedown
621453b068 ... 2022-03-16 01:33:23 +08:00
pagedown
6638546247 Fix generating terminfo on NetBSD
.terminfo.cdb is the compiled terminfo database file.
Ensure that both .terminfo (dir) and .terminfo.cdb are generated.
2022-03-16 01:04:26 +08:00
pagedown
f99edbae3c Reduce bootstrap script size 2022-03-16 01:04:02 +08:00
pagedown
150bf1a5b0 Reduce bootstrap script length by removing comments and indents
dropbear has 9000 bytes limit on ssh arguments length.
2022-03-16 01:03:51 +08:00
pagedown
91a17e3f0c Fall back to use POSIX SHELL environment variable 2022-03-16 01:03:33 +08:00
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
pagedown
736d6cf7e6 Simplify fish prompt state checking 2022-03-16 01:03:16 +08:00
Kovid Goyal
82de6a1c56 DRYer 2022-03-15 22:12:49 +05:30
Kovid Goyal
1fbb4f763e Only check OpenSSH version once on a machine if it is new enough 2022-03-15 22:09:40 +05:30
Kovid Goyal
20582431d6 typo 2022-03-15 21:50:55 +05:30
Kovid Goyal
7d9cf0b064 When at shell prompt use reported cwd 2022-03-15 21:16:49 +05:30
Kovid Goyal
a834f221f1 Unquote paths from file:// URLs
The original iTerm spec for this says the urls are supposed to be
percent escaped
2022-03-15 21:07:36 +05:30
Kovid Goyal
c95dca4023 See if we can make the test more robust 2022-03-15 20:38:02 +05:30
Kovid Goyal
c05c0353fd Dont report directory changes during command substitution 2022-03-15 20:34:18 +05:30
Kovid Goyal
e944e2ecae Make a note that cwd reporting is builtin to fish 2022-03-15 20:33:14 +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
8c6e7ce61a ... 2022-03-15 20:11:27 +05:30
Kovid Goyal
04ead526b9 Presend data on slave connections since for these SSH does not use the TTY 2022-03-15 20:09:05 +05:30
Kovid Goyal
135fb7e6e4 ... 2022-03-15 20:01:23 +05:30
Kovid Goyal
ce1e22ac95 Have *_with_cwd work with the ssh kitten to open new windows auto-logged into the remote server at the current remote working directory 2022-03-15 19:59:16 +05:30
Kovid Goyal
a216f6bd46 ssh doesnt use askpass even if DISPLAY is set
It only uses askpass if not connected to a terminal
2022-03-15 17:27:57 +05:30
Kovid Goyal
c47e5372b5 native askpass should be used when requested 2022-03-15 15:54:48 +05:30
Kovid Goyal
daa673eff1 Make usage of need_to_request_data clearer 2022-03-15 15:51:49 +05:30
Kovid Goyal
5099dd6aa3 Only use kitty's askpass if DISPLAY is set or OpenSSH is new enough to support SSH_ASKPASS_REQUIRE 2022-03-15 15:47:02 +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
Kovid Goyal
946589d1f1 ... 2022-03-15 13:18:07 +05:30
Kovid Goyal
7168ceab94 Make askpass a choice var 2022-03-15 13:14:53 +05:30
Kovid Goyal
868d57b818 ... 2022-03-15 12:00:17 +05:30
Kovid Goyal
6057c57ea4 Fix garbage removal pafter SSH failure not working on macOS when run more than once 2022-03-15 11:57:28 +05:30
Kovid Goyal
e8437fd435 Make reading garbage more robust 2022-03-15 11:51:46 +05:30
Kovid Goyal
9e317971b4 Simplify garbage clear logic 2022-03-15 11:41:59 +05:30
Kovid Goyal
bdb55a02fa ... 2022-03-15 11:40:14 +05:30
Kovid Goyal
02e062af65 Add a mappable action to cleanup shared SSH connections 2022-03-15 11:34:56 +05:30
Kovid Goyal
54c5faa12d Simplify hostname matching
Now that we load the opts upfront, we can have load_config return the
final opts object itself
2022-03-15 11:25:21 +05:30
Kovid Goyal
9b0bd81661 Ignore hostname directives when using overrides 2022-03-15 10:38:03 +05:30
Kovid Goyal
52da68876d Use a zero mtime for data.sh
Its a temp file and that way no chance of the time being in the future
2022-03-15 10:30:15 +05:30
Kovid Goyal
2780630a18 Suppress STDERR for tar 2022-03-15 10:28:14 +05:30
Kovid Goyal
8f77cc65e2 Use a full window object rather than a child PID to get cwd
This allows implementation of more sophisticated algorithmhs
for getting the cwd
2022-03-15 07:58:57 +05:30
Kovid Goyal
7224363639 ... 2022-03-15 07:27:25 +05:30
Kovid Goyal
43851fc1c4 Ignore OSC 6 2022-03-14 22:04:38 +05:30
Kovid Goyal
e33bf11012 Store last reported CWD via OSC 7
Can be used with shell integration to give more accurate
cwd detection and also combined with the ssh kitten
to magically open new windows connected to remote servers
at the correct cwd on the remote server instantly.
2022-03-14 22:00:41 +05:30
Kovid Goyal
0e21376538 Update changelog
Fixes #4831
2022-03-14 20:20:33 +05:30
Kovid Goyal
7a463c1240 Merge branch 'fix-diff-kitten' of https://github.com/page-down/kitty 2022-03-14 20:01:36 +05:30
pagedown
8e03da855f diff kitten: Fix wrong number of scrolling lines after context switch 2022-03-14 20:29:15 +08:00
Kovid Goyal
942881d1b7 Add a ntoe about the importance of askpass 2022-03-14 16:44:12 +05:30
Kovid Goyal
2a50203fcd ... 2022-03-14 13:44:18 +05:30
Kovid Goyal
08ce8ffa54 py2 compat 2022-03-14 12:36:43 +05:30
Kovid Goyal
90561682cf Make using kitty askpass optional 2022-03-14 11:38:31 +05:30
Kovid Goyal
71027e74e0 py2 compat 2022-03-14 11:28:46 +05:30
Kovid Goyal
be8bfbe370 Refactor launch sequence in preparation for optionising it 2022-03-14 10:40:07 +05:30
Kovid Goyal
f7e4447b66 Dont transmit sensitive data unless actually needed 2022-03-13 15:43:14 +05:30
Kovid Goyal
df4e58bc39 Improve disposal of garbage data on ssh failure 2022-03-13 15:37:46 +05:30
Kovid Goyal
441ea7d696 askpass.py should be executable 2022-03-13 14:49:36 +05:30
Kovid Goyal
2b06ca5e1a ssh kitten: Send data without a roundtrip
Send data to the remote side without waiting for a data request. Avoids
an extra roundtrip during initialization.
2022-03-13 13:55:30 +05:30
Kovid Goyal
434ef97952 Dont need atexit anymore since cleanup only closes tty_fd 2022-03-13 13:55:30 +05:30
Kovid Goyal
e1504c4775 Avoid needing to initialize tty state in bootstrap scripts 2022-03-13 13:55:30 +05:30
Kovid Goyal
74f0057ec8 Dont change tty state to raw
Just turn off echo. Makes the code much simpler, can just use shell
builtin POSIX read function.
2022-03-13 13:55:30 +05:30
Kovid Goyal
7cd74cb852 Allow writing memoryview to child 2022-03-13 13:55:30 +05:30
Kovid Goyal
b2e74e4830 Switch to using the hostname from the CLI for settings
This removes the need to wait for data from the remote machine
before sending data to it.
2022-03-13 13:55:30 +05:30
Kovid Goyal
f54a3e8036 Make requesting data optional 2022-03-13 13:55:30 +05:30
Kovid Goyal
f3088c5646 Only try to chmod runtime dir if actually needed 2022-03-13 13:45:03 +05:30
Kovid Goyal
db00adaf69 macOS: Use the POSIX user cache dir as the runtime dir
It's path length is 49 chars which is still too long, but it is at least
well defined.
2022-03-13 06:27:41 +05:30
Kovid Goyal
ea74add814 ssh kitten: Restore terminal state after running ssh 2022-03-12 15:48:52 +05:30
Kovid Goyal
ba1b3c3c2d Fix mypy failures 2022-03-12 08:28:43 +05:30
Kovid Goyal
d5c48ddb94 Allow inputting fingerprint check 2022-03-12 08:23:10 +05:30
Kovid Goyal
9687318b22 Retry reading HEAD commit 2022-03-12 08:14:06 +05:30
Kovid Goyal
f6fb36c58a Merge branch 'fix-icat_typeerror_on_print_window_size' of https://github.com/nertro/kitty 2022-03-12 08:08:32 +05:30
Mena Jacobs
c8a258f36b Fix icat fail on mac with --print-window-size
passing tty as TextIOWrapper to screen_size_function results in a TypeError since the screen_size_function expects an int. calling fileno() on tty gives us the desired int. This also fixes the kitty matplotlib backend, if MPLBACEND_KITTY_SIZING is not set to manual
2022-03-12 02:17:01 +01:00
Kovid Goyal
14e0b01b40 Echo asterisks when inputting the password 2022-03-11 16:44:08 +05:30
Kovid Goyal
76de99a5a8 Use a custom askpass implementation
Keeps OpenSSH from using the tty hopefully allowing us to start sending
data without needing to wait for the remote side to request it.
2022-03-11 16:44:08 +05:30
Kovid Goyal
8613c6e1cd ... 2022-03-11 16:44:08 +05:30
Kovid Goyal
5bb6b29ca3 Allow controlling the prompt used to input the password 2022-03-11 16:44:08 +05:30
Kovid Goyal
61558d518e Get askpass basically working 2022-03-11 16:44:08 +05:30
Kovid Goyal
3b724c8415 Start work on SSH askpass implementation 2022-03-11 16:44:08 +05:30
Kovid Goyal
910565aa7c Mention the shell in the error message 2022-03-11 15:52:51 +05:30
Kovid Goyal
c7a2e060e3 Merge branch 'ksi-ssh' of https://github.com/page-down/kitty 2022-03-11 15:51:16 +05:30
pagedown
740e787f54 ... 2022-03-11 17:28:29 +08:00
pagedown
bd87d50948 Remove the ssh folder in cache_dir 2022-03-11 16:47:03 +08:00
pagedown
d3c0c422a5 Add user uid suffix to tmp runtime dir symlink 2022-03-11 15:42:52 +08:00
pagedown
72718cbab7 Remove login shell name suffix restriction
Some shells do not end with sh, consistent with the python bootstrap
implementation.
2022-03-11 15:42:45 +08:00
pagedown
ea28951e0e Fall back to run the shell without -l option 2022-03-11 15:42:34 +08:00
pagedown
39a78f6be3 Explicitly set STDOUT to binary mode 2022-03-11 15:42:23 +08:00
pagedown
fe8aaca320 Use POSIX LOGNAME environment variable 2022-03-11 15:42:09 +08:00
pagedown
f5cc58ea9d Unset the safe source function in sh script and minor refactoring 2022-03-11 15:41:56 +08:00
Kovid Goyal
44992452cf Fix #4815 2022-03-11 09:42:54 +05:30
Kovid Goyal
f080871911 Update the idiotic design symlink atomically 2022-03-11 07:54:16 +05:30
Kovid Goyal
6789eb88e2 Fix replacement of symlinks to directories 2022-03-11 07:51:50 +05:30
Kovid Goyal
1a97be4a25 Merge branch 'fix-pkg-terminfo' of https://github.com/page-down/kitty 2022-03-11 07:39:25 +05:30
Kovid Goyal
c9ef5c0715 Avoid a race in creating the idiotic_design symlink 2022-03-11 07:37:44 +05:30
pagedown
0a9f8d4f6a Add terminfo src file when packaging
ssh kitten needs to send this file.
2022-03-11 08:35:10 +08:00
Kovid Goyal
cac2c153c2 Fix #4809 2022-03-10 22:55:47 +05:30
Kovid Goyal
f2d6ba8775 Workaround for socket path too long on macOS 2022-03-10 22:50:26 +05:30
Kovid Goyal
92abaad22c Handle cross filesystem untarring in bootstrap.py 2022-03-10 22:43:54 +05:30
Kovid Goyal
3df0194f6e Use a well known runtime dir if XDG_RUNTIME_DIR not available 2022-03-10 22:18:35 +05:30
Kovid Goyal
f774841ee0 More robust copying of terminfo
Dont use symlinks in the tarball, instead create them
in the bootstrap scripts, only if needed.
2022-03-10 21:08:20 +05:30
Kovid Goyal
a9de91087a Add a comment explaining why we dont commit if resized 2022-03-10 20:47:45 +05:30
Kovid Goyal
76a536ece0 On macOS always use the cache dir a runtime dir
Also make the constant parts of the socket name shorter
as there is a 104 bytes limit on it in macOS SSH.
2022-03-10 20:12:40 +05:30
Kovid Goyal
719339e116 Output debug info about CSD rendering 2022-03-10 19:45:31 +05:30
Kovid Goyal
1c3910de5c Output debug info about resized being called 2022-03-10 19:32:17 +05:30
Kovid Goyal
39d3ef6fe8 Output debug for decoration configure when it happens 2022-03-10 17:59:54 +05:30
Kovid Goyal
064d0fa6f1 Merge branch 'wayland-fixes' of https://github.com/Nefsen402/kitty 2022-03-10 17:37:29 +05:30
Alexander Orzechowski
99a5843595 wayland: Don't commit the surface on a resize
This fixes weirdness with GNOME.

On a resize, we will schedule a new frame anyway which will commit
the wl_surface for us anyway. If we don't resize, we'll commit
to stay true to the wayland spec.
2022-03-10 06:02:22 -05:00
Alexander Orzechowski
39e75e39e8 wayland: Correctly handle xdg decoration configures
Much like toplevel configures, xdg decoration configures only take
effect once the xdg shell configure comes through. Also,
let's get rid of some double computations because we unified the code
paths.
2022-03-10 06:01:50 -05:00
Alexander Orzechowski
322a80e76e wayland: track configures through a bit field
This will let us add more stuff later. Also, it's a better spot
to put the bit field outside of the {current, pending} struct as
the bit field doesn't make any sense if it's part of the `current`
values.
2022-03-10 05:56:56 -05:00
Alexander Orzechowski
d4b048735d wayland: Fix CSD size calculations
This is a partial revert of e359094cff

window->wl.{width, height} and window->wl.current.{width, height}
represent different things. The former represents the actual size of the
egl surface viewport used for terminal rendering. The former represents
the size of the entire window including the CSD (client side decorations).

These numbers should be the same if CSD is disabled.
2022-03-10 05:56:56 -05:00
Kovid Goyal
c23e04fd03 DRYer 2022-03-10 15:37:10 +05:30
Kovid Goyal
f67009f554 Flush the write to shm explicitly 2022-03-10 15:01:58 +05:30
Kovid Goyal
4013544efb Cleanup control master sockets in parallel 2022-03-10 12:59:38 +05:30
Kovid Goyal
31d9db7e74 Use XDG_RUNTIME_DIR to store control master sockets
On Linux this has the advantage that the dir is auto cleaned on reboot
2022-03-10 12:51:21 +05:30
Kovid Goyal
384c56f834 When using control masters also enable keep alives
Prevents the master connection from becoming stale. Use ssh protocol
keep alives rather than tcp ones as tcp ones are often blocked by
firewalls and also spoofable.
2022-03-10 11:48:36 +05:30
Kovid Goyal
3282c8200d Dont print to stderr when shutting down master connections at exit 2022-03-10 11:22:46 +05:30
Kovid Goyal
ffbc9174f8 We dont change shell rc files anymore 2022-03-10 11:01:59 +05:30
Kovid Goyal
dceb00f669 typo 2022-03-10 11:00:58 +05:30
Kovid Goyal
920086ae88 unlink SHM file at end of each individual test 2022-03-10 10:57:36 +05:30
Kovid Goyal
a1311a2332 ... 2022-03-10 10:48:08 +05:30
Kovid Goyal
4c392426f6 Get shared memory based data transfer working 2022-03-10 10:46:04 +05:30
Kovid Goyal
4528173ff5 Max length for SHM names on Apple is 30!
Bloody CrApple
2022-03-10 07:37:57 +05:30
Kovid Goyal
d3b63a9c45 Cleanup attribute access 2022-03-10 07:30:05 +05:30
Kovid Goyal
c30a249cf6 Use longer random names for SHM to make double unlink safe 2022-03-10 07:24:39 +05:30
Kovid Goyal
20962d989f Use POSIX shm to pass ssh data to kitty 2022-03-10 06:55:21 +05:30
Kovid Goyal
a1e4b19486 ... 2022-03-10 06:34:50 +05:30
Kovid Goyal
fd0262413e Access to POSIX shared memory from Python 2022-03-10 06:30:03 +05:30
Kovid Goyal
aa4d36cc57 Use secrets to generate the random password 2022-03-10 06:11:58 +05:30
Kovid Goyal
8d119f06b3 Force restrictive permissions on file used to pass ssh data to kitty 2022-03-10 05:30:47 +05:30
Kovid Goyal
708c5126b9 Return the data cookie settings when generating the bootstrap script 2022-03-09 22:18:04 +05:30
Kovid Goyal
577de9f746 ssh kitten: Start work on connection sharing
Basic sharing works. Now investigate if we can eliminate the round-trip
latency by transmitting the data without waiting for the start message
when using a shared connection
2022-03-09 19:27:38 +05:30
Kovid Goyal
38a70f5b51 ... 2022-03-09 15:31:19 +05:30
Kovid Goyal
118306a9ff Avoid an extra process hanging around when running the interpreter on the remote machine 2022-03-09 15:29:57 +05:30
Kovid Goyal
704717ff1d Handle case of tty not being OK 2022-03-09 15:27:24 +05:30
Kovid Goyal
405c472d13 Cleanup previous PR 2022-03-09 14:59:08 +05:30
Kovid Goyal
17c994db57 Merge branch 'ksi-ssh' of https://github.com/page-down/kitty 2022-03-09 14:39:28 +05:30
Kovid Goyal
e227264bad Nicer error message when failing to load FreeType face 2022-03-09 14:28:38 +05:30
Kovid Goyal
8751ea79e7 Clear python error flag when loading fallback face fails 2022-03-09 14:16:56 +05:30
pagedown
3b3ffa7455 Docs: Update support for non-POSIX shell tcsh (csh) 2022-03-09 16:12:28 +08:00
pagedown
4322825ac7 Add support for sh that does not support the -l login shell option
FreeBSD sh does not support using the -l option to run as a login shell.
2022-03-09 16:12:20 +08:00
pagedown
d29fa7b382 ssh kitten: Add FreeBSD tcsh (csh) support
Replace line feeds and exclamation marks for tcsh compatibility.
2022-03-09 16:11:58 +08:00
Kovid Goyal
08bb63fa92 Ensure tdir is deleted on exit 2022-03-09 13:24:24 +05:30
Kovid Goyal
5dde31f80c DRYer 2022-03-09 11:52:36 +05:30
Kovid Goyal
3bb869f725 Also test launching of bootstrap.py 2022-03-09 11:32:14 +05:30
Kovid Goyal
11686b90f7 ... 2022-03-09 11:30:34 +05:30
Kovid Goyal
6df78fa67c Add tests with different shells used as launchers 2022-03-09 11:29:06 +05:30
Kovid Goyal
53b1607c4d When testing ssh kitten launch the bootscrapt script the same way sshd does it 2022-03-09 11:25:02 +05:30
Kovid Goyal
2341a27f63 ... 2022-03-08 23:05:42 +05:30
Kovid Goyal
0661caf9da DRYer 2022-03-08 23:04:58 +05:30
Kovid Goyal
5b5bd77c53 ssh kitten: Fix not working when user's login shell is fish 2022-03-08 22:39:31 +05:30
Kovid Goyal
d36f6b39c7 Fix previous PR 2022-03-08 21:29:09 +05:30
Kovid Goyal
b2a5b07f92 Merge branch 'ksi' of https://github.com/page-down/kitty 2022-03-08 21:29:05 +05:30
pagedown
46889a3a32 Fix shell integration being disabled with one invalid option 2022-03-08 23:42:41 +08:00
Kovid Goyal
958ebb72a6 DRYer 2022-03-08 20:48:37 +05:30
Kovid Goyal
febc5c53a6 Get the python interpreter working with non-POSIX login shells 2022-03-08 20:44:29 +05:30
Kovid Goyal
6e921300e2 Let ssh concat the cli args for us 2022-03-08 19:49:25 +05:30
Kovid Goyal
e167dec8a9 Note that on FreeBSD the login shell needs to be changed as well 2022-03-08 19:31:02 +05:30
Kovid Goyal
0019f07cc0 Fix interpreter opt target 2022-03-08 19:25:11 +05:30
Kovid Goyal
20fc1e6b0c Add a note about BSD servers 2022-03-08 18:23:44 +05:30
Kovid Goyal
908946a067 Merge branch 'ksi-ssh' of https://github.com/page-down/kitty 2022-03-08 11:37:40 +05:30
pagedown
f1df7b1c1f Use Python in preference to Perl 2022-03-08 13:59:32 +08:00
Kovid Goyal
65b9c69bd8 Use python in preference to perl
I know how to make python code robust, no clue about perl.
2022-03-08 11:05:02 +05:30
Kovid Goyal
b91e47c3b6 Merge branch 'ksi-ssh' of https://github.com/page-down/kitty 2022-03-08 10:30:11 +05:30
pagedown
0e3a11c53b Use Perl in bootstrap.sh if available 2022-03-08 12:28:09 +08:00
pagedown
53d8d2aaad Use the more explicit b64encode
Fix using ssh kitten to connect to OpenBSD.
2022-03-08 12:19:57 +08:00
Kovid Goyal
84303cbf2e Use head -c only if available 2022-03-07 21:48:06 +05:30
Kovid Goyal
5e457da30b Only use bz2 compression if bzip2 is available 2022-03-07 20:44:26 +05:30
Kovid Goyal
855718b179 ssh kitten: match hostnames against both remote hostname and hostname used on the command line to connect to it 2022-03-07 20:32:02 +05:30
Kovid Goyal
d037c0b0fc OpenBSD compat 2022-03-07 20:14:02 +05:30
Kovid Goyal
90f5937413 Forgot to use the actual python variable 2022-03-07 19:41:18 +05:30
Kovid Goyal
cbbea37b0c ... 2022-03-07 19:37:30 +05:30
Kovid Goyal
4d74b23f20 Merge branch 'ksi-bash' of https://github.com/page-down/kitty 2022-03-07 19:26:56 +05:30
Kovid Goyal
79dd26a43a ... 2022-03-07 18:38:06 +05:30
Kovid Goyal
259e3076fa Ensure python is searched for only once 2022-03-07 18:36:56 +05:30
Kovid Goyal
f2cb2422f0 Use python when base64 is not available 2022-03-07 18:34:02 +05:30
pagedown
4aea64261e ... 2022-03-07 20:56:02 +08:00
pagedown
cf0cd9acd9 Remove trailing semicolons 2022-03-07 20:53:35 +08:00
pagedown
b4b0bdc853 DCS @ kitty-print should be output to STDERR 2022-03-07 20:49:18 +08:00
pagedown
0b2837fcfa Fix bash integration debug log printing 2022-03-07 20:43:14 +08:00
Kovid Goyal
f20ad7df01 Better error message when base64 is not found 2022-03-07 18:12:01 +05:30
Kovid Goyal
c9071a66ca ssh kitten: Add an option to change the cwd at login 2022-03-07 12:24:37 +05:30
Kovid Goyal
b0ea960159 Dont use --no-same-owner when extracting tar archives
This flag is missing on OpenBSD and is the default on other platforms
when extracting as non-root. Make the uname/gname taringo field empty so
when extracting as root files will always be owned by root.
2022-03-07 12:10:45 +05:30
Kovid Goyal
0e7f1d60d6 Have bootstrap.sh preserve file permissions when untarring 2022-03-07 11:45:14 +05:30
Kovid Goyal
03c79502f9 Use uname -m for hostname in bootstrap.sh if needed 2022-03-07 11:24:44 +05:30
Kovid Goyal
d4d4e00f9d Merge branch 'ksi' of https://github.com/page-down/kitty 2022-03-07 11:18:15 +05:30
Kovid Goyal
b52e5e795e Dont use a double quote in bootstrap.py 2022-03-07 11:11:10 +05:30
Kovid Goyal
68df13d3fe Fix recursive definitions in env vars not expanded 2022-03-07 11:07:26 +05:30
pagedown
5f3d90e411 ... 2022-03-07 12:39:49 +08:00
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
817ac82968 Detect SSH sessions without affecting performance
Exclude local runs by KITTY_PID.
Check KITTY_WINDOW_ID to detect connections via ssh kitten.
Check SSH via who -m with the integration manually installed and sudo.
2022-03-07 12:00:55 +08:00
pagedown
43fd8cb13c Unify exec function definition order 2022-03-07 11:36:52 +08:00
pagedown
397fbe7ad3 Avoid unnecessary which and fix typos 2022-03-07 11:30:12 +08:00
pagedown
3095e7a256 Remove trailing semicolons 2022-03-07 11:25:22 +08:00
pagedown
df9e893cbe Explicitly use builtin and command 2022-03-07 11:24:18 +08:00
Kovid Goyal
6ff69c88df ... 2022-03-07 06:58:14 +05:30
Kovid Goyal
6e4d3c98da Ensure pw file is cleaned up on kitten exit
This way it is cleaned up even if ssh fails
2022-03-07 06:54:11 +05:30
Kovid Goyal
2404eba11f ssh kitten: Passthrough to ssh if run outside of kitty
Also, ensure that the ssh data request is only served if it is received
over the tty of the correct kitty window.
2022-03-07 06:48:18 +05:30
Kovid Goyal
e5c57a679d Some more docs for the SSH kitten 2022-03-07 06:26:50 +05:30
Kovid Goyal
33de55540b 2nd which unneccesary 2022-03-06 22:25:03 +05:30
Kovid Goyal
99e1605bba Use the correct which implementation
Same one as used by child.py
2022-03-06 21:54:56 +05:30
Kovid Goyal
95c4e26b24 macOS: When using Apple's less as the pager for viewing scrollback strip out OSC codes as Apple's less cant parse them
Fixes #4788
2022-03-06 21:52:59 +05:30
Kovid Goyal
795953a341 get rid of the who -m ssh session test
I dont like executing a binary in a fast startup script. Lets see
if there are a lot of sessions in the wild that dont use the SSH_TTY
env var
2022-03-06 15:47:08 +05:30
Kovid Goyal
75d5e386d3 Make the integration tests more strict
Actually assert that there are/are not prompt marking bytes in the data
received by the pty
2022-03-06 15:35:24 +05:30
Kovid Goyal
00d2a8527f Fix parsing of env vars in bootstrap.py 2022-03-06 15:05:40 +05:30
Kovid Goyal
a1ade8fc42 Dont use format strings in bootstrap.py 2022-03-06 14:47:44 +05:30
Kovid Goyal
7f9fec061a bootstrap.py is now tested the same as bootsstrap.sh 2022-03-06 14:26:15 +05:30
Kovid Goyal
ec782d3296 More work on bootstrap.py 2022-03-06 13:23:30 +05:30
Kovid Goyal
2444864508 Make compiling of terminfo atomic 2022-03-06 13:04:57 +05:30
Kovid Goyal
1ccc50b21b More work on bootstrap.py 2022-03-06 12:55:36 +05:30
Kovid Goyal
4552a474b7 Make the no-integration test more comprehensive and stronger 2022-03-06 12:23:11 +05:30
Kovid Goyal
85c6d8f16e More robust check for exec -a support 2022-03-06 12:20:06 +05:30
Kovid Goyal
14d391cc2e Check $pipestatus for zsh as well 2022-03-06 11:43:33 +05:30
Kovid Goyal
8fe87a0df5 Search PATH when executing login shell 2022-03-06 11:13:40 +05:30
Kovid Goyal
ff01df3b16 Dont byte compile the bootstrap script during build 2022-03-06 10:54:58 +05:30
Kovid Goyal
c713dc0ca8 Allow using a --kitten argument with the ssh kitten to make it easier to override settings from ssh.conf 2022-03-06 10:07:46 +05:30
Kovid Goyal
31ea5d74a7 Exclude junk directories when adding user files as well 2022-03-06 10:00:02 +05:30
Kovid Goyal
31b01d42c0 use inherited instead of inherit 2022-03-06 09:54:33 +05:30
Kovid Goyal
482b853908 Add a note about typing before the prompt being lost 2022-03-05 15:49:21 +05:30
Kovid Goyal
675411df85 Start work on python bootstrap 2022-03-05 15:43:55 +05:30
Kovid Goyal
f94d33fa6a ... 2022-03-05 15:29:09 +05:30
Kovid Goyal
7fe110dff1 Move code to initialize TTY into its own function 2022-03-05 15:16:04 +05:30
Kovid Goyal
591f711886 DRYer 2022-03-05 15:10:09 +05:30
Kovid Goyal
1dc7fc8ac7 Note that zsh's read function is terminally broken 2022-03-05 14:56:57 +05:30
Kovid Goyal
ffa79d731c Allow configuring the ssh kitten via env vars 2022-03-05 12:29:55 +05:30
Kovid Goyal
01dd0416ac Add an option to control the login shell 2022-03-05 11:16:15 +05:30
Kovid Goyal
0bd1676978 Some cleanup 2022-03-05 10:58:42 +05:30
Kovid Goyal
f3407959a6 Start work on python bootstrap script 2022-03-05 10:54:21 +05:30
Kovid Goyal
30e635a934 Use zsh's builtin functions to do I/O with TTY
Far more robust than the system tools
2022-03-05 10:31:00 +05:30
Kovid Goyal
f6706a55ec ... 2022-03-05 09:20:08 +05:30
Kovid Goyal
f0b79f88b2 Merge branch 'fix-copy-or-interrupt' of https://github.com/page-down/kitty 2022-03-05 08:08:40 +05:30
Kovid Goyal
262ba0197d Allow using - as a synonym for /dev/stdin when reading the config 2022-03-05 08:07:32 +05:30
pagedown
31c2447fb8 Fix not scrolling to the bottom when an interrupt is sent
Replicates the same side effects of keyboard key event.
2022-03-05 10:25:49 +08:00
Kovid Goyal
54a4ebfe48 Merge branch 'dte-kbd-proto' of https://github.com/craigbarnes/kitty 2022-03-05 07:51:13 +05:30
Craig Barnes
106c7a1706 Mention dte text editor in list of apps in docs/keyboard-protocol.rst 2022-03-04 23:56:17 +00:00
Kovid Goyal
e469b46ce5 Avoid calling who is either of SSH_TTY or SSH2_TTY are defined 2022-03-04 21:40:24 +05:30
Kovid Goyal
0c79561977 Fix the ssh_copy test on macOS 2022-03-04 21:31:13 +05:30
Kovid Goyal
9e82397de9 Merge branch 'test-ksi-fish' of https://github.com/page-down/kitty 2022-03-04 21:22:02 +05:30
pagedown
7c166e2194 Try to make the fish vi cursor test more stable 2022-03-04 23:46:39 +08:00
Kovid Goyal
0a2b09da40 Prevent inject loop 2022-03-04 21:12:41 +05:30
Kovid Goyal
c02d578468 Nicer error message if bash version < 4
macOS has bash 3
2022-03-04 20:59:22 +05:30
Kovid Goyal
e990d233e5 ooops 2022-03-04 20:54:26 +05:30
Kovid Goyal
a7cdcfcc16 Bash integration: Prevent shell integration code from running twice if user enables both automatic and manual integration 2022-03-04 20:48:57 +05:30
Kovid Goyal
75224e1661 Merge branch 'ksi-bash' of https://github.com/page-down/kitty 2022-03-04 20:37:05 +05:30
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
pagedown
c8313409ff Explicitly call bash builtin 2022-03-04 19:36:38 +08:00
Kovid Goyal
6cba8e0166 remove unused variable 2022-03-04 14:52:55 +05:30
Kovid Goyal
0067726bbe spelling 2022-03-04 13:52:33 +05:30
Kovid Goyal
ce620cec0a Use a memoryview to avoid memcopies 2022-03-04 13:41:23 +05:30
Kovid Goyal
e797ba4800 Allow matching on hostname and username 2022-03-04 12:42:31 +05:30
Kovid Goyal
fe27ee2d79 Allow configuring the interpreter to use on the remote host 2022-03-04 12:18:27 +05:30
Kovid Goyal
95efeee7de Also return user name when requesting bootstrap data 2022-03-04 12:16:45 +05:30
Kovid Goyal
da30536709 bash/zsh integration: Show hostname in title when in an SSH session 2022-03-04 11:13:59 +05:30
Kovid Goyal
108ccffcd8 assume grep is present 2022-03-04 10:13:23 +05:30
Kovid Goyal
c3ce0c26e7 ... 2022-03-04 10:01:33 +05:30
Kovid Goyal
e0c984046c EXEC_CMD must come after login_shell detection since it can use login_shell 2022-03-04 10:00:12 +05:30
Kovid Goyal
64d6337612 ... 2022-03-04 09:54:17 +05:30
Kovid Goyal
603684211f bootstrap should not fail if no tty present 2022-03-04 08:30:23 +05:30
Kovid Goyal
499b30d175 Allow specifying multiple matching hostnames 2022-03-04 07:23:35 +05:30
Kovid Goyal
3f3efab221 Fix hostname detection when hostname binary not present 2022-03-04 07:22:59 +05:30
Kovid Goyal
ef9adc92c8 Note on how to use include for DRYer config 2022-03-04 07:13:56 +05:30
Kovid Goyal
ad7c251f56 Fix ln failing if link exists 2022-03-04 07:08:04 +05:30
Kovid Goyal
1c0d254ec6 More ssh kitten docs 2022-03-04 07:03:38 +05:30
Kovid Goyal
f1ce8c0e8a Add some docs for the ssh kitten 2022-03-03 22:37:24 +05:30
Kovid Goyal
1c558be524 Port HISTFILE fix to ssh bash launcher 2022-03-03 21:24:45 +05:30
Kovid Goyal
7d653cb7bf Allow copying the same file to multiple locations 2022-03-03 21:24:45 +05:30
Kovid Goyal
b4cc38a1d9 Fix symlink extraction over ssh 2022-03-03 21:24:45 +05:30
Kovid Goyal
8867317b6a Allow transferring files outside of HOME 2022-03-03 21:24:45 +05:30
Kovid Goyal
4b6bfaffba More work on ssh copy 2022-03-03 21:24:45 +05:30
Kovid Goyal
fadae42715 Work on parsing copy instructions 2022-03-03 21:24:45 +05:30
Kovid Goyal
77c9affc00 Start work on copy instructions 2022-03-03 21:24:45 +05:30
Kovid Goyal
e5ba15949b $size doesnt need to be global 2022-03-03 21:24:45 +05:30
Kovid Goyal
a3e59697a1 ... 2022-03-03 21:24:45 +05:30
Kovid Goyal
0e2125cda3 When die-ing bring cursor back to zero column explicitly since it could happen in raw mode 2022-03-03 21:24:45 +05:30
Kovid Goyal
95da414511 Avoid one record read 2022-03-03 21:24:45 +05:30
Kovid Goyal
c0d5ace640 Prevent invalid root paths 2022-03-03 21:24:45 +05:30
Kovid Goyal
ae48407b20 untar files atomically 2022-03-03 21:24:45 +05:30
Kovid Goyal
e06bd68379 Split up ssh tests 2022-03-03 21:24:45 +05:30
Kovid Goyal
ae6665493a Implement setting of env vars 2022-03-03 21:24:44 +05:30
Kovid Goyal
c6f37afeff Add config to control shell integration per host 2022-03-03 21:24:44 +05:30
Kovid Goyal
59f656e3ca Allow controlling where on the remote computer the ssh kitten installs its data 2022-03-03 21:24:44 +05:30
Kovid Goyal
12658c4756 Make ssh data start request transmission more robust 2022-03-03 21:24:44 +05:30
Kovid Goyal
37c185462a Handle error messages form terminal during bootstrap 2022-03-03 21:24:44 +05:30
Kovid Goyal
53c8485a7a Get env conf working with tests 2022-03-03 21:24:44 +05:30
Kovid Goyal
846021296f Start work on config infrastructure for ssh kitten 2022-03-03 21:24:44 +05:30
Kovid Goyal
5c8651c7cd bootstrap script should work even when stdout is redirected 2022-03-03 21:24:44 +05:30
Kovid Goyal
ad91f5af53 ... 2022-03-03 21:24:44 +05:30
Kovid Goyal
02a68e7541 Pass the value of shell_integration in the tarfile
Allows per host overrides and also avoids needing to read kitty.conf in
the ssh kitten
2022-03-03 21:24:44 +05:30
Kovid Goyal
6e5dbc5285 Test for handling of leading data 2022-03-03 21:24:44 +05:30
Kovid Goyal
fda9415873 Use a record separator to delimit the start of data
Needed because the user could press keys and send data to the tty
before kitty can send the ssh data
2022-03-03 21:24:44 +05:30
Kovid Goyal
4054163447 DRYer 2022-03-03 21:24:44 +05:30
Kovid Goyal
e1f5ef59c8 Remove integration tests with login_shell=''since that is tested explicitly before 2022-03-03 21:24:44 +05:30
Kovid Goyal
44baeb6924 Run login_shell detection tests with all available shells 2022-03-03 21:24:44 +05:30
Kovid Goyal
c00e8b1709 Add tests for the individual login_shell detection functions 2022-03-03 21:24:44 +05:30
Kovid Goyal
3fb7ce7100 When using KITTY_DEVELOP_FROM load resources from the develop dir 2022-03-03 21:24:44 +05:30
Kovid Goyal
86b15ad693 fix detection of python when no python2 or python3 links present 2022-03-03 21:24:43 +05:30
Kovid Goyal
53c00ac631 Fix detection of login shell from passwd 2022-03-03 21:24:43 +05:30
Kovid Goyal
99d0c2d846 Get reading data working on macOS 2022-03-03 21:24:43 +05:30
Kovid Goyal
55ede897b9 faster fail 2022-03-03 21:24:43 +05:30
Kovid Goyal
a71e7d7eb1 Simplify data transmission 2022-03-03 21:24:43 +05:30
Kovid Goyal
3c28a4f723 sh on macOS doesnt have echo -n 2022-03-03 21:24:43 +05:30
Kovid Goyal
6b681df473 Include all terminfo variants in binary bundles
Needed so that they can be transmitted over ssh easily
2022-03-03 21:24:43 +05:30
Kovid Goyal
22c1ee7dc8 Cannot call the parser from callbacks that are themselves called from the parser 2022-03-03 21:24:43 +05:30
Kovid Goyal
c24e16e8cd debug function 2022-03-03 21:24:43 +05:30
Kovid Goyal
d452a5cdce ... 2022-03-03 21:24:43 +05:30
Kovid Goyal
198dd52700 Better error messages 2022-03-03 21:24:43 +05:30
Kovid Goyal
2dfea0f213 Fix a couple of conditions so they work in older dash 2022-03-03 21:24:43 +05:30
Kovid Goyal
5064b5c2b1 Apparently posh on CI is utterly broken 2022-03-03 21:24:43 +05:30
Kovid Goyal
78b553e55e Add tests for turning off shell integration in the bootstrap script 2022-03-03 21:24:43 +05:30
Kovid Goyal
8ca3a511cc Get the ssh bootstrap tests fully working 2022-03-03 21:24:43 +05:30
Kovid Goyal
bf26a3f569 Skip bash if its too old when testing bootstrap script 2022-03-03 21:24:43 +05:30
Kovid Goyal
ddb8753548 Work on enabling shell integration over ssh 2022-03-03 21:24:43 +05:30
Kovid Goyal
e73525d0a2 Start work on testing the bootstrap script 2022-03-03 21:24:43 +05:30
Kovid Goyal
f37d947dd5 more work on ssh data transmission 2022-03-03 21:24:42 +05:30
Kovid Goyal
4279f20daf Dont depend on the default bash prompt when testing 2022-03-03 21:24:42 +05:30
Kovid Goyal
2dd7c3b939 More work on ssh bootstrap 2022-03-03 21:24:42 +05:30
Kovid Goyal
cf01480ec8 An echo escape code to echo data via the TTY 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
1c0a8a49fc Merge branch 'fix-nerd-fonts' of https://github.com/page-down/kitty 2022-03-03 14:41:46 +05:30
pagedown
16298e49c7 Update Unicode input kitten names 2022-03-03 16:45:07 +08:00
pagedown
abb0b95006 Add some reasonable keywords from font awesome official aliases
These glyphs can be searched by name when using Unicode input kitten.
2022-03-03 16:44:56 +08:00
pagedown
32f5ea7b63 Fix overlapping nerd fonts glyph 2022-03-03 16:29:29 +08:00
Kovid Goyal
90ed5959de version 0.24.4 2022-03-03 10:54:01 +05:30
Kovid Goyal
d999cc4143 Merge branch 'patch-1' of https://github.com/rqel/kitty 2022-03-03 08:03:25 +05:30
Kovid Goyal
6c1d8d5c63 Add instructions on where to get the NERD font 2022-03-03 08:01:36 +05:30
rqel
a316242a4b Update symbol_map unicode codepoint range for Symbols Nerd Font
Signed-off-by: rqel <rqel@pm.me>
2022-03-02 18:19:13 -08:00
Kovid Goyal
a4ae090c37 commit surface even for out of order configures 2022-03-03 07:18:04 +05:30
Kovid Goyal
abdcc64053 Merge branch 'always-commit' of https://github.com/Nefsen402/kitty 2022-03-03 07:16:50 +05:30
Alexander Orzechowski
ac407d42de wayland: always commit surface on configure 2022-03-02 14:43:49 -05:00
rqel
19c4a3f0a8 Add U+E0CA
Signed-off-by: rqel <rqel@pm.me>
2022-03-02 07:07:05 -08:00
rqel
3afd96d421 Update symbol_map
Signed-off-by: rqel <rqel@pm.me>
2022-03-02 06:37:18 -08:00
Kovid Goyal
f421666a27 Nicer error message when importing a kitten fails 2022-03-02 08:26:06 +05:30
Kovid Goyal
af6baa33be Ignore out of order surface configure events 2022-03-01 07:59:17 +05:30
Kovid Goyal
1096cbe236 Use an anonymous struct 2022-03-01 07:46:45 +05:30
Kovid Goyal
998be9b90c Merge branch 'wayland-fix-configure' of https://github.com/Nefsen402/kitty 2022-03-01 07:45:24 +05:30
Alexander Orzechowski
854cb8f27e wayland: handle resize requests after acknowledging the configure
The wayland protocol requires that clients commit a new buffer sometime
after `xdg_surface_ack_configure`.
2022-02-28 19:42:11 -05:00
Alexander Orzechowski
e359094cff wayland: move window state 2022-02-28 19:42:11 -05:00
Kovid Goyal
db57230987 Cleanup changelog 2022-02-28 20:47:08 +05:30
Kovid Goyal
4de3cecbbe Update changelog for previous PR
Fixes #4763
2022-02-28 20:21:06 +05:30
Kovid Goyal
c37a8bd3b1 Merge branch 'fix-read-scr-size' of https://github.com/page-down/kitty 2022-02-28 20:19:44 +05:30
Kovid Goyal
e103b280fd Add test for HISTFILE 2022-02-28 20:09:54 +05:30
pagedown
2235ea67e2 Fix ScreenSizeGetter 2022-02-28 22:39:19 +08:00
Kovid Goyal
1f6a4f7bd4 ... 2022-02-28 20:07:57 +05:30
Kovid Goyal
8c7ffc90f3 Fix the default bash HISTFILE changing to .sh_history instead of .bash_history
Fixes #4765
2022-02-28 20:06:48 +05:30
Kovid Goyal
29d85833f1 Merge branch 'ksi-fish' of https://github.com/page-down/kitty 2022-02-28 17:50:05 +05:30
pagedown
74c56d69ac Also fall back to check the last known working version of fish 2022-02-28 19:26:20 +08:00
Kovid Goyal
cf520646a9 Merge branch 'feat-launch-url-err' of https://github.com/page-down/kitty 2022-02-28 13:12:14 +05:30
pagedown
da5213346a show_error kitten: Use green color for closing tips 2022-02-28 15:02:16 +08:00
pagedown
bdcb98eafc Use show_error kitten to display launch URL error messages 2022-02-28 15:02:05 +08:00
Kovid Goyal
ef637cd7d3 ... 2022-02-28 11:28:42 +05:30
Kovid Goyal
dbbabd73c5 Repeat hold message on ctrl+c/d instead of completely ignoring or ending hold 2022-02-28 11:17:00 +05:30
Kovid Goyal
436ef0074a DRYer 2022-02-28 11:08:32 +05:30
Kovid Goyal
0904dec810 Fix exception on ctrl+c exit of program under --hold 2022-02-28 11:02:06 +05:30
Kovid Goyal
0aa07ead7e Bundle wayland client libraries in the binary build
The version of libwayland kitty builds against is now 1.20 and this
introduces the new wl_proxy_marshal_flags function. The usual suspect
distros have too old libwayland-client so we need to bundle.

Fixes #4760
2022-02-28 10:27:44 +05:30
Kovid Goyal
d87cac87ff version 0.24.3 2022-02-28 08:00:18 +05:30
Kovid Goyal
7e8c96896f Do a shutdown and rebuild 2022-02-28 07:21:46 +05:30
Kovid Goyal
2619db0e58 Cleanup previous PR 2022-02-27 21:31:39 +05:30
Kovid Goyal
ee3632b85d Merge branch 'ksi-zsh' of https://github.com/page-down/kitty 2022-02-27 21:31:31 +05:30
pagedown
1c88c13fc2 Shell integration: Try to get ZDOTDIR from /etc/zshenv when no RC files 2022-02-27 23:25:26 +08:00
Kovid Goyal
7f476eb924 Merge branch 'test-ksi-zsh' of https://github.com/page-down/kitty 2022-02-27 18:30:13 +05:30
pagedown
2d4f7e3446 Disable system startup files in zsh integration test with --noglobalrcs 2022-02-27 20:21:05 +08:00
Kovid Goyal
165c1240a9 Make the test a little more robust 2022-02-27 11:04:12 +05:30
Kovid Goyal
ef5c66ee17 Dont bother with new escape code for setting title
Since we are only sending the last command, it cannot have CSI
sequences in it anyway except in extremely contrived situations, so just
strip all ctrl chars out.
2022-02-27 10:55:02 +05:30
Kovid Goyal
33abd31d1a ... 2022-02-27 10:48:52 +05:30
Kovid Goyal
f91463a494 Also add test for handling of control chars in zsh title reporting 2022-02-27 10:47:23 +05:30
Kovid Goyal
30146007d3 Avoid extra tr invocation 2022-02-27 10:23:04 +05:30
Kovid Goyal
d53f8f24c4 Fix #4757
Still have to do the fix for zsh/fish
2022-02-27 10:20:19 +05:30
Kovid Goyal
f9621b1e11 Merge branch 'fix-ksi-fish' of https://github.com/page-down/kitty 2022-02-27 09:32:37 +05:30
pagedown
e2f16ff624 Add fish pipestatus integration tests and changelog entries 2022-02-27 00:27:31 +08:00
pagedown
121778e5c6 Remove unnecessary function checks 2022-02-27 00:08:36 +08:00
pagedown
ef32488890 Shell integration: Fix fish pipestatus being overwritten 2022-02-27 00:07:46 +08:00
Kovid Goyal
9d349d618a Fix #4743 2022-02-26 14:42:21 +05:30
Kovid Goyal
9f0a4f43b8 Add some video reviews to press mentions 2022-02-26 09:54:16 +05:30
Kovid Goyal
a8826f0d02 When dropping URLs/files onto kitty at a shell prompt insert them appropriately quoted and space separated 2022-02-25 10:30:15 +05:30
Kovid Goyal
6689d312a3 macOS: Paste multiple URLs separated by newlines
Fixes #4734
2022-02-25 10:17:36 +05:30
Kovid Goyal
2d7cb25b20 Fix #4739
I hope, since I cannot reproduce.
2022-02-25 05:50:42 +05:30
Kovid Goyal
da10eaca00 Merge branch 'docs' of https://github.com/page-down/kitty 2022-02-24 19:19:12 +05:30
Kovid Goyal
6d3995d4ac Merge branch 'feat-eof-exit' of https://github.com/page-down/kitty 2022-02-24 19:18:52 +05:30
pagedown
e3adf8c6bf show_error kitten: Exit at EOF 2022-02-24 21:13:57 +08:00
pagedown
b8e522484d ... 2022-02-24 20:50:06 +08:00
Kovid Goyal
ef4240e196 Add Python bytes 272 to press mentions 2022-02-24 18:01:55 +05:30
Kovid Goyal
8fa4a48ae5 Merge branch 'ksi-fish' of https://github.com/page-down/kitty 2022-02-24 17:59:41 +05:30
pagedown
4f3da2bc00 Output warnings for outdated versions of fish 2022-02-24 20:25:48 +08:00
pagedown
7b8c2c846f Shell integration: Check fish version and exit on outdated versions 2022-02-24 18:43:46 +08:00
Kovid Goyal
b212fd5bcd Dont actually need a thread for PTY 2022-02-24 10:05:13 +05:30
Kovid Goyal
0a297f4656 proper ordering during shutdown 2022-02-24 00:27:09 +05:30
Kovid Goyal
fa397a1d24 PTY: Write to child in separate thread 2022-02-24 00:26:08 +05:30
Kovid Goyal
0610daaec7 Remove echo dance 2022-02-24 00:08:17 +05:30
Kovid Goyal
8278e2b88d Dont fail test in no PATH in environ 2022-02-23 23:27:24 +05:30
Kovid Goyal
cb4a9d89cf Cleanup linenum matching and add some tests 2022-02-23 23:06:19 +05:30
Kovid Goyal
7800c598f6 hints kitten: Fix a regression that broke recognition of path:linenumber:colnumber
Fixes #4675
2022-02-23 22:38:54 +05:30
Kovid Goyal
fc651b72ab Merge branch 'refactor' of https://github.com/page-down/kitty 2022-02-23 19:52:11 +05:30
pagedown
a9a7912372 ... 2022-02-23 21:37:41 +08:00
pagedown
43f435c334 Avoid shadow the global variable name 2022-02-23 21:30:05 +08:00
pagedown
693fc0f0c7 CI: Disable codeql auto install python dependencies 2022-02-23 21:28:29 +08:00
Kovid Goyal
12e011c481 Merge branch 'test-ksi-fish' of https://github.com/page-down/kitty 2022-02-23 18:31:13 +05:30
Kovid Goyal
668783ba1c Use a version check when skipping bash test 2022-02-23 18:27:20 +05:30
pagedown
c18ebef702 ... 2022-02-23 20:49:32 +08:00
Kovid Goyal
03f9f29ce4 DRYer 2022-02-23 18:14:40 +05:30
Kovid Goyal
f62acab715 Install fish on macOS CI 2022-02-23 18:07:06 +05:30
Kovid Goyal
28ab9bfa2a Merge branch 'test-ksi-fish' of https://github.com/page-down/kitty 2022-02-23 18:02:53 +05:30
pagedown
9c05481f14 ... 2022-02-23 20:05:30 +08:00
pagedown
8ca92e0536 Disable fish integration on CI since the version is outdated and broken 2022-02-23 19:58:09 +08:00
pagedown
c0f6201ac3 Add fish shell integration tests 2022-02-23 19:55:19 +08:00
Kovid Goyal
27f3a5e16a Fix previous PR breaking bash integration 2022-02-23 12:30:02 +05:30
Kovid Goyal
de10dfe91b Merge branch 'ksi-bash' of https://github.com/page-down/kitty 2022-02-23 12:22:00 +05:30
pagedown
444a690a86 Remove the extra comment line 2022-02-23 14:37:45 +08:00
pagedown
3d7b3f7d72 Use the official project name of Bash 2022-02-23 14:21:13 +08:00
pagedown
741ef7f115 Remove new lines with bash 2022-02-23 14:09:13 +08:00
pagedown
e0c84c7176 Use bash builtin 2022-02-23 14:01:47 +08:00
pagedown
393425e3d1 Remove trailing spaces 2022-02-23 13:59:39 +08:00
Kovid Goyal
fc9645832d Add tests for --noprofile, --rcfile, --norc as well 2022-02-23 10:42:25 +05:30
Kovid Goyal
c47f41cfc0 Add tests for bash startup file sourcing 2022-02-23 08:35:24 +05:30
Kovid Goyal
08221489fd Cleanup previous PR 2022-02-23 07:59:41 +05:30
Kovid Goyal
3c6766ff06 Merge branch '4721-lig-check-fallback' of https://github.com/nickwynja/kitty 2022-02-23 07:57:36 +05:30
Kovid Goyal
e28aae620a Add tests for reset of cursor shape when running commands 2022-02-23 07:48:42 +05:30
Nick Wynja
c240e7deaf Also check ### to confirm spacer strategy
relates to #4721
2022-02-22 14:59:19 -05:00
Kovid Goyal
31a5965b01 Splits layout: A new value for :option:launch --location to auto-select the split axis when splitting existing windows. 2022-02-22 22:37:26 +05:30
Kovid Goyal
7a2a849a97 Add a note that shell integration should be removed from bashrc 2022-02-22 21:45:31 +05:30
Kovid Goyal
2c96e49566 ... 2022-02-22 21:40:03 +05:30
Kovid Goyal
e7846f916a Cleanup how it works for bash 2022-02-22 21:37:50 +05:30
Kovid Goyal
d4f4d56f94 DRYer 2022-02-22 21:32:33 +05:30
Kovid Goyal
0108037076 Dont leak the ENV environ var we use to load our integration script into the shell 2022-02-22 21:29:32 +05:30
Kovid Goyal
88091b4ab3 BASH integration: No longer modify .bashrc to load shell integration
I think I have things setup robustly so that the shell integration
is loaded transparently via env vars and the normal bash startup files
are sourced, in the same way that vanilla bash does it. Let's hope I
haven't overlooked something.
2022-02-22 21:24:51 +05:30
Kovid Goyal
4487462b0d bash assumes ECHO is enabled for the tty 2022-02-22 20:43:58 +05:30
Kovid Goyal
dac9b07f16 bash shell integration: Handle both literal and escaped newlines in PS1 2022-02-22 18:30:20 +05:30
Kovid Goyal
b59212696a Skip testing bash on macOS as it is too old 2022-02-22 14:53:46 +05:30
Kovid Goyal
7fe1376e34 DRYer 2022-02-22 14:52:54 +05:30
Kovid Goyal
e25b90c1b6 Add bash integration tests 2022-02-22 12:23:19 +05:30
Kovid Goyal
cb32a0b8fc Handle remote print callback in tests 2022-02-22 11:47:44 +05:30
Kovid Goyal
05617f7dca strip kitty markup from ps1 before checking for newlines 2022-02-22 11:40:09 +05:30
Kovid Goyal
2d2f4b9ba9 Multi-line processing of bash prompts should only be done when the prompt actually contains a newline 2022-02-21 22:54:10 +05:30
Kovid Goyal
65c7ecbc30 Test prompt drawing after screen is shrunk 2022-02-21 21:17:52 +05:30
Kovid Goyal
da5e37620e Also test changing of title when running command 2022-02-21 21:17:52 +05:30
Kovid Goyal
261057396c Fix zsh integration test on CI
Also, add various other robustness improvements to the test
2022-02-21 21:17:41 +05:30
Kovid Goyal
a43f610555 Better error msg when cursor is not changed 2022-02-21 18:23:35 +05:30
Kovid Goyal
45ae52e5d0 Fix assert ordering 2022-02-21 18:07:54 +05:30
Kovid Goyal
a565443d4a Saner tempdir removal 2022-02-21 18:05:36 +05:30
Kovid Goyal
081d6a3f16 Install various shells ON CI so we can test with them 2022-02-21 18:00:23 +05:30
Kovid Goyal
c9cc832875 Add basic tests for zsh shell integration 2022-02-21 17:57:25 +05:30
Kovid Goyal
595698d8e9 Remove dirs in HOME from PATH wen running tests 2022-02-21 16:57:11 +05:30
Kovid Goyal
b28d94ac97 Always use kitty as the python interpreter to run in the tests 2022-02-21 14:45:12 +05:30
Kovid Goyal
b9684879e7 Try to fix tests failing on CI 2022-02-21 14:24:08 +05:30
Kovid Goyal
63f974531b Framework for testing with external programs via a PTY 2022-02-21 14:08:10 +05:30
Kovid Goyal
a559210923 Retry macOS builds as well on nightly
They seem to be failing with some regularity
2022-02-21 11:18:21 +05:30
Kovid Goyal
8d36fb9edc Fix copying of selection after selection has been scrolled off history buffer raising an error
Fixes #4713
2022-02-20 13:07:31 +05:30
Kovid Goyal
f652b23169 Retry ca certs download on macOS 2022-02-20 11:09:58 +05:30
Kovid Goyal
d50a2ea288 Note that Konsole also supports the kitty graphics protocol 2022-02-20 10:59:26 +05:30
Kovid Goyal
80fc3a1faa Fix incorrect function used to get tuple size 2022-02-19 15:29:59 +05:30
Kovid Goyal
9a04405ad2 Cache the bell sound in the canberra server since it is a frequently played sound 2022-02-19 13:07:44 +05:30
Kovid Goyal
fdc9835587 Cleanup previous PR 2022-02-18 13:44:25 +05:30
Kovid Goyal
702bb2cd06 Merge branch 'fix-macos-cur-update' of https://github.com/page-down/kitty 2022-02-18 13:40:05 +05:30
pagedown
58e8609c1a macOS: Ensure the cursor is updated once
macOS will set the cursor to arrow after milliseconds after the switch
desktop animation ends. So the cursor that was updated immediately after
the focus will be changed again. This also affects toggling fullscreen.
2022-02-18 13:52:19 +08:00
pagedown
69c5c49094 Disable cursor rects 2022-02-18 13:52:00 +08:00
pagedown
ff8de7607a Also handles the case where toggleFullScreen does not get called 2022-02-18 13:50:46 +08:00
Kovid Goyal
cfd0872cea Merge branch 'feat-macos-fullscreen' of https://github.com/page-down/kitty 2022-02-17 17:41:00 +05:30
pagedown
7007f2e7fc macOS: Allow to customize global menu full screen shortcut 2022-02-17 16:31:46 +08:00
pagedown
6d0721341b Fix phantom window appears when executing full screen in transition 2022-02-17 15:47:03 +08:00
Kovid Goyal
7a156d5ef3 Also fix --hold not working if program to be executed is not found 2022-02-17 11:16:08 +05:30
Kovid Goyal
185c3320a4 Fix --hold not working with some programs that cause keyboard interrupt to be passed to python 2022-02-17 11:12:33 +05:30
Kovid Goyal
1c9cf32735 Add a few more important env vars to debug output 2022-02-17 07:45:36 +05:30
Kovid Goyal
6bfb6da0ad Make the regex for sgr stripping tighter 2022-02-15 22:33:51 +05:30
Kovid Goyal
56a5738018 Remove unused code 2022-02-15 22:22:07 +05:30
Kovid Goyal
919667129f hints kitten: Avoid double scan of input text 2022-02-15 22:21:31 +05:30
Kovid Goyal
e9f49a3292 Make ANSI sanitizer pattern re-useable 2022-02-15 22:14:14 +05:30
Kovid Goyal
711f8b024e Properly sanitize pagerhist when returning as plain text 2022-02-15 22:11:57 +05:30
Kovid Goyal
53716c084b hints kitten: Strip prompt mark escape codes 2022-02-15 22:04:10 +05:30
Kovid Goyal
2b495bcf9d Merge branch 'docs' of https://github.com/page-down/kitty 2022-02-15 15:26:50 +05:30
pagedown
d10812c6b0 Docs: Fix GitHub discussion link in commented config 2022-02-15 17:42:33 +08:00
Kovid Goyal
80202d2679 Fix show_last_command_output not working when the output is stored partially in the scrollback pager history buffer
Fixes #4435
2022-02-15 13:04:02 +05:30
Kovid Goyal
5d120a2f36 Output prompt marking when serializing to ANSI 2022-02-15 08:57:17 +05:30
Kovid Goyal
cc11326baa Linux: Do not rescale fallback fonts to match the main font cell height
Fixes #4707
2022-02-15 07:51:15 +05:30
Kovid Goyal
f63dbc0ebd clamp min_lines when mouse is grabbed 2022-02-15 07:24:12 +05:30
Kovid Goyal
88630731dc Cleanup previous PR 2022-02-14 20:21:17 +05:30
Kovid Goyal
3e2a8d80d7 Merge branch 'feat-mouse-scroll-min' of https://github.com/page-down/kitty 2022-02-14 20:12:00 +05:30
Kovid Goyal
55626e5a41 Fix symbol_map in gen-config.py 2022-02-14 19:56:41 +05:30
pagedown
7ff07f7620 Add changelog entry 2022-02-14 22:07:01 +08:00
pagedown
d2f522277c Add wheel_scroll_min_lines to set the minimum scrolling lines 2022-02-14 21:53:02 +08:00
Kovid Goyal
0248edbdb9 xkb debug events should be printed to stderr 2022-02-14 15:03:31 +05:30
Kovid Goyal
d24248e93b Merge branch 'master' of https://github.com/ichigozero/kitty 2022-02-14 14:03:45 +05:30
Gary Sentosa
dcd7890a0c Show tab name otherwise tab title for select_tab 2022-02-14 15:48:08 +09:00
Kovid Goyal
f219b10c30 Changelog entry for previous PR 2022-02-14 07:19:54 +05:30
Kovid Goyal
cc039afc1e Merge branch 'glfw-wl-touchpad-scale' of https://github.com/xsrvmy/kitty 2022-02-14 07:18:49 +05:30
Rui Ming (Max) Xiong
d2288d8f83 Scale touchpad input by display scale on wayland 2022-02-13 20:47:02 -05:00
Kovid Goyal
4b4f904aac Dont use global variables for the axis discrete counts 2022-02-13 20:56:55 +05:30
Kovid Goyal
e06b774174 Avoid double scan of output to look for escape codes 2022-02-13 17:33:13 +05:30
Kovid Goyal
8d4772f804 Update bundled pygments
Fixes #4702
2022-02-13 17:10:55 +05:30
Kovid Goyal
3be00bd712 Reduce radius for detection of double click 2022-02-13 15:51:59 +05:30
Kovid Goyal
a0e4449fb2 Ensure prefixchar is written even for empty lines 2022-02-13 15:49:46 +05:30
Kovid Goyal
ebfc19def5 Only add an SGR reset at the end if there is atleast one escape code in the ansi output 2022-02-13 15:14:32 +05:30
Kovid Goyal
a4abe26d32 Fix copy ansi to clipboard ignoring newlines 2022-02-13 15:09:14 +05:30
Kovid Goyal
5f8cb22d02 Merge branch 'fix-mouse-extra-btn' of https://github.com/page-down/kitty 2022-02-13 14:53:40 +05:30
pagedown
cafc3973ec mouse_demo: Add mouse scroll wheel buttons 2022-02-13 16:45:48 +08:00
pagedown
436a57a61e mouse_demo: Fix mouse extra button bit mask 2022-02-13 16:36:51 +08:00
Kovid Goyal
da5111a267 Cleanup mouse debug input reporting 2022-02-13 11:14:41 +05:30
Kovid Goyal
ee5cf90684 Cleanup previous PR and add changelog entry for it
Fixes #4694
2022-02-13 10:53:24 +05:30
Kovid Goyal
108974f4f7 Merge branch 'pointer-resolution' of https://github.com/xsrvmy/kitty 2022-02-13 10:45:17 +05:30
Rui Ming (Max) Xiong
79fa9f1c95 Use counters for discrete flags instead 2022-02-12 17:45:28 -05:00
Rui Ming (Max) Xiong
40bf12af7a Check for discrete mouse events on wayland 2022-02-12 02:12:59 -05:00
Kovid Goyal
263d121f3e Rescale symbol_map faces for the desired cell height
Matches treatment of fallback faces. See #4670
2022-02-12 07:57:03 +05:30
Kovid Goyal
9222d002f7 Merge branch 'docs' of https://github.com/page-down/kitty 2022-02-11 20:46:06 +05:30
pagedown
9a6aab034d Add link for packaging status 2022-02-11 23:05:12 +08:00
Kovid Goyal
b931b06941 Add mouse co-ords to debug output for move events 2022-02-11 15:09:43 +05:30
Kovid Goyal
90dc9b6fe6 ... 2022-02-11 15:00:11 +05:30
Kovid Goyal
275ede6f0a Fix a fast click, move mouse, click sequence causing the first click event to be discarded
Fix #4603
2022-02-11 14:46:37 +05:30
Kovid Goyal
9fd4f8e5c2 Merge branch 'feat-hints-qm' of https://github.com/page-down/kitty 2022-02-11 13:05:34 +05:30
Kovid Goyal
01b4654461 A new option narrow_symbols to turn off opportunistic wide rendering of private use codepoints 2022-02-11 13:04:44 +05:30
pagedown
d40e6a9ece hints kitten: Match and strip Unicode single and double quotes 2022-02-11 14:59:35 +08:00
Kovid Goyal
b2317e0f12 Merge branch 'fix-macos-shortcuts' of https://github.com/page-down/kitty 2022-02-11 12:14:55 +05:30
pagedown
444d9bd341 macOS: Ignore when the global shortcut is disabled 2022-02-11 14:23:57 +08:00
Kovid Goyal
8fbe96744b ... 2022-02-11 10:50:33 +05:30
Kovid Goyal
1c48ec7196 Allow passing a "reset" argument to resize_window 2022-02-11 08:16:17 +05:30
Kovid Goyal
c4b3bbd057 Update changelog for previous PR
Fixes #4657
2022-02-11 06:55:53 +05:30
Kovid Goyal
502ed94f31 Merge branch 'fix-macos-shortcuts' of https://github.com/page-down/kitty 2022-02-11 06:54:31 +05:30
Kovid Goyal
18ce091bfa Fix symbol/PUA glyphs loaded via symbol_map instead of as fallbacks not using following spaces to render larger versions
Fixes #4670
2022-02-11 06:36:54 +05:30
Kovid Goyal
60f675758f Fix touch_scroll_multiplier also taking effect in terminal programs such as vim that handle mouse events themselves
Fixes #4680
2022-02-11 06:22:00 +05:30
Kovid Goyal
9bfa4553a8 Shell integration: bash: Fix rendering of multiline prompts with more than two lines
Fixes #4681
2022-02-11 06:08:34 +05:30
pagedown
358f30ca7a No longer need to fall back and check the default shortcuts 2022-02-11 02:39:50 +08:00
pagedown
e32785831b macOS: Add missing global shortcuts that will be enabled by default 2022-02-11 02:19:27 +08:00
Kovid Goyal
728eceb620 Add implementation for focus moving hardcoded shortcuts 2022-02-10 18:56:47 +05:30
Kovid Goyal
57f591d1ce Simplify default global shortcut lookup
Now if a shortcut is present in the plist, it will not be considered for
default matching
2022-02-10 17:47:11 +05:30
Kovid Goyal
e4397a1c73 Framework for Apple's default global shortcuts 2022-02-10 14:15:21 +05:30
Kovid Goyal
1170cf474f A new action copy_ansi_to_clipboard to copy the current selection with ANSI formatting codes
Fixes #4665
2022-02-10 12:20:19 +05:30
Kovid Goyal
ce8b0cf748 Allow using line_as_ansi with ranges 2022-02-09 21:40:33 +05:30
Kovid Goyal
696f371aa4 Merge branch 'ci' of https://github.com/page-down/kitty 2022-02-09 19:55:05 +05:30
pagedown
8ebd514251 Update Brewfile format 2022-02-09 21:35:22 +08:00
Kovid Goyal
d3bc6001d8 Merge branch 'ksi-fish' of https://github.com/page-down/kitty 2022-02-09 10:58:25 +05:30
pagedown
f5415ca824 Restore XDG_DATA_DIRS right after fish integration script is loaded 2022-02-09 13:06:38 +08:00
Kovid Goyal
0dbe27438d Ensure CSI are stripped from menbar title as well 2022-02-09 08:07:18 +05:30
Kovid Goyal
7448789951 Improve CWD detection when there are multiple foreground processes in the TTY process group 2022-02-08 20:30:00 +05:30
Kovid Goyal
dc6138d286 Add a note about why we check _ksi_prompt_command 2022-02-08 19:52:02 +05:30
Kovid Goyal
7457f637a2 bash shell integration: Dont call _ksi_prompt_command from PROMPT_COMMAND unlessit is set 2022-02-08 19:48:30 +05:30
Kovid Goyal
c9da734c0e Show the output from failed ssh commands 2022-02-08 10:46:34 +05:30
Kovid Goyal
141c814d72 Merge branch 'docs' of https://github.com/page-down/kitty 2022-02-08 05:35:36 +05:30
Kovid Goyal
bdb98cf210 Count chars not bytes when truncating menubar title 2022-02-07 22:37:58 +05:30
pagedown
7cc3d5907f Docs: Prefer namespaced launch points 2022-02-08 01:07:23 +08:00
Kovid Goyal
3c709a28f7 ... 2022-02-07 22:08:28 +05:30
Kovid Goyal
e9ea7b13b6 macOS: Add an option to control the max length of the window title displayed in the global menubar
Fixes #2132
2022-02-07 21:57:36 +05:30
Kovid Goyal
ac16880eec Linux: Fix fontconfig alias not being used if the aliased font is dual spaced instead of monospaced
Fixes #4649
2022-02-07 21:02:47 +05:30
Kovid Goyal
c54bdd921a Allow pressing esc to exit --hold as well 2022-02-07 18:14:54 +05:30
Kovid Goyal
fc17528337 Get --hold to work even when stdin is redirected 2022-02-07 15:39:21 +05:30
Kovid Goyal
9b2db6ec53 Another alternate icon 2022-02-07 14:19:04 +05:30
Kovid Goyal
0fcfaa2a98 Report errors correctly when launching multiple URLs 2022-02-07 14:07:17 +05:30
Kovid Goyal
ba97a728f2 Reduce max remembered window size of 50K pixels 2022-02-07 12:19:32 +05:30
Kovid Goyal
a3b046fdcd Merge branch 'fix-macos-new-tab' of https://github.com/page-down/kitty 2022-02-07 12:07:17 +05:30
pagedown
ddfda3efde Fix launching a new tab when there is no OS window 2022-02-07 13:55:43 +08:00
Kovid Goyal
a2269cb66e Fix launch command not creating a new window if no OS window is present 2022-02-07 11:14:29 +05:30
Kovid Goyal
1358f00969 Raise an exception for empty url schemes 2022-02-06 21:10:41 +05:30
Kovid Goyal
eedc849c45 Cleanup previous PR 2022-02-06 20:49:40 +05:30
Kovid Goyal
89679d07ae Merge branch 'feat-macos-handle-url' of https://github.com/page-down/kitty 2022-02-06 20:29:16 +05:30
Kovid Goyal
01d866f482 Also add openable mimetypes to kitty-open.desktop 2022-02-06 20:27:50 +05:30
Kovid Goyal
73b0312dcb Merge branch 'minor-tweaks' of https://github.com/page-down/kitty 2022-02-06 20:14:26 +05:30
Kovid Goyal
f9d9fe6db4 Shell integration: bash: Dont fail if an existing PROMPT_COMMAND ends with a semi-colon
Fixes #4645
2022-02-06 19:02:39 +05:30
pagedown
e31ca68875 macOS: Add a way to set kitty as the default handler for the URL schemes 2022-02-06 19:51:39 +08:00
pagedown
8ae273ee3a Simplify reassembling for the command 2022-02-06 19:24:02 +08:00
pagedown
73a197fcde Add kitty-launcher.desktop to handle URL scheme for Linux 2022-02-06 19:12:57 +08:00
pagedown
648bff02b5 Only remove the initial window if no startup session is configured 2022-02-06 18:58:52 +08:00
pagedown
7740bc138b Add changelog entry for previous PR 2022-02-06 18:58:40 +08:00
pagedown
f5337096d5 Rename LAUNCH_URL to LAUNCH_URLS 2022-02-06 18:57:40 +08:00
Kovid Goyal
dddff91fad Linux: Fix rendering of emoji when using scalable fonts such as Segoe UI Emoji 2022-02-06 13:31:11 +05:30
Kovid Goyal
f047678711 More robust initial window replacement when launching URLs 2022-02-06 07:11:57 +05:30
Kovid Goyal
aa8b23395f Merge branch 'feat-macos-open-with' of https://github.com/page-down/kitty 2022-02-06 06:53:36 +05:30
Kovid Goyal
7c36c19de0 Cleanup previous PR 2022-02-06 06:31:56 +05:30
Kovid Goyal
49183ced3b Merge branch 'fix-launch-cmd-args' of https://github.com/page-down/kitty 2022-02-06 06:31:22 +05:30
pagedown
007e9697c4 macOS: Add Open with kitty Service
There are still some file types that cannot be matched.
Add a standalone Open With service.
Users can configure shortcut for this service in System Preferences.
2022-02-05 23:20:19 +08:00
pagedown
9989edbe42 macOS: Add archive file type to info plist
List kitty in the Open With menu for archive files.
E.g. compressed files or disk image files
2022-02-05 23:19:33 +08:00
Kovid Goyal
9742e2ec48 Make mypy happy 2022-02-05 19:53:16 +05:30
pagedown
b47711e23a Fix kitty_exe() being executed when the script doesn't have shebang 2022-02-05 20:28:06 +08:00
pagedown
3dfdb3ac89 Fix missing args when running a script without exec perms via launch 2022-02-05 20:28:06 +08:00
Kovid Goyal
4d3e2a07d1 Cleanup previous PR 2022-02-05 17:45:46 +05:30
Kovid Goyal
a42eb3e643 Merge branch 'feat-lines-on-scr' of https://github.com/page-down/kitty
Fixes #4462
2022-02-05 17:44:21 +05:30
Kovid Goyal
39c77a9486 Allow running the launch actions by invoking the kitty executable with +open 2022-02-05 17:39:48 +05:30
pagedown
e22546c56a Add arguments to get the first and last line of text for launch command 2022-02-05 20:02:24 +08:00
Kovid Goyal
ced61096df Add some docs for the previous PR 2022-02-05 12:57:15 +05:30
Kovid Goyal
c0ea127810 Merge branch 'feat-macos-open-url' of https://github.com/page-down/kitty 2022-02-05 12:46:39 +05:30
Kovid Goyal
29b1e3fa46 Sanity check for main() args 2022-02-05 11:56:18 +05:30
Kovid Goyal
b2faa0d9f7 Fix #4637 2022-02-05 11:35:40 +05:30
pagedown
ddb9b67de3 Restrict custom launch actions to be prefixed with kitty:///launch/
Preserve the kitty URL scheme for further use.
2022-02-05 13:23:41 +08:00
pagedown
ffbc533565 Add ftps, ircs, kitty, sftp, and ssh to url_prefixes 2022-02-05 13:10:21 +08:00
pagedown
206e490491 macOS: Add common URL schemes to info plist 2022-02-05 13:09:13 +08:00
pagedown
135066f38c Add default launch action for ssh links 2022-02-05 13:05:58 +08:00
pagedown
51d591e177 macOS: Allow opening URLs with kitty 2022-02-05 13:05:41 +08:00
pagedown
80a62c8d71 Add preamble to generated file and fix gen-config.py filename 2022-02-05 13:05:13 +08:00
Kovid Goyal
90b54c5f7f Get build-dep working again for changes to bypy 2022-02-05 10:27:47 +05:30
Kovid Goyal
99c81e6858 Bump bundled version of wayland 2022-02-05 07:56:40 +05:30
Kovid Goyal
8fcb6278d7 Cleanup previous PR 2022-02-04 20:38:32 +05:30
Kovid Goyal
89e0abd41d Merge branch 'feat-reverse-scroll' of https://github.com/page-down/kitty 2022-02-04 20:34:37 +05:30
pagedown
a1a0c9ab80 Add new mappable action scroll_prompt_to_bottom 2022-02-04 22:52:06 +08:00
Kovid Goyal
9ab2a38d5c ... 2022-02-04 18:26:36 +05:30
Kovid Goyal
b5676a53ee Use a special role for actions documentation 2022-02-04 18:24:39 +05:30
Kovid Goyal
94898a8758 fix incorrect use of :ac: 2022-02-04 17:54:32 +05:30
Kovid Goyal
97a6a11066 Capitalization of menu action 2022-02-04 16:12:46 +05:30
Kovid Goyal
9fe22a5c27 Do a single pass over the cell vertex shader to set the defines 2022-02-04 14:34:41 +05:30
Kovid Goyal
f9b35c71d7 Another place to use NUM_UNDERLINE_STYLES 2022-02-04 14:16:31 +05:30
Kovid Goyal
6b47f6f769 Make adding new underline styles easier in the future 2022-02-04 14:05:19 +05:30
Kovid Goyal
37d8483728 Fix a regression in the previous release that broke strikethrough 2022-02-04 13:37:38 +05:30
Kovid Goyal
4776a9e785 When moving text into scrollback upto cursor actually move up to the prompt the cursor is at 2022-02-04 13:19:24 +05:30
Kovid Goyal
50bc5b0302 macOS: Add the default shortcut cmd+k to clear the terminal screen and scrollback up to the cursor
Fixes #4625
2022-02-04 11:58:52 +05:30
Kovid Goyal
7d496f20a1 Add changelog entry for previous PR 2022-02-04 11:43:57 +05:30
Kovid Goyal
42fbd0a1af A new action to clear scrollback+screen upto the line with the cursor 2022-02-04 11:42:42 +05:30
Kovid Goyal
8960bfebc0 ... 2022-02-04 11:41:45 +05:30
Kovid Goyal
b1209c1e7a Be explicit about python3 2022-02-04 11:19:51 +05:30
Kovid Goyal
365583efd7 Clarify SI docs a little
Fixes #4626
2022-02-04 10:51:41 +05:30
Kovid Goyal
926c2d71ee Merge branch 'fix-macos-ime' of https://github.com/page-down/kitty
Fixes #4621
2022-02-04 10:46:43 +05:30
pagedown
ce57c747cc macOS: Fix select next input source not working
For global shortcut to switch the next input source in the macOS system
preferences, final confirmation is only given when all modifier keys are
released.
2022-02-04 12:51:01 +08:00
Kovid Goyal
3e9129655a ... 2022-02-03 21:00:23 +05:30
Kovid Goyal
12f41f30b3 Only show important env vars in debug output
Also show their values since these are not sensitive
2022-02-03 20:43:23 +05:30
Kovid Goyal
1e7edd0218 ... 2022-02-03 20:14:52 +05:30
Kovid Goyal
2fd8ef389e Fix use-python not working reliably with SSH kitten 2022-02-03 19:58:10 +05:30
Kovid Goyal
53589c3954 ssh kitten: Fix location of generated terminfo files on NetBSD
Fixes #4622
2022-02-03 19:51:37 +05:30
Kovid Goyal
34a0218f35 Fix a regression in the previous release that broke active_tab_foreground
Fixes #4620
2022-02-03 18:12:42 +05:30
Kovid Goyal
6fa4110da9 version 0.24.2 2022-02-03 11:44:12 +05:30
Kovid Goyal
43ceaf0b7e Merge branch 'shorten-long-line' of https://github.com/Luflosi/kitty 2022-02-01 17:15:09 +05:30
Luflosi
301ca76d14 Shorten a long line
This line is getting really close to the limit of 160 characters.
2022-02-01 12:16:13 +01:00
Kovid Goyal
a591304412 ... 2022-02-01 13:39:42 +05:30
Kovid Goyal
8fffd6070a Fix #4605 2022-02-01 12:01:08 +05:30
Kovid Goyal
a899a8ab6d Sanitize window sizes read from cached values 2022-02-01 11:23:36 +05:30
Kovid Goyal
9c13e8a549 Allow controlling placement of bell and activity symbols in the tab title template
Fixes #4581
2022-02-01 08:58:49 +05:30
Kovid Goyal
68d2ea3f27 Get config generation working with py3.10
The typing classes now have a __name__ attribute
2022-02-01 08:29:34 +05:30
Kovid Goyal
2c0269930f kitty @ get-text: Add a n option to clear the current selection after getting text
See #4600
2022-01-31 08:22:05 +05:30
Kovid Goyal
c4953504ba ... 2022-01-31 08:19:45 +05:30
Kovid Goyal
e7ee6d9e26 A new action to clear the current selection
Fixes #4600
2022-01-31 08:17:40 +05:30
Kovid Goyal
1cb3875cb5 Merge branch 'minor-tweaks' of https://github.com/page-down/kitty 2022-01-30 15:51:02 +05:30
pagedown
14ae2d0862 Make the colons colored like the others 2022-01-30 17:37:17 +08:00
pagedown
539ec69d3f Remove a space that was introduced by mistake 2022-01-30 17:34:58 +08:00
Kovid Goyal
bc873ad838 bash shell integration: To title and cursor escape codes at end of PS1/PS0 so that they override pre-existing ones
This is needed because some distros like Debian patch the default bashrc
to set a user@host:/pwd style title which is extremely unsuitable for
kitty.
2022-01-30 11:13:46 +05:30
Kovid Goyal
f056b7c1da Improve docs for splits layout
Fixes #4592
2022-01-30 09:44:33 +05:30
Kovid Goyal
2e790a119a Merge branch 'refactor-fstring' of https://github.com/page-down/kitty 2022-01-30 09:26:17 +05:30
pagedown
4a3ed62809 Refactor: More f-string for kittens 2022-01-29 20:23:34 +08:00
pagedown
4110074580 Refactor: More f-string for kitty client.py 2022-01-29 20:22:44 +08:00
pagedown
c21f00c476 Refactor: More f-string for kitty fonts and rc send_text 2022-01-29 20:22:22 +08:00
pagedown
1ca1c2edad Refactor: More f-string for conf 2022-01-29 20:18:11 +08:00
pagedown
ba0f61d752 Refactor: More f-string for kitty 2022-01-29 20:17:46 +08:00
pagedown
74e70d2548 Refactor: More f-string for bypy scripts 2022-01-29 20:15:17 +08:00
pagedown
74921c1373 Refactor: Sorting items when generating files
Make the files generated in different environments consistent.
2022-01-29 20:14:56 +08:00
pagedown
a22f37b919 Refactor: More f-string for tools 2022-01-29 20:14:36 +08:00
Kovid Goyal
9f250fdf26 Only dump env var names not values 2022-01-29 11:55:26 +05:30
Kovid Goyal
d92eba82bc Dump env vars seen by kitty for debug config 2022-01-29 11:36:58 +05:30
Kovid Goyal
a052958a20 Merge branch 'macos' of https://github.com/page-down/kitty 2022-01-29 11:26:09 +05:30
pagedown
81e7e6a356 macOS: Disable sudden termination
Since we have the quit confirmation feature, so we explicitly specify
that sudden termination is not supported.
2022-01-29 13:41:59 +08:00
pagedown
953cf26369 macOS: Fix info plist structure version
Set the InfoDictionary version explicitly, hopefully the behavior will
be unchanged when the default version is upgraded.
2022-01-29 13:37:21 +08:00
pagedown
7649e2f3ea Docs: Fix macOS shortcut for debug_config 2022-01-29 13:32:36 +08:00
Kovid Goyal
2a6a77467c Merge branch 'refactor-fstring' of https://github.com/page-down/kitty 2022-01-28 17:26:43 +05:30
pagedown
dc61adf9d8 Refactor: More f-string 2022-01-28 19:34:13 +08:00
Kovid Goyal
e0c4a90aa3 DRYer 2022-01-28 13:21:54 +05:30
Kovid Goyal
5cdff7d6d0 themes kitten: Allow writing to a different file than kitty.conf 2022-01-27 20:24:39 +05:30
Kovid Goyal
4f6c16984a Do not send arrow key presses to shells when clicking on a window with the mouse to focus it
Fixes #4128
2022-01-27 20:07:17 +05:30
Kovid Goyal
7e364b1606 Fix incorrect shortcut in docs 2022-01-27 19:45:35 +05:30
Kovid Goyal
a24df07d25 Merge branch 'fix-on-macOS-10.12' of https://github.com/Luflosi/kitty 2022-01-27 17:35:20 +05:30
Luflosi
347c0d4de4 Fix compilation on macOS 10.12
Without this commit, kitty would fail to compile on macOS 10.12 with the error "use of undeclared identifier".
This problem was introduced in f7be4fab48, where some code was moved to a different file, without moving the corresponding `#define` statements.
2022-01-27 12:21:17 +01:00
Kovid Goyal
ca2e9f571f Merge branch 'refactor' of https://github.com/page-down/kitty 2022-01-27 16:40:17 +05:30
pagedown
9be57de4a9 macOS: List kitty in the open with menu of an arbitrary file
Allow opening files without extension name following the rules in launch
actions configuration.
2022-01-27 18:16:35 +08:00
pagedown
cc84ee9734 Refactor: Replace string concat with f-string 2022-01-27 17:57:25 +08:00
pagedown
b5ad030a14 macOS: Categorize and update bundle info plist
Allow toggling input sources using CapsLock.
Allow programs to request photo, motion, speech recognition permissions.
Add local network unicast or multicast usage description.
Remove iOS-only items.
2022-01-27 17:55:43 +08:00
Kovid Goyal
40b5c43920 ... 2022-01-27 12:14:42 +05:30
Kovid Goyal
9f2be8b696 Fix #4573 2022-01-27 11:29:33 +05:30
Kovid Goyal
4397e60206 Add changelog entry for cursor shape restoration 2022-01-27 11:19:53 +05:30
Kovid Goyal
caab98e70b remove duplicate changelog entry 2022-01-27 11:18:15 +05:30
Kovid Goyal
11a4b75ffa Merge branch 'fix-ime' of https://github.com/page-down/kitty 2022-01-27 10:46:37 +05:30
Kovid Goyal
d25dceacdd Merge branch 'remote-control' of https://github.com/page-down/kitty 2022-01-27 10:38:43 +05:30
pagedown
b9a612fb9c macOS: Clean up any text that may not have been sent when loses focus 2022-01-27 12:37:17 +08:00
pagedown
3b9a7914ee Also add alias --dont-take-focus to new_window 2022-01-27 12:28:40 +08:00
pagedown
f646dfa238 Cancel IME for active kitty or OS window only 2022-01-27 11:48:48 +08:00
Kovid Goyal
0b2a533b44 Merge branch 'fix-ime' of https://github.com/page-down/kitty 2022-01-27 08:03:08 +05:30
Kovid Goyal
0e1246c15b Merge branch 'fix-cache-defrag' of https://github.com/Luflosi/kitty 2022-01-27 07:49:54 +05:30
pagedown
a987fb81a0 Emits an IME lost focus event when the window lost focus or closed 2022-01-27 10:13:57 +08:00
pagedown
4d920b182f macOS: Cancel IME composition when receive loss of focus event 2022-01-27 10:07:18 +08:00
pagedown
22f077b384 Clear overlay text after screen loses focus 2022-01-27 09:53:40 +08:00
Luflosi
4c78a50dcf Add more copy_file_range() and sendfile() errno exceptions
On ZFS `copy_file_range()` and `sendfile()` fail for some reason, so add `EINVAL` to the list of error codes for which the code will fall back to a slower implementation.
While we are at it, add all the error codes from https://go.dev/src/internal/poll/copy_file_range_linux.go for different filesystems and older kernel versions to the list of error codes from `copy_file_range()`.
Without this, the cache defragmentation and the test testing it (`test_disk_cache`) fail with the error message "Failed to copy data to new disk cache file during defrag: Invalid argument" when the cache directory is stored on ZFS.
Perhaps this is caused by me running ZFS 2.1.2 on Linux 5.16.0, which is not a supported combination. This ZFS version is only "compatible with 3.10 - 5.15 kernels" according to the release notes. Or maybe it's just not implemented.
To reproduce the problem, execute `KITTY_CACHE_DIRECTORY=/path/to/zfs python3 test.py` with `KITTY_CACHE_DIRECTORY` pointing to a directory on ZFS.
2022-01-27 00:45:30 +01:00
Luflosi
9d87b08c52 Fix logic error in file copy helper functions
If `errno` is `EAGAIN`, the second if statement is never true and if `errno` is not `EAGAIN`, the function returns immediately, not checking the second if statement.
This commit fixes this.
A logically equivalent change would have been to simply swap the two if statements but I find this version to be more readable.
2022-01-26 23:35:54 +01:00
Kovid Goyal
97e58c5b86 Merge branch 'macos-ime' of https://github.com/page-down/kitty 2022-01-26 16:49:10 +05:30
pagedown
b3f678cf6f Improve debug log 2022-01-26 18:28:37 +08:00
pagedown
7f3715cd3e Use the input context instance from GLFWContentView 2022-01-26 18:25:37 +08:00
pagedown
a3aaaa1efb macOS: Explicitly cancel IME composition when losing the focus 2022-01-26 18:21:20 +08:00
Kovid Goyal
d1531632a2 Add some notes on how to run IBUS for testing 2022-01-26 10:47:18 +05:30
Kovid Goyal
2151969ae5 IBUS: Hide the pre-edit text when receiving a HidePreeditText message 2022-01-26 10:12:48 +05:30
Kovid Goyal
44e3a6f0fb Shell integration: Set cursor shape to whatever is specified in the cursor_shape option when executing a command rather than the block shape 2022-01-25 13:30:48 +05:30
Kovid Goyal
364bad504c CSI 0 q should blink cursor as per xterm docs and behavior 2022-01-25 13:29:44 +05:30
Kovid Goyal
0648b4f568 Merge branch 'ksi-fish' of https://github.com/page-down/kitty 2022-01-25 11:33:06 +05:30
pagedown
a47b3bf578 Fix the blinking block cursor shape for commands in bash integration 2022-01-25 14:00:28 +08:00
pagedown
3aec573d40 Use blinking block for commands consistent with zsh and bash integration 2022-01-25 13:58:11 +08:00
pagedown
5d4b0c0bef Set the pre-exec cursor shape in fish vi mode and config on demand 2022-01-25 13:01:54 +08:00
pagedown
11c0343420 Add comments and minor tweaks to fish integration 2022-01-25 11:52:34 +08:00
Kovid Goyal
287b843d13 add a comment 2022-01-24 22:14:56 +05:30
Kovid Goyal
1fea4777fa zsh shell integration: Restore cursor to blinking block before running external commands 2022-01-24 22:06:52 +05:30
Kovid Goyal
b5a2f94185 The open_actions() test needs options set 2022-01-24 15:21:32 +05:30
Kovid Goyal
1000376a4f ... 2022-01-24 09:50:37 +05:30
Kovid Goyal
02e1272502 Slightly improve debug text 2022-01-23 20:40:41 +05:30
Kovid Goyal
393e5eb158 Merge branch 'fix-macos-ime' of https://github.com/page-down/kitty 2022-01-23 20:38:43 +05:30
pagedown
b2d0c35fc2 Clear the pre-edit text only when inserting non-control characters
Maintains the pre-edit input state after pressing the modifier key
combination or function key while using the IME.
2022-01-23 22:22:24 +08:00
pagedown
3ee12082f2 No need to update the pre-edit text 2022-01-23 22:16:26 +08:00
pagedown
1ce4fc9c8c Check for ASCII control chars before sending text 2022-01-23 21:40:27 +08:00
pagedown
57e2866b68 macOS: Fix caps_lock not clearing pre-edit text when using IME 2022-01-23 18:50:55 +08:00
pagedown
195fc1a270 Minor tweaks to macOS key event debug log 2022-01-23 18:45:18 +08:00
Kovid Goyal
39e56f1864 Dont check the return value of handleEvent
It's apparently meaningless, despite what the docs say
2022-01-23 12:47:29 +05:30
Kovid Goyal
da96dfcad2 Forgot to use override 2022-01-23 11:33:58 +05:30
Kovid Goyal
053bb999d3 Merge branch 'fix-macos-ime-modifiers' of https://github.com/page-down/kitty 2022-01-23 10:41:45 +05:30
Kovid Goyal
e914f0df8e Make FAIL_WARN a boolean 2022-01-23 10:12:11 +05:30
Kovid Goyal
78cd83845f Fix sphinx failing to highlight fish 2022-01-23 09:43:15 +05:30
Kovid Goyal
f6228cc81e Merge branch 'fix-macos-ime' of https://github.com/page-down/kitty 2022-01-23 08:17:16 +05:30
pagedown
83884f42f8 macOS: Fix text insertion by modifier keys when using IME 2022-01-23 01:50:37 +08:00
pagedown
fbaf3e2f49 Update preedit text with markedText
This fixes the preedit text being cleared when using shortcut keys to
switch candidate text in the input state.
2022-01-23 00:01:08 +08:00
Kovid Goyal
c0be0f74d8 Use commit text instead of a zero key event
Thanks @page-down
2022-01-22 21:11:26 +05:30
Kovid Goyal
a9e014226e Merge branch 'docs' of https://github.com/page-down/kitty 2022-01-22 20:58:30 +05:30
pagedown
b498d86436 Docs: Add modifier key names and aliases 2022-01-22 23:08:44 +08:00
Kovid Goyal
ff836a85aa Special case the IME injecting text in on_key_input 2022-01-22 20:00:03 +05:30
Kovid Goyal
688a3eaef7 Check if input context handles flagschanged event 2022-01-22 16:17:01 +05:30
Kovid Goyal
3b15b46d08 Also deal with setMarkedText called from event loop with actual marked text 2022-01-22 16:13:44 +05:30
Kovid Goyal
f21ddae94f Handle setMarkedText called from the event loop
Also pass through text with zero key
2022-01-22 16:08:50 +05:30
Kovid Goyal
cd9b752926 ... 2022-01-22 16:02:05 +05:30
Kovid Goyal
655a5a2808 Handle insertText called from the event loop by the text input system 2022-01-22 15:51:43 +05:30
Kovid Goyal
5f4e519d61 ... 2022-01-22 15:13:53 +05:30
Kovid Goyal
720bf7efd6 Fix mouse position reported incorrectly on click event in a newly created window if the mouse has never moved in that window 2022-01-22 15:10:14 +05:30
Kovid Goyal
3867620be5 ... 2022-01-22 14:58:10 +05:30
Kovid Goyal
03a7361325 Some debug prints for flagsChanged 2022-01-22 14:57:13 +05:30
Kovid Goyal
e8c683db8b A new approach to handling flagsChanged with IME
Bypass cocoa's flagsChanged handling and call handleevent ourselves,
this allows us to know exactly what the IME is doing. Hopefully fixes
issues with IMEs that change state on modifier key presses.

Fixes #4541
2022-01-22 14:47:57 +05:30
Kovid Goyal
0a3acd9738 ask kitten: Use buttons for choices as well 2022-01-22 13:57:25 +05:30
Kovid Goyal
08f159c2ba TypeCheck underline style names 2022-01-22 12:41:26 +05:30
Kovid Goyal
d4e7587686 use underline instead of color for default choice 2022-01-22 12:35:43 +05:30
Kovid Goyal
d219654387 Use a dedicated choose() method matching confirm() 2022-01-22 12:27:20 +05:30
Kovid Goyal
32e31a3c6b Cancelling the choice kitten should return the empty response 2022-01-22 12:13:32 +05:30
Kovid Goyal
9419125387 Highlight the default choice in yellow 2022-01-22 11:45:01 +05:30
Kovid Goyal
1bbab217d0 ask kitten: Always have a default choice 2022-01-22 11:39:54 +05:30
Kovid Goyal
05d648d411 ask kitten: Draw yes/no buttons 2022-01-22 11:32:26 +05:30
Kovid Goyal
5c832d3190 Allow multiple clickable ranges 2022-01-22 10:52:44 +05:30
Kovid Goyal
ce7282a53c DRYer 2022-01-22 10:47:52 +05:30
Kovid Goyal
0d33380e6a Cleanup previous PR
yesno default should be yes.
Pressing q to quit is undiscoverable
Clicking empty cells should not trigger buttons as that is
undiscoverable and possibly surprising
2022-01-22 10:44:01 +05:30
Kovid Goyal
9944b895a6 Merge branch 'kitten-ask' of https://github.com/page-down/kitty 2022-01-22 10:06:52 +05:30
Kovid Goyal
fe7045dd2f Ask kitten: Fix rendering of multiline messages 2022-01-22 09:40:05 +05:30
Kovid Goyal
d17757cc84 Merge branch 'feat-underline' of https://github.com/page-down/kitty 2022-01-22 09:28:13 +05:30
pagedown
7ef73babdd Use fixed values for unchanging dict to replace split and for loops 2022-01-22 11:36:04 +08:00
pagedown
a47aca6fdb Add new dotted and dashed underline enum
Also use "straight" for single underline, consistent with the protocol
extension document.
2022-01-22 11:00:49 +08:00
pagedown
bf9d47fddd ... 2022-01-22 09:51:28 +08:00
pagedown
4fe10fadb0 ... 2022-01-22 09:45:32 +08:00
pagedown
d29faa0986 Allow tab title to be set to empty to use window title 2022-01-22 03:28:42 +08:00
pagedown
88ee5e95fc Add default choices for features that use ask kitten 2022-01-22 03:21:59 +08:00
pagedown
9a119255fe ask kitten: Use the default value as input text
Prefill the current value when changing the tab title.
2022-01-22 03:11:39 +08:00
pagedown
7ce11050cd ask kitten: Esc to abort and Enter to confirm the default choice 2022-01-22 02:50:50 +08:00
pagedown
9b4d1219b8 Add default choice option for ask kitten 2022-01-22 02:46:37 +08:00
pagedown
4dd29c726a Make the clickable range of No the same as Yes
Since the two options are treated equally, the same amount of mouse
clickable range are given.
2022-01-22 02:41:52 +08:00
Kovid Goyal
17e31565e2 Get it working even with 2 row windows assuming they are wide enough to fit the title on a single line 2022-01-21 21:46:27 +05:30
Kovid Goyal
dd72deb546 Allow ask kitten to function in a 3 line window 2022-01-21 21:43:25 +05:30
Kovid Goyal
7e82179c79 ... 2022-01-21 21:20:49 +05:30
Kovid Goyal
d61e655953 Changelog entry for new underline styles 2022-01-21 21:16:23 +05:30
Kovid Goyal
cd0ca95877 Improve the UI of the ask kitten
Center the text in the window and allow pressing enter/esc when doing a
yes/no question

Fixes #4545
2022-01-21 20:02:13 +05:30
Kovid Goyal
d70610f5d9 more uses of extlinks 2022-01-21 08:45:03 +05:30
Kovid Goyal
f9cfb6f989 use sphinx extlinks instead of custon roles 2022-01-21 08:19:57 +05:30
Kovid Goyal
1f4372b34c Test if text is being inserted rather than if text is present 2022-01-20 11:16:05 +05:30
Kovid Goyal
76e7e7d61f ... 2022-01-20 08:45:03 +05:30
Kovid Goyal
c09dc73476 ... 2022-01-20 08:33:44 +05:30
Kovid Goyal
b090602fdb macOS: Fix the shift key not clearing pre-edit text in IME
Fixes #4541
2022-01-20 08:00:17 +05:30
Kovid Goyal
16d3e82515 Add debug output when ignoring key press during IME 2022-01-19 14:50:12 +05:30
Kovid Goyal
9caa6bb306 Nicer event printing 2022-01-19 14:32:03 +05:30
Kovid Goyal
acf227803f Move event formatting into the types 2022-01-19 14:30:08 +05:30
Kovid Goyal
f255c15fa9 DRYer 2022-01-19 14:04:14 +05:30
Kovid Goyal
7ce74ac688 Also change string based on event type 2022-01-19 13:58:45 +05:30
Kovid Goyal
6090673bb5 DRYer 2022-01-19 13:56:02 +05:30
Kovid Goyal
d1b5420b08 Display space as a word when printing keys 2022-01-19 13:33:53 +05:30
Kovid Goyal
e0f2b96fd2 Merge branch 'debug-config' of https://github.com/page-down/kitty 2022-01-19 13:16:26 +05:30
Kovid Goyal
47fdce6483 remove executable perms from boss.py 2022-01-19 13:12:52 +05:30
pagedown
bac84f31b3 Refactor the print functions to make it easier to use in kitten 2022-01-19 15:26:02 +08:00
Kovid Goyal
21bc5bf8c0 Dont leak a reference to input_source_at_last_key_event 2022-01-19 12:06:54 +05:30
Kovid Goyal
0ae928f409 Increase max cache size for distribute_dots
Since it is now also used to render dotted underlines
2022-01-19 12:00:17 +05:30
pagedown
7bf7cc284d Add the missing mouse triggers click (-2) and double-click (-3) 2022-01-19 14:12:39 +08:00
pagedown
ff1efebf70 Fix mouse maps are indented with one more space 2022-01-19 14:07:45 +08:00
pagedown
9334ed773e Adjust the order of modifier key names to match the config and docs 2022-01-19 14:05:51 +08:00
Kovid Goyal
5d8a0c4b09 Merge branch 'ksi-fish' of https://github.com/page-down/kitty 2022-01-19 08:38:15 +05:30
pagedown
c5e8a36f9b Shell integration: Improvements for fish integration
Move the completion function to the autocomplete script.
Fix some issues with cursor shape setting, respect user configuration.
Functions and vars start with two underscores, following the convention.
Other minor refactoring.
2022-01-19 09:39:23 +08:00
Kovid Goyal
39f9efc816 Add changelog entry for last PR 2022-01-18 21:10:02 +05:30
Kovid Goyal
17a3be8cb1 Merge branch 'dotted-dashed-underline' of https://github.com/jcla1/kitty 2022-01-18 21:03:30 +05:30
Joseph Adams
ee2c9775a7 Use distribute_dots() to even out spacing in underline 2022-01-18 15:46:31 +01:00
Joseph Adams
da486153de Add (possibly erroneous) test for new underline.
Also make more clear *what* exactly is rendered in the cell (i.e. a
strikethrough).
2022-01-18 12:52:59 +01:00
Joseph Adams
dd192ad0b7 Make old tests run
Previously, because of the new underline styles a couple of tests were
failing due to an unexpected number of sprites being returned from the
test-set-up. No new tests were added.
2022-01-18 12:28:24 +01:00
Joseph Adams
3c6c36487f Update underline documentation 2022-01-18 12:13:51 +01:00
Kovid Goyal
85eedb96ac Merge branch 'docs' of https://github.com/page-down/kitty 2022-01-18 16:37:11 +05:30
pagedown
3a8d867c87 Docs: Add macOS shortcuts and nth_os_window 2022-01-18 18:59:26 +08:00
Kovid Goyal
6a2522452f Allow including config files matching glob patterns in conf files
Fixes #4533
2022-01-18 16:28:19 +05:30
Kovid Goyal
f9a4b6bb0d Use an enum for state as well 2022-01-18 13:58:55 +05:30
Kovid Goyal
f1fbfe297d Use an enum for background work 2022-01-18 13:50:05 +05:30
Kovid Goyal
2c0ac895e6 diff kitten: Fix exiting while highlighting is incomplete causes kitten to hang until highlighting is done 2022-01-18 13:43:39 +05:30
Joseph Adams
e86c7d668c Add rendering functions for dotted and dashed underline.
Dashed underline looks pretty good regardless of conditions, but the
dotted underline only looks good/correct on certain font-sizes. This is
due to the underline being rendered on a per cell/glyph basis (so one
can not place a dot directly between two letters, say. Could be remedied
by pulling the rendering of the underlines into the shader, but that is
more work.
2022-01-17 13:25:08 +01:00
Kovid Goyal
4778e0eb23 Move the section about integration to a better location 2022-01-17 10:41:35 +05:30
Kovid Goyal
c3ded5eb72 ... 2022-01-17 10:39:13 +05:30
Kovid Goyal
323355d4bb Add a press mentions section to the kitty website 2022-01-17 10:26:49 +05:30
Kovid Goyal
92075a44d8 Add a note about using icat from other programs 2022-01-17 08:35:48 +05:30
Kovid Goyal
386bb837d8 Merge branch 'fix-macos-kbd-shortcuts' of https://github.com/page-down/kitty 2022-01-17 08:23:34 +05:30
Kovid Goyal
ea28029581 ... 2022-01-17 08:05:00 +05:30
pagedown
507e570887 No longer need the patch for Sphinx KeyboardTransform
The issue with KeyboardTransform with dirhtml has been fixed in Sphinx 4.4.0.
2022-01-17 02:49:25 +08:00
pagedown
5182f79152 macOS: Fix global shortcuts with shift modifier key not working 2022-01-17 02:23:00 +08:00
Kovid Goyal
71106bcd39 Shell integration: Dont override fish's native title setting functionality
See discussion: https://github.com/fish-shell/fish-shell/issues/8641
2022-01-16 15:58:11 +05:30
Kovid Goyal
cf91e1973b Show number of windows per tab in the select_tab action
Fixes #4523
2022-01-16 10:03:20 +05:30
Kovid Goyal
2170d4e21a DRYer 2022-01-16 09:47:44 +05:30
Kovid Goyal
2538e94390 Use a single SGR regex pattern cache 2022-01-16 09:46:52 +05:30
Kovid Goyal
0be0836890 Add changelog entry for last PR 2022-01-16 03:48:00 +05:30
Kovid Goyal
725ddf4f8b Merge branch 'fix-ksi-last-cmd' of https://github.com/page-down/kitty 2022-01-16 03:46:17 +05:30
pagedown
ce6f99044e ... 2022-01-16 04:14:59 +08:00
pagedown
30b81d98f1 Add tests for finding command output 2022-01-16 04:10:16 +08:00
pagedown
f0d2d01a36 Fix calculating the end of the command output 2022-01-16 04:02:13 +08:00
pagedown
ce32e64692 Check the continued attribute when searching for prompt marks 2022-01-15 20:19:12 +08:00
pagedown
7ea8a7d45f Fix searching the last command output 2022-01-15 18:38:05 +08:00
Kovid Goyal
b32edf54f8 hints kitten: Document how to choose the empty hint for multi key hints 2022-01-15 15:17:30 +05:30
Kovid Goyal
06ff685f8e oops 2022-01-15 14:54:30 +05:30
Kovid Goyal
c6ecdf0fa4 Ensure ignoreOSKeyboardProcessing is initialized 2022-01-15 14:43:10 +05:30
Kovid Goyal
ca4840717b macOS: Fix using shortcuts from the global menu bar as subsequent key presses in a multi key mapping not working
Fixes #4519
2022-01-15 13:56:18 +05:30
Kovid Goyal
c473df4393 Ignore NSEventModifierFlagFunction when parsing global shortcuts 2022-01-15 12:16:18 +05:30
Kovid Goyal
fa6c74a9b1 ... 2022-01-15 11:49:02 +05:30
Kovid Goyal
8174ecb318 Use only bash builtins to get currently executing command 2022-01-15 11:46:25 +05:30
Kovid Goyal
5f20d69309 Move extraction of last cmd into its own function 2022-01-15 10:58:16 +05:30
Kovid Goyal
aab121b35d Also check for shiftable shortcuts in the virtual key code case 2022-01-15 10:23:18 +05:30
Kovid Goyal
1a374a7678 Merge branch 'ksi-fish' of https://github.com/page-down/kitty 2022-01-15 10:17:18 +05:30
Kovid Goyal
396906860d macOS: When checking for global shortcuts handle shifted form of cmd+` 2022-01-15 10:14:06 +05:30
pagedown
85254746bf Shell integration: Remove functions that run only once at start 2022-01-15 12:34:52 +08:00
Kovid Goyal
c3c7ad78c1 Merge branch 'ksi-fish-cursor' of https://github.com/page-down/kitty 2022-01-15 09:40:37 +05:30
pagedown
77787bdc7c Shell integration: Improvements in fish integration 2022-01-15 12:01:47 +08:00
pagedown
9813ad04c2 Shell integration: Set the fish vi mode cursor to blink 2022-01-15 10:29:26 +08:00
Kovid Goyal
d2c20f9548 Add changelog entry for previous PR 2022-01-14 23:31:10 +05:30
Kovid Goyal
e51b520897 Merge branch 'ksi-fish-title' of https://github.com/page-down/kitty 2022-01-14 23:29:48 +05:30
Kovid Goyal
35207af3de Another use of builtin 2022-01-14 23:28:10 +05:30
Kovid Goyal
96269510d3 Abort before defining anything and dont touch global state via set 2022-01-14 23:26:40 +05:30
pagedown
ceb7c440a1 Shell integration: Only override default fish_title 2022-01-15 01:46:14 +08:00
Kovid Goyal
25e1edf52e ... 2022-01-14 23:03:44 +05:30
Kovid Goyal
7a903adeea let _ksi_debug_print handle multiple args 2022-01-14 22:53:39 +05:30
Kovid Goyal
914f4e9ec9 Dont break if user aliases or redefines various builtins we use 2022-01-14 22:47:49 +05:30
Kovid Goyal
4c5673dc4d Freeze _ksi_prompt to prevent it from being edited 2022-01-14 22:35:37 +05:30
Kovid Goyal
8529a60d77 Use issue number in changelog 2022-01-14 22:26:54 +05:30
Kovid Goyal
58da5d4d29 Placate mypy 2022-01-14 22:26:05 +05:30
Kovid Goyal
4ce6d718c9 icat kitten: Add options to mirror images and remove their transparency before displaying them
Fixes #4513
2022-01-14 22:02:35 +05:30
Kovid Goyal
dd31ee60f2 Fix typing of to_color 2022-01-14 21:54:36 +05:30
Kovid Goyal
8bb2da3c37 Use with instead of closing manually 2022-01-14 21:12:08 +05:30
Kovid Goyal
47dbaac54f Add changelog entry for previous PR 2022-01-14 20:36:15 +05:30
Kovid Goyal
346405299b Merge branch 'ksi-fish-cursor' of https://github.com/page-down/kitty 2022-01-14 20:35:23 +05:30
pagedown
a0476c03c3 Improve fish cursor shape integration 2022-01-14 22:57:31 +08:00
Kovid Goyal
9dd5410433 Dont rely on declare -g existing in bash 2022-01-14 18:21:21 +05:30
Kovid Goyal
72745dfb62 Use red fg for activity symbol by default
Can be overriden via template, but for backwards compat keep it red
2022-01-14 13:27:35 +05:30
Kovid Goyal
3a0d8ada6a Merge branch 'feat-macos-kbd-shortcuts' of https://github.com/page-down/kitty 2022-01-14 12:36:01 +05:30
Kovid Goyal
b53d756bc2 Shell integration: Fix bash integration not working when PROMPT_COMMAND is used to change the prompt variables
Fixes #4476
2022-01-14 12:14:48 +05:30
Kovid Goyal
bb8ebf32ae Merge branch 'fix-macos-text-input-beep' of https://github.com/page-down/kitty 2022-01-14 11:53:37 +05:30
pagedown
704487f0ce macOS: Release input context 2022-01-14 14:18:03 +08:00
pagedown
a9bdf70275 macOS: Watch for system preferences changes and update global_shortcuts 2022-01-14 13:51:46 +08:00
Kovid Goyal
017da1159c Allow using templates with text formatting for tab_activity_symbol
Fixes #4507
2022-01-14 08:18:04 +05:30
pagedown
ab5b9fb329 macOS: Only check the "standard" type of the system shortcuts 2022-01-14 10:07:38 +08:00
pagedown
e0700d45de macOS: Update to the latest and categorize the system shortcut names 2022-01-14 10:05:49 +08:00
Joseph Adams
a2c4f830b3 Enable use of higher options for underlining text.
In `Colored and styled underlines` it's proposed that the SGR codes
\e[4:4m and \e[4:5m are used to add a dotted or dashed underline to the
rendering context respectively. This commit prepares the necessary
changes to add the two additional underline style, while still rendering
them as a normal underline and curly underline.
2022-01-13 17:27:02 +01:00
Kovid Goyal
ecf4fcdeb0 Add changelog entry for previous PR
Fixes #4489
2022-01-13 20:24:17 +05:30
Kovid Goyal
0a89fe2e17 Merge branch 'fix-macos-text-input-beep' of https://github.com/page-down/kitty 2022-01-13 20:23:23 +05:30
pagedown
5b5651ca7d macOS: Suppress the key combinations beep sound 2022-01-13 22:51:53 +08:00
Kovid Goyal
5e5cd1acc8 Simplify flagsChanged and make it more robust
Now it only sends a key event to kitty if an actual modifier key was
pressed/released.
2022-01-13 20:13:55 +05:30
Kovid Goyal
79fd01093a fix typo in generating lookup keys for vk code based shortcuts 2022-01-13 19:21:49 +05:30
Kovid Goyal
ce63ddfe54 macOS: Print out unhandled exceptions 2022-01-13 16:54:36 +05:30
Kovid Goyal
a56471f7ed Validate the parameters array 2022-01-13 16:44:43 +05:30
Kovid Goyal
96b46c554e Add type annotations to dictionaries 2022-01-13 16:29:13 +05:30
Kovid Goyal
a819023ab7 remove redundant cast 2022-01-13 16:05:48 +05:30
Kovid Goyal
9504f50bd4 ... 2022-01-13 16:04:50 +05:30
Kovid Goyal
8fe71e3dc8 Dont use a block for dictionary enumeration
Maybe that will fix the mysterious issue @page-down is having
2022-01-13 16:02:29 +05:30
Kovid Goyal
34d7643bed Ensure global_shosrtcuts is initialized 2022-01-13 15:10:19 +05:30
Kovid Goyal
682eb7d802 Log when events are ignored because no keyWindow is present 2022-01-13 14:22:52 +05:30
Kovid Goyal
f86a954131 ooops 2022-01-13 14:21:58 +05:30
Kovid Goyal
8e3f6d37d9 ... 2022-01-13 14:15:39 +05:30
Kovid Goyal
2c38360ca0 Handle no keyWindow case 2022-01-13 13:43:01 +05:30
Kovid Goyal
f9d2167c97 macOS: Respect the users system-wide global keyboard shortcut preferences
Note that we currently dont handle live reload of global shortcut
preferences. I cant be bothered. Patches welcome.
Fixes #4501
2022-01-13 13:36:58 +05:30
Kovid Goyal
17cada7a6a Micro-optimization 2022-01-12 23:32:03 +05:30
Kovid Goyal
19e6f70655 Draw the dots for braille characters more evenly spaced at all font sizes
Fixes #4499
2022-01-12 23:18:18 +05:30
Kovid Goyal
d106089cb9 Micro-optimization 2022-01-12 22:25:58 +05:30
Kovid Goyal
0f7f69c218 move menu case outside auto-generated section 2022-01-11 22:57:05 +05:30
Kovid Goyal
f9171a767c Also document menu key encoding 2022-01-11 22:48:53 +05:30
Kovid Goyal
34e939f9a1 Encode menu key the same as xterm in legacy mode
See #597
2022-01-11 22:44:56 +05:30
Kovid Goyal
ba76cacd74 Add changelog entry for previous PR 2022-01-11 20:10:38 +05:30
Kovid Goyal
fd1b64dcc6 Merge branch 'fixes-fullscreen-hide-macos-10.15' of https://github.com/npearson72/kitty 2022-01-11 20:09:10 +05:30
Nathan Pearson
7c33d7ef17 Bumps version from 10.15 to 10.15.7 (latest minor) 2022-01-11 07:31:37 -07:00
Nathan Pearson
2ccfecb5ae Fixes comment 2022-01-11 06:39:48 -07:00
Nathan Pearson
a40ff85e1a Fixes traditional fullscreen hide for Mac OS >= 10.15 2022-01-11 06:25:39 -07:00
Kovid Goyal
62953c2057 Mark parameters as unused 2022-01-11 11:26:08 +05:30
Kovid Goyal
0e6091773d Add a poster for the demo video 2022-01-11 11:09:43 +05:30
Kovid Goyal
4c8ef26141 For the vertical and horizontal layouts have the windows arranged on a ring rather than a plane. This means the first and last window are considered neighbors
Fixes #4494
2022-01-11 08:08:11 +05:30
Kovid Goyal
7023c7a8ae ... 2022-01-10 21:15:24 +05:30
Kovid Goyal
b2bfc4408e Fix common single letter extension files not being detected
Fixes #4491
Fixes #4492
2022-01-10 14:20:18 +05:30
Kovid Goyal
5b8aca3a2f Use an f-string 2022-01-10 08:35:43 +05:30
Kovid Goyal
6715ee888e Merge branch 'cleanup' of https://github.com/page-down/kitty 2022-01-10 08:01:13 +05:30
pagedown
4293325539 Cleanup previous PR
Revert the changes related to set_options debug_keyboard.
Remove the Carbon framework flag for glfw.
2022-01-10 10:24:10 +08:00
Kovid Goyal
24c44861ef Cleanup previous PR
Simplify wrapping of toggle_secure_input
Dont duplicate debug_keyboard flag in two places
2022-01-09 22:11:22 +05:30
Kovid Goyal
eafd20b4b3 Merge branch 'feat-macos-sec-kbd' of https://github.com/page-down/kitty 2022-01-09 22:03:31 +05:30
pagedown
d9e5edac01 Refactor: Replace double quotes with single quotes 2022-01-09 22:54:33 +08:00
pagedown
f7be4fab48 macOS: Allow mapping secure keyboard entry shortcut 2022-01-09 22:54:03 +08:00
Kovid Goyal
50c822e05a Merge branch 'zsh-integration' of https://github.com/romkatv/kitty 2022-01-09 15:44:43 +05:30
Roman Perepelitsa
6c1fd3015f Fix a minor bug in zsh integration
This bug is extremely unlikely to cause issues.
2022-01-09 10:45:47 +01:00
Kovid Goyal
de3b9634ac Add links to third party shell integrations 2022-01-09 04:30:32 +05:30
Kovid Goyal
722f6163aa Use tabs for zsh/fish in hg kitten docs 2022-01-09 03:54:33 +05:30
Kovid Goyal
82a4e72c85 Merge branch 'patch-1' of https://github.com/ronjouch/kitty 2022-01-09 03:51:54 +05:30
Ronan Jouchet
c40bd7ce82 kittens/hyperlinked_grep: document how to tell fish to autocomplete with rg
It was documented for zsh but not fish (2 lines above).

While looking for how to do the same in fish, I couldn't find how to do
*exactly the same*, but turns out there's a neat way to do both the
aliasing and autocompletion mapping at the same time.

See https://fishshell.com/docs/current/cmds/function.html :

> `-w WRAPPED_COMMAND` or `--wraps=WRAPPED_COMMAND` causes the function
> to inherit completions from the given wrapped command. See the
> documentation for [complete](https://fishshell.com/docs/current/cmds/complete.html#cmd-complete)
> for more information.
2022-01-08 14:43:36 -05:00
Kovid Goyal
356897a32d macOS: Persist "Secure Keyboard Entry" across restarts to match the behavior of Terminal.app
Fixes #4471
2022-01-08 14:13:14 +05:30
Kovid Goyal
ac0c10c170 Simplify if condition 2022-01-08 14:06:22 +05:30
Kovid Goyal
362c4147e4 ... 2022-01-08 12:21:55 +05:30
Kovid Goyal
9b9eae7923 icat: Fix --hold not working with critical errors 2022-01-08 10:22:22 +05:30
Kovid Goyal
8622c47348 Fix #4430 2022-01-08 10:00:25 +05:30
Kovid Goyal
1bfc46a24f ... 2022-01-08 09:16:32 +05:30
Kovid Goyal
8de787a2f3 Create shlex.join if it doesnt exist 2022-01-07 20:17:23 +05:30
Kovid Goyal
fcc75689d8 ... 2022-01-07 18:48:26 +05:30
Kovid Goyal
1eed35b8bb Document launch-actions.conf 2022-01-07 18:47:37 +05:30
Kovid Goyal
1454af2d41 macOS: Allow customizing the launch actions 2022-01-07 18:43:07 +05:30
Kovid Goyal
cbb2597667 Merge branch 'feat-macos-open-with' of https://github.com/page-down/kitty 2022-01-07 17:11:42 +05:30
pagedown
9ca691c0c6 macOS: Add kitty to the open with list for text files and image files 2022-01-07 19:33:29 +08:00
Kovid Goyal
b9f21f285c Remove non-namespaced launch points
As far as I can tell these were non-namespaced by accident
2022-01-07 14:34:41 +05:30
Kovid Goyal
bf84f95a94 macOS: When launching a shell script use its shebang, if present 2022-01-07 13:52:13 +05:30
Kovid Goyal
d42f2071c3 hold windows when running shell scripts via launch services 2022-01-07 13:45:02 +05:30
Kovid Goyal
5c343c918d Add a --hold option for the launch command 2022-01-07 13:32:25 +05:30
Kovid Goyal
5bfed4fe2f Also launch bash/zsh/fish scripts in their respective shells 2022-01-07 12:48:59 +05:30
Kovid Goyal
6c139600a0 macOS: Also open .sh and .command files in the default shell 2022-01-07 12:32:26 +05:30
Kovid Goyal
b80b8524e6 oops 2022-01-07 12:29:57 +05:30
Kovid Goyal
ffa63e27ea macOS: Allow opening text files, images and directories with kitty when launched using "Open with" in Finder
Fixes #4460
2022-01-07 12:25:30 +05:30
Kovid Goyal
a155b081b7 Make hold_till_enter re-useable 2022-01-07 12:13:20 +05:30
Kovid Goyal
04807453ec version 0.24.1 2022-01-06 10:40:59 +05:30
Kovid Goyal
1b7582e85c Merge branch 'patch-1' of https://github.com/Silent-Crafter/kitty 2022-01-06 10:03:45 +05:30
Silent Crafter
e106562ef1 Bash: for loop array iteration fix
the array iteration wasn't implemented correctly for KITTY_SHELL_INTEGRATION variable. the i variable in for loop wasn't iterating through all the elements of that array
2022-01-06 09:52:59 +05:30
Kovid Goyal
d3a20f00d6 Add a comment explaining where we use PS2 marks 2022-01-06 09:25:41 +05:30
Kovid Goyal
de5443a4db Add a reference to the discussion of using custom tab bar themes to the docs 2022-01-06 09:16:22 +05:30
Kovid Goyal
e8b19e08fa Fix non-renderable combining chars causing some text to not be rendered on Linux
The test for non-renderable chars was broken and the variation selectors
were not included in the test. Fixes #4444
2022-01-05 22:33:53 +05:30
Kovid Goyal
a574081012 Merge branch 'zsh-integration' of https://github.com/romkatv/kitty 2022-01-05 21:29:30 +05:30
Roman Perepelitsa
4f06ce9d72 Once again start embedding marks in PS2 on zsh 2022-01-05 16:36:00 +01:00
Kovid Goyal
6713580455 Explicitly turn off aliases in a more functions
Not really needed, but I like to be explicit
2022-01-05 21:04:27 +05:30
Kovid Goyal
86f6c946b3 Merge branch 'zsh-integration-aliases' of https://github.com/romkatv/kitty 2022-01-05 20:49:08 +05:30
Roman Perepelitsa
9194d1db6b Disable aliases when patching functions in zsh integration 2022-01-05 16:16:18 +01:00
Kovid Goyal
420a1b018a Fix #4448 2022-01-05 20:14:23 +05:30
Roman Perepelitsa
8009b85073 Make writing to the TTY more robust in zsh integration
See https://github.com/kovidgoyal/kitty/issues/4440.
2022-01-05 09:55:19 +01:00
Kovid Goyal
2a58af2be9 Ignore all errors rendering /etc/issue 2022-01-05 14:04:56 +05:30
Roman Perepelitsa
4decac26f6 Fix a typo in _ksi_debug_print 2022-01-05 09:22:00 +01:00
Roman Perepelitsa
a6b74f190f Revert "Get _ksi_debug_print working again"
This reverts commit ff63e58f95.
2022-01-05 09:20:33 +01:00
Kovid Goyal
bfbe60c90e Update changelog 2022-01-05 09:05:20 +05:30
Kovid Goyal
384b2f8462 Add roundtrip and cursor positioning tests for all three zero width chars 2022-01-05 08:57:14 +05:30
Kovid Goyal
d875615c03 Fix a regression in the handling of some combining characters such as zero width joiners
Fixes #4439
2022-01-05 08:50:55 +05:30
Kovid Goyal
9aefcfe56f Make --hold a bit more robust 2022-01-05 08:14:22 +05:30
Kovid Goyal
266e70222f Avoid hooking LE widgets at all when using no-cursor 2022-01-05 07:46:20 +05:30
Kovid Goyal
d4639e2aea Merge branch 'zsh-integration' of https://github.com/romkatv/kitty 2022-01-05 07:40:10 +05:30
Roman Perepelitsa
ca8975891b Replace add-zle-hook-widget with a series of hacks in zsh integration 2022-01-04 19:56:57 +01:00
Kovid Goyal
bed3d2eb50 Fix #4434 2022-01-04 23:38:58 +05:30
Kovid Goyal
78495a7f64 spelling 2022-01-04 20:35:21 +05:30
Kovid Goyal
f66914f7bb ... 2022-01-04 20:29:53 +05:30
Kovid Goyal
58e1f6ee1f Use ctermid() for tty_name 2022-01-04 20:25:16 +05:30
Kovid Goyal
0625035202 oops forgot to re-order second tab group 2022-01-04 20:18:49 +05:30
Kovid Goyal
f8fc272f58 Make loading IssueData more robust
Fixes #4424
2022-01-04 19:57:23 +05:30
Kovid Goyal
6d61de8a8f Merge branch 'fladson/fix-documentation-typo' of https://github.com/fladson/kitty 2022-01-04 19:52:27 +05:30
Kovid Goyal
4c08709df1 Use same orders for all tab groups 2022-01-04 19:49:55 +05:30
Fladson Gomes
58a28da94d Fix documentation typo 2022-01-04 14:46:25 +01:00
Kovid Goyal
26b976d17d Merge branch 'fix-mouse-scroll' of https://github.com/page-down/kitty 2022-01-04 18:01:30 +05:30
pagedown
3141fc3f05 Update mouse cursor position when scrolling without OS window focus 2022-01-04 19:39:36 +08:00
Kovid Goyal
a45d6c8b55 Fix #4421 2022-01-04 16:21:00 +05:30
Kovid Goyal
dadf496a68 remove leftover debug print 2022-01-04 12:01:23 +05:30
Kovid Goyal
dae8ae33f0 hints kitten: Fix matching of filenames enclosed in quotes or brackets not stripping the surrounding quotes properly. Fixes #4419 2022-01-04 10:58:31 +05:30
Kovid Goyal
b6254e4a67 version 0.24.0 2022-01-04 08:21:17 +05:30
Kovid Goyal
53431c7ba8 Merge branch 'refactor' of https://github.com/page-down/kitty 2022-01-03 14:31:16 +05:30
pagedown
afa0bb4c1d Avoid using the same variable name in different scopes
Variable names such as a and b are also used in the MIN and MAX macros.
2022-01-03 16:11:20 +08:00
pagedown
9ae2579dcb The window width and height are always greater than zero here 2022-01-03 16:05:24 +08:00
Kovid Goyal
37fe98fdec Fix failure on older python 2022-01-02 09:39:05 +05:30
Kovid Goyal
fe91b74ba7 ... 2022-01-02 09:38:14 +05:30
Kovid Goyal
0fcc446298 Avoid extra type checking import of re 2022-01-02 09:26:52 +05:30
Kovid Goyal
e228f5105e Merge branch 'refactor' of https://github.com/page-down/kitty 2022-01-02 09:23:25 +05:30
Kovid Goyal
719760fd7b Remove unused UNUSED 2022-01-02 09:19:40 +05:30
Kovid Goyal
d3e87bcd4f Another shadowed global variable 2022-01-02 09:04:26 +05:30
Kovid Goyal
be771456e1 Dont shadow global variable name 2022-01-02 08:59:34 +05:30
Kovid Goyal
8514782ad2 Remove unused code
icat already scales images to fit the screen in process_image() so dont
have to consider the case of the image being wider than the screen in
set_cursor()
2022-01-02 08:56:17 +05:30
pagedown
a3e9e0f010 Use the already imported subprocess 2022-01-01 21:29:46 +08:00
pagedown
15615a4cd1 Avoid defining variables with the same name that already exist
Avoid using existing parameter names for local variables.
Avoid using variable names from upper level for nested loops.
Avoid local variables hiding existing global variables.
2022-01-01 21:29:32 +08:00
pagedown
7246fb347c Remove the unused function 2022-01-01 21:29:06 +08:00
pagedown
f1b6fb397b Remove redundant variable assignment 2022-01-01 21:28:55 +08:00
pagedown
49fbeb9a56 Remove the always true conditions
Unsigned integers are always greater than or equal to zero.
The else branch is always the opposite.
2022-01-01 21:27:01 +08:00
Kovid Goyal
f17d71454a ... 2021-12-31 22:51:16 +05:30
Kovid Goyal
59ea7485e4 Fix loading of kitty completions broken by unfunctioning of kitty-integration 2021-12-31 22:49:09 +05:30
Kovid Goyal
ff63e58f95 Get _ksi_debug_print working again 2021-12-31 22:38:39 +05:30
Kovid Goyal
79ec8b60b9 Fix visual select window sometimes showing stale window titles 2021-12-31 21:08:20 +05:30
Kovid Goyal
846c774ac2 DRYer 2021-12-31 20:58:06 +05:30
Kovid Goyal
940e311c74 Add a section to the changelog showcasing major recent new features 2021-12-31 20:38:50 +05:30
Kovid Goyal
251667a30e ... 2021-12-31 09:44:00 +05:30
Kovid Goyal
e45697f78a Fix a regression that broke rendering of unicode regional indicators
At some point, unicode regional indicators became combining chars in the
unicode standard, which broke the handling of them in draw_codepoint().
The fix has the added advantage of improving performance in the common
case by only checking for combining chars. The flag check happens only
if the first check matches.

Fixes #4407
2021-12-31 09:28:47 +05:30
Kovid Goyal
ea63efa522 Merge branch 'refactor-dry' of https://github.com/page-down/kitty 2021-12-31 06:42:46 +05:30
pagedown
60839cdb47 DRYer: Use gl_size to convert coordinates 2021-12-31 09:04:47 +08:00
Kovid Goyal
a867b4444d Clamp border rects to pixels
This uses the same co-ord calculation for border rects as for text
cells. DRYer and avoids borders and blank rects being drawn at haf pixel
offsets.
2021-12-31 06:20:57 +05:30
Kovid Goyal
072fe91518 ... 2021-12-30 20:44:30 +05:30
Kovid Goyal
07e6171dc5 DRYer 2021-12-30 20:32:17 +05:30
Kovid Goyal
9a80fcee37 Ensure sizes for window number decorations are correct 2021-12-30 19:05:06 +05:30
Kovid Goyal
7731a558f0 Merge branch 'fix-shell.nix-on-macOS-arm' of https://github.com/Luflosi/kitty 2021-12-30 17:50:19 +05:30
Luflosi
7ea4c1e47f shell.nix: add dependency needed on Apple silicon
shell.nix is missing a depencency on the UserNotifications framework on macOS with Apple silicon. Unfortunately we can't just unconditionally include this dependency because Nixpkgs uses a different macOS SDK version for macOS on an Intel processor compared to macOS on Apple silicon. The older SDK version 10.12 on Intel does not have the UserNotifications framework, which would lead to an "attribute missing" error when trying to execute `nix-shell`. The condition can be dropped when the macOS SDK version for Intel processors is finally updated. See https://github.com/NixOS/nixpkgs/issues/101229 for progress on that.
See https://github.com/NixOS/nixpkgs/pull/137512 for more context.
Closes https://github.com/kovidgoyal/kitty/issues/4352.
2021-12-28 15:35:16 +01:00
Kovid Goyal
f6b748712c Clamp positions of window numbers/titles to nearest pixel
Avoids jaggies in rendering
2021-12-26 11:05:16 +05:30
Kovid Goyal
93abedd93f Replace the screenshot on the landing page with a video 2021-12-24 13:26:34 +05:30
Kovid Goyal
872cd7b2d5 Fix unfunctioning ofkitty-integration in docs
It has to be unfunctioned after being run once
2021-12-24 10:26:02 +05:30
Kovid Goyal
a7e03f9c63 Merge branch 'docs' of https://github.com/page-down/kitty 2021-12-24 10:23:46 +05:30
pagedown
f53dfb27e2 Docs: Add macOS mouse wheel scrolling and title bar options changes 2021-12-24 12:37:54 +08:00
pagedown
36b4e0edd2 Docs: Also fixed the input issue in toggling non-traditional fullscreen 2021-12-24 12:29:08 +08:00
pagedown
9081947751 Docs: Prefer semi-bold on macOS only 2021-12-24 12:11:02 +08:00
pagedown
f58013f2c6 Docs: Cross-platform IME integration improvements 2021-12-24 12:06:41 +08:00
pagedown
ae35507f80 Use the lowercase kitty 2021-12-24 12:02:54 +08:00
pagedown
73ff508b51 Docs: unfunction kitty-integration 2021-12-24 11:46:08 +08:00
pagedown
b0ccf74029 Docs: Replace Unicode left single quote with ASCII single quote 2021-12-24 11:44:58 +08:00
Kovid Goyal
6046dc8598 Merge branch 'zsh-integration' of https://github.com/romkatv/kitty 2021-12-24 07:55:07 +05:30
Roman Perepelitsa
9bba38bd11 Unfunction kitty-integration in zsh 2021-12-23 19:09:09 +01:00
Kovid Goyal
59505d17d5 Update docs for new zsh integration code 2021-12-23 20:40:46 +05:30
Kovid Goyal
bcecc61b67 Merge branch 'zsh-integration' of https://github.com/romkatv/kitty 2021-12-23 20:06:44 +05:30
Kovid Goyal
f9af273150 Try to convince mypy to play nice 2021-12-23 10:18:42 +05:30
Kovid Goyal
8699f90fa4 Now have sphinx types on dev machine 2021-12-23 10:13:16 +05:30
Kovid Goyal
0a9ba1bc08 ... 2021-12-23 08:11:16 +05:30
Roman Perepelitsa
37741ac808 Add a comment within zsh integration related to cursor shape changes 2021-12-22 15:04:31 +01:00
Roman Perepelitsa
6d790237c3 Rewrite zsh integration
Note:

- Very lightly tested.
- Docs not updated.
2021-12-22 14:04:40 +01:00
Kovid Goyal
70d5a5134f Log a nicer error message when failing to read cwd of a process 2021-12-22 16:22:33 +05:30
Kovid Goyal
ee166c5555 Retry the Linux ARM build as it is pretty flaky 2021-12-22 07:45:10 +05:30
Kovid Goyal
b965fb4806 Launcher: Fix UB when failing to launch because resolving the EXE fails 2021-12-22 07:32:28 +05:30
Kovid Goyal
e49b20bfa7 Merge branch 'feat-titlebar-opt-err' of https://github.com/page-down/kitty 2021-12-21 15:25:57 +05:30
pagedown
8abfb50aed Ignore invalid title bar color 2021-12-21 17:51:00 +08:00
Kovid Goyal
10e0077a6f Merge branch 'feat-macos-titlebar-opt' of https://github.com/page-down/kitty 2021-12-21 13:40:52 +05:30
pagedown
278477b387 Add light and dark to the macOS title bar option 2021-12-21 15:14:08 +08:00
Kovid Goyal
58b7fb41d9 Update how it works for zsh integration
In light of the recent changes by @romkatv
2021-12-21 10:44:45 +05:30
Kovid Goyal
f71e0a6ee8 ... 2021-12-21 10:39:06 +05:30
Kovid Goyal
b59e42c9cc Fix animations getting paused when switching to alternate screen and back 2021-12-21 08:24:43 +05:30
Kovid Goyal
57888af4ea Merge branch 'zsh-integration' of https://github.com/romkatv/kitty 2021-12-20 20:11:52 +05:30
Kovid Goyal
90f2ba474c Fix icat for GIF images broken 2021-12-20 17:54:55 +05:30
Roman Perepelitsa
09d025d88f Minor robustness improvements to zsh shell integration 2021-12-20 13:20:38 +01:00
Kovid Goyal
e18ac4f0f5 ... 2021-12-20 10:47:33 +05:30
Kovid Goyal
63ab35ec7c Add a note about patched NERD fonts to the FAQ entry on fonts 2021-12-20 08:19:42 +05:30
Kovid Goyal
d65ed5993c New bypy CLI for export 2021-12-19 22:42:36 +05:30
Kovid Goyal
6436dfaf14 Bump the bundled libxml2 version 2021-12-19 22:05:06 +05:30
Kovid Goyal
0c4bd96f87 Merge branch 'fix-mouse-scroll' of https://github.com/page-down/kitty 2021-12-17 22:15:55 +05:30
pagedown
6afabf7e2a Fix mouse scrolling kitty window without OS window focus 2021-12-17 23:57:38 +08:00
Kovid Goyal
a4d4cf5819 Fix #4367 2021-12-17 17:35:13 +05:30
Kovid Goyal
1be7425186 Another mypy 0.920 fix 2021-12-17 06:15:10 +05:30
Kovid Goyal
8f0825bc5c Various fixes for mypy 0.920 2021-12-17 05:56:19 +05:30
Kovid Goyal
6a657eec33 New CLI for bypy 2021-12-16 20:37:46 +05:30
Kovid Goyal
ae952605d3 Note about exe_search_path in launch docs 2021-12-16 19:48:17 +05:30
Kovid Goyal
81753706d3 oops 2021-12-15 20:30:11 +05:30
Kovid Goyal
4120be3e2d Allow using "tab" colors in the title template
Fixes #4360
2021-12-15 20:09:23 +05:30
Kovid Goyal
832f73fde9 Fix incorrect example in tab template docs
Should be fmt.bg.default not fmt.bg.normal
Fixes #4360
2021-12-15 19:37:17 +05:30
Kovid Goyal
99d06f0714 See if 0 makes Apple happy 2021-12-15 13:14:02 +05:30
Kovid Goyal
e973c45968 Fix build on XCode 13.1
Apple go on making it harder and harder to support multiple
versions of their pathetic operating system in one code base.

kIOMainPortDefault is the "non-deprecated" replacement for
kIOMasterPortDefault. However, it is now marked as being available only
on macOS 12 and later so it refuses to build in a codebase designed to
run on earlier versions of macOS. Le bubbling sigh.

According to https://developer.apple.com/documentation/iokit/kiomasterportdefault?language=objc
passing NULL has the same effect and avoids the stupid warning.
Hopefully this will work till Apple decides to spend their trillion
dollars doing more stupid shit.
2021-12-15 12:57:46 +05:30
Kovid Goyal
4dbf0c89c3 Suppress warning about sphinx_inline_tabs not being marked for parallel reads 2021-12-15 12:11:32 +05:30
Kovid Goyal
1f264ffec5 Fix push/pop of colors not updating colors on screen until a dynamic color is also changed.
Fixes #4351
2021-12-13 11:17:54 +05:30
Kovid Goyal
547e4a3d7e Merge branch 'fix-fullscreen' of https://github.com/page-down/kitty 2021-12-13 08:38:06 +05:30
pagedown
d0fa0516f5 macOS: Fix keyboard input not working after toggling full screen 2021-12-13 08:58:52 +08:00
Kovid Goyal
2c13005e0f Shutdown the Linux VMs after building 2021-12-12 12:42:29 +05:30
Kovid Goyal
b52990cb39 Merge branch 'docs-enable-kbd-xform' of https://github.com/page-down/kitty 2021-12-12 08:07:09 +05:30
pagedown
0a1390a7f6 Docs: Enable kbd transform when building dirhtml with sphinx 2021-12-12 00:06:28 +08:00
Kovid Goyal
5084f843c9 Merge branch 'fix-rc-scroll-win' of https://github.com/page-down/kitty 2021-12-11 12:40:18 +05:30
pagedown
42b5b1cbf7 Fix remote control scroll-window argument parsing 2021-12-11 14:47:57 +08:00
Kovid Goyal
832f7a862b Merge branch 'docs-kittens' of https://github.com/page-down/kitty 2021-12-10 18:06:05 +05:30
pagedown
0d4a62ccb5 Fix unicode-input docs redirect 2021-12-10 20:29:09 +08:00
Kovid Goyal
3d98501e57 Move custom kitten back
Its not the most interesting thing to read and hence should not be at
the top.
2021-12-10 17:23:12 +05:30
Kovid Goyal
a4fff7abe3 Merge branch 'docs-kittens' of https://github.com/page-down/kitty 2021-12-10 17:22:42 +05:30
Kovid Goyal
f51779d93a Forgot to build ARM binary in publish 2021-12-10 17:12:17 +05:30
pagedown
121d86fb1c Docs: Put custom kitten docs at the top instead of in the middle 2021-12-10 17:35:10 +08:00
pagedown
5956639082 Add unicode-input docs redirect 2021-12-10 17:34:39 +08:00
pagedown
7e449dec4f Docs: Use underscores in kitten document filenames 2021-12-10 17:30:51 +08:00
Kovid Goyal
a938b01246 Build binaries for Linux ARM64 2021-12-10 12:49:58 +05:30
Kovid Goyal
a4cd10c6fb ... 2021-12-10 12:29:49 +05:30
Kovid Goyal
5fd17b4b99 Merge branch 'docs-shortcuts' of https://github.com/page-down/kitty 2021-12-10 12:18:09 +05:30
pagedown
8ae0ae2c93 Docs: use the action name of the shortcut in several places 2021-12-10 14:36:16 +08:00
pagedown
59957a913a List kitten names in the kitten default shortcuts list 2021-12-10 14:33:29 +08:00
Kovid Goyal
49d284cd16 Merge branch 'fix-dbg-dump-lines' of https://github.com/page-down/kitty 2021-12-10 10:32:54 +05:30
pagedown
dedbd14ace Fix action dump_lines_with_attrs 2021-12-10 12:22:21 +08:00
Kovid Goyal
2c6d888b3d ... 2021-12-10 07:36:09 +05:30
Kovid Goyal
9b0a5d6465 Merge branch 'abs-conf-path' of https://github.com/page-down/kitty 2021-12-10 07:32:36 +05:30
Kovid Goyal
32c4f4ccaa location for linux installers has changed with recent bypy changes 2021-12-10 07:23:12 +05:30
Kovid Goyal
8e435dff16 Update the version of Ubuntu the kitty binaries are built on to Bionic
The upgrade was needed as I couldn't get Xenial to boot in the QEMU VM.
In any case Bionic is now three years old and comes with GLIBC 2.27
released on 2018-02-01 which will be almost four years old when the next
version of kitty is released.
2021-12-09 22:28:11 +05:30
pagedown
98e44a8907 Unify resolution of absolute paths or config dir paths 2021-12-09 20:43:07 +08:00
Kovid Goyal
060362bee2 Fix #4332 2021-12-09 13:26:47 +05:30
Kovid Goyal
6bfe9bfe9a Merge branch 'fix-action-paste' of https://github.com/page-down/kitty 2021-12-09 12:52:03 +05:30
pagedown
b4f7cd94a1 Fix paste mappable action 2021-12-09 15:02:27 +08:00
Kovid Goyal
74f21ec774 Add an issue reference 2021-12-09 12:18:48 +05:30
Kovid Goyal
5899e06b6b Merge branch 'fix-docs-scroll' of https://github.com/page-down/kitty 2021-12-09 12:14:06 +05:30
Kovid Goyal
5f744368dd A new option exe_search_path to modify the locations kitty searches for executables to run 2021-12-09 12:13:26 +05:30
pagedown
a4a9290577 Docs: fix conflicts caused by smooth scrolling in Chrome 2021-12-09 14:31:54 +08:00
Kovid Goyal
77b15bf73f ... 2021-12-09 11:51:10 +05:30
Kovid Goyal
f41584c83b Ignore virtual-machines.conf used to specify build VM locations 2021-12-09 11:44:21 +05:30
Kovid Goyal
892b8c03eb Cleanup previous PR 2021-12-09 11:44:13 +05:30
Kovid Goyal
ecdf901c19 Merge branch 'feat-path-search' of https://github.com/page-down/kitty 2021-12-09 11:41:37 +05:30
pagedown
5d1f58427e ... 2021-12-09 11:57:17 +08:00
pagedown
02a7316342 Use the unified PATH search function 2021-12-09 11:32:30 +08:00
Kovid Goyal
3d59e4eac1 Add links to other implementations of the keyboard protocol 2021-12-09 07:18:12 +05:30
Kovid Goyal
50ce698524 oops 2021-12-08 22:21:15 +05:30
Kovid Goyal
32768e7939 Unify the PATH searching algorithm for launch and running children 2021-12-08 20:10:34 +05:30
Kovid Goyal
62dbc1129c When setting the OS Window title strip out CSI escape codes
Fixes #4325
2021-12-08 16:04:23 +05:30
Kovid Goyal
3d0d987984 Merge branch 'docs-url' of https://github.com/page-down/kitty 2021-12-08 15:18:20 +05:30
pagedown
2c78a22270 Docs: generate relative url with link text in document 2021-12-08 17:20:52 +08:00
pagedown
4a7ae0f524 Docs: use pygments styles official website url 2021-12-08 17:20:13 +08:00
Kovid Goyal
bc25e5a8a2 DRYer 2021-12-07 15:52:06 +05:30
Kovid Goyal
4af2526f54 Add a few more default responses for confirmations 2021-12-06 17:41:03 +05:30
Kovid Goyal
8f688fb33b When confirming close restore global state if the ask kitten is aborted without output
Fixes #4320
2021-12-06 17:25:27 +05:30
Kovid Goyal
6e351cd945 Restore ability to use foreground color unchanged for selections 2021-12-06 05:23:41 +05:30
Kovid Goyal
2d66e37dcb Fix selection_forground=none not being respected 2021-12-05 22:00:43 +05:30
Kovid Goyal
2da25d9187 Fix #4318 2021-12-05 20:50:28 +05:30
Kovid Goyal
11badac95d Ensure cell start position is clamped to a pixel 2021-12-05 18:26:25 +05:30
Kovid Goyal
b4024bf7f2 DRYer 2021-12-05 18:21:00 +05:30
Kovid Goyal
759feac95b Make the gl pixel clamping functions more widely available 2021-12-05 18:16:36 +05:30
Kovid Goyal
33de23d01d Remove unused code 2021-12-05 18:03:37 +05:30
Kovid Goyal
3f0ecbb241 Use the new async response framework when setting background/logo images via RC. Avoids having to use --no-response 2021-12-05 18:02:09 +05:30
Kovid Goyal
e91c008357 ... 2021-12-05 17:42:54 +05:30
Kovid Goyal
7a2003c371 Allow ~/ expansion when specify image paths for @ set-(background|logo) 2021-12-05 17:16:17 +05:30
Kovid Goyal
a7eb9850b7 clamp logo position to nearest pixel 2021-12-05 15:53:20 +05:30
Kovid Goyal
f01446ff25 ... 2021-12-05 13:26:06 +05:30
Kovid Goyal
525a32be51 better conversion of logo width/height to gl values
Map the naive value back to an integer using the same algorithm as for
the scissor test and adjust the value if they dont match
2021-12-05 13:21:04 +05:30
Kovid Goyal
73386bd67f Use scissor limits as pixel extents in cell render data
More accurate since that is the actual content area
2021-12-05 13:04:43 +05:30
Kovid Goyal
d1cf88e942 Make the window geometry in pixels available in CellRenderData 2021-12-05 12:29:33 +05:30
Kovid Goyal
c11da595ef Move calculation of window render data into native code
There was no reason to do it in python
2021-12-05 12:21:24 +05:30
Kovid Goyal
2546afb7aa Use a struct to pass around cell render data 2021-12-05 11:57:22 +05:30
Kovid Goyal
56edb5cdbe Merge branch 'feat-nth-os-window' of https://github.com/page-down/kitty 2021-12-05 10:12:16 +05:30
Kovid Goyal
bca3179a6d Forgot that draw_cells() is called with a NULL window when drawing the tab bar
Fixes #4317
2021-12-05 07:44:51 +05:30
pagedown
1f3d86a434 Add a new mappable action nth_os_window to focus OS window 2021-12-04 20:45:01 +08:00
Kovid Goyal
0456399ce5 Fix leak when changing window logo 2021-12-04 14:01:05 +05:30
Kovid Goyal
799881af2d free then clear hash tables 2021-12-04 13:57:25 +05:30
Kovid Goyal
14047588ae Remote control command to set window logo 2021-12-04 13:55:13 +05:30
Kovid Goyal
9d9840a6d8 ... 2021-12-04 12:53:16 +05:30
Kovid Goyal
b36d8d6469 Fix logo rendering under wayland, which requires premult 2021-12-04 12:50:48 +05:30
Kovid Goyal
254ba401d4 Allow specifying window logos in the launch command 2021-12-04 12:37:14 +05:30
Kovid Goyal
3035ba08c3 Interpret relative logo paths relative to conf dir 2021-12-04 07:34:30 +05:30
Kovid Goyal
16201ac873 Use a logo for the kitty shell window 2021-12-03 20:25:07 +05:30
Kovid Goyal
42a2493286 Fade the window logo by a configurable amount 2021-12-03 18:05:59 +05:30
Kovid Goyal
6f48dda8b9 Fix storage of window logos
Store by id not pointer since the pointers are not stable. And use two
hash maps by path and by id for fast lookup.
2021-12-03 17:43:45 +05:30
Kovid Goyal
b8b495ac31 Fix text not rendered when showing window logo 2021-12-03 13:54:28 +05:30
Kovid Goyal
bd1276d079 Update window logos on config reload 2021-12-03 13:47:14 +05:30
Kovid Goyal
bfb87854df Python API to change window logo 2021-12-03 13:38:42 +05:30
Kovid Goyal
f4aba9fc41 Update changelog with new window_logo setting 2021-12-03 13:23:49 +05:30
Kovid Goyal
757c7900d9 Dont draw the window logo during a live resize 2021-12-03 13:20:57 +05:30
Kovid Goyal
3d2877eeb9 More work on per window logo 2021-12-03 13:19:10 +05:30
Kovid Goyal
e04919098f Start work on a per window logo 2021-12-02 11:14:17 +05:30
Kovid Goyal
5d05aeaace ... 2021-12-02 07:28:27 +05:30
Kovid Goyal
142b6fcc00 Use symbolic names 2021-12-01 22:57:02 +05:30
Kovid Goyal
91c0f4e2d9 Document more tmux breakage 2021-12-01 22:38:23 +05:30
Kovid Goyal
89a93af1d5 GitHub says checkouting out HEAD^2 for merge commits is no longer needed for CodeQL 2021-12-01 20:20:58 +05:30
Kovid Goyal
ef07e2941c Fix clamping of background image 2021-12-01 20:12:31 +05:30
Kovid Goyal
0c3a8dadf6 bg uniforms should be reset when options are reloaded 2021-12-01 16:43:15 +05:30
Kovid Goyal
6425715daf Merge branch 'docs-opt-values' of https://github.com/page-down/kitty 2021-12-01 14:11:12 +05:30
pagedown
be110fb38c Docs: wrap long document lines 2021-12-01 15:46:16 +08:00
pagedown
d743206b8c Docs: add valid option values 2021-12-01 15:03:35 +08:00
Kovid Goyal
af7a104f5b Fix typo causing actions to be run multiple times with combine 2021-12-01 10:39:02 +05:30
Kovid Goyal
c0b73986cb Fix #4302 2021-11-30 20:47:16 +05:30
Kovid Goyal
c48049a3bb Merge branch 'docs' of https://github.com/page-down/kitty 2021-11-30 16:59:48 +05:30
pagedown
1cb6250f14 Remove duplicate imports 2021-11-30 18:54:44 +08:00
pagedown
8ed6ee97b2 Docs: replace http url with https, use ripgrep project url and fix typo 2021-11-30 18:53:58 +08:00
pagedown
1d88371604 Docs: separate and wrap each choices 2021-11-30 18:41:20 +08:00
pagedown
8685558a2a Docs: fix remote control launch command description 2021-11-30 18:35:36 +08:00
Kovid Goyal
d372b27ccd Ensure active window is updated when taking over a tab 2021-11-30 14:28:50 +05:30
Kovid Goyal
88410e032f Merge branch 'fix-rc-detach' of https://github.com/page-down/kitty 2021-11-30 12:07:04 +05:30
pagedown
622885853d Fix remote control detach-tab detach-window 2021-11-30 12:38:19 +08:00
Kovid Goyal
0d3c7a64e2 ... 2021-11-30 07:45:49 +05:30
Kovid Goyal
0c274a9a0b Parse actions on demand
This removes the startup cost of parsing hundreds of default actions
when action_alias or kitten_alias are used. Although the cost is on the
order of 1ms, this design feels cleaner and gives nicer debug config
output.
2021-11-29 21:51:42 +05:30
Kovid Goyal
0e5f51f195 Add a note about not copying the kitty binary out of the installation folder 2021-11-29 21:45:30 +05:30
Kovid Goyal
49369d6279 Preserve definition location when resolving 2021-11-29 19:38:38 +05:30
Kovid Goyal
bd288bd18f Linux: Fix release event for the final key in a compose sequence not being reported. Fixes #4285 2021-11-29 19:26:16 +05:30
Kovid Goyal
cdb1138465 ... 2021-11-29 12:42:02 +05:30
Kovid Goyal
c8c6f8691f Store the shell_integration option as a set 2021-11-29 12:41:25 +05:30
Kovid Goyal
9441cf15c3 Move the bash integration script into its own dir
This matches the other shells and might be useful someday
if bash ever gets a way for the invoking process to inject code
into it.

Also use KITTY_INSTALLATION_DIR when loading the bash integration code.
2021-11-29 12:30:10 +05:30
Kovid Goyal
276ed7263c Forgot to use env rather than os.environ when checking for ZDOTDIR 2021-11-29 12:22:33 +05:30
Kovid Goyal
6b38ca3bd2 add verification for parsing shell_integration 2021-11-29 12:04:19 +05:30
Kovid Goyal
c7bf54807e Fix capitalization 2021-11-29 11:49:58 +05:30
Kovid Goyal
b28811846a Fix on creation IME update not being applied because render data was not yet set 2021-11-28 22:57:09 +05:30
Kovid Goyal
5561aa1d37 Allow forcing IME update 2021-11-28 22:53:45 +05:30
Kovid Goyal
8c0111cb08 Merge branch 'issue4292' of https://github.com/ctrlcctrlv/kitty 2021-11-28 22:38:56 +05:30
Fredrick Brennan
0dc8bd5520 Make the GPU selection FAQ item not require root 2021-11-28 11:59:26 -05:00
Kovid Goyal
acdf06bf5d Tell cocoa the previous character range is invalid when updating IME position
Without this IME popup position is sometimes incorrect, for instance, at
startup
2021-11-28 22:11:21 +05:30
Kovid Goyal
5e78b1c23e Merge branch 'fix-ime' of https://github.com/page-down/kitty 2021-11-28 21:21:35 +05:30
pagedown
088b7cde4f Update IME status when window lost focus 2021-11-28 23:09:35 +08:00
Kovid Goyal
6a8aeb2501 Merge branch 'fix-cmd-output' of https://github.com/page-down/kitty 2021-11-28 19:41:52 +05:30
pagedown
9c326397d0 Update the last visited command output position after unscrolling 2021-11-28 21:59:58 +08:00
Kovid Goyal
28d89bdd53 Cleanup previous PR 2021-11-28 19:03:52 +05:30
Kovid Goyal
69ba419afd Merge branch 'issue4292' of https://github.com/ctrlcctrlv/kitty 2021-11-28 18:57:25 +05:30
Fredrick Brennan
afbaa36fd3 Document GPU power saving affecting kitty startup 2021-11-28 08:10:45 -05:00
Kovid Goyal
346ea8c8a0 Forgot to ad dmethod in previous commit 2021-11-28 12:01:09 +05:30
Kovid Goyal
4448444d4b Fix #4289 2021-11-28 11:47:25 +05:30
Kovid Goyal
daefb926d9 Fix zsh kitty completion when the matching style includes anchor based matchers
Debian apparently adds these by default.
2021-11-28 11:02:03 +05:30
Kovid Goyal
0a5c73dee4 Ignore errors when getting screen size for zsh completion output serialization 2021-11-28 10:35:44 +05:30
Kovid Goyal
cb09ae3e84 ... 2021-11-28 10:23:32 +05:30
Kovid Goyal
3d76c916a5 Simplify zsh shell integration code
Use the add-zsh-hook and add-zle-hook-widget functions
2021-11-28 08:45:53 +05:30
Kovid Goyal
0a5ffe9b73 Add a note about _ksi_first_run 2021-11-28 08:14:16 +05:30
Kovid Goyal
325603bf41 Shell integration zsh: Handle the case when a function that breaks prompt marking is installed after _ksi_precmd
We now install the real precmd hook only in the first run of the precmd
hook. This ensures that our precmd and preexec hooks are run last,
unless something else uses this trick, which is unlikely, and at that
point, the user is on their own.

Also ensure that the integration script is run only once even if the
user tries to source it twice with setting of KITTY_SHELL_INTEGRATION
each time.
2021-11-27 12:24:19 +05:30
Kovid Goyal
3e3744753d DRYer 2021-11-27 11:13:26 +05:30
Kovid Goyal
5bc2fa187c Change the order of file checks since .zshrc is most likely to exist 2021-11-27 10:27:51 +05:30
Kovid Goyal
0a9005f5ce Allow zsh-newuser-install to run
Shell integration wont be turned on for an unconfigured zsh
2021-11-27 10:21:39 +05:30
Kovid Goyal
5d491b8067 Fix include path for new kitty.zsh location 2021-11-27 08:03:43 +05:30
Kovid Goyal
16b4a4fa80 Forgot to change test for new zsh shell integration code 2021-11-27 07:49:32 +05:30
Kovid Goyal
f6e0eb4005 Shell integration: Dont modify ~/.zshrc
Instead use the ZDOTDIR env var to load the shell integration code
2021-11-27 07:19:59 +05:30
Kovid Goyal
a3370a1d18 Document the delta transmission protocol 2021-11-26 15:08:18 +05:30
Kovid Goyal
2770a853f6 Merge branch 'docs-kbd' of https://github.com/page-down/kitty 2021-11-26 07:54:47 +05:30
pagedown
bd4399b5fc ... 2021-11-26 09:26:07 +08:00
Kovid Goyal
432df2089c Merge pull request #4277 from kovidgoyal/imgbot
[ImgBot] Optimize images
2021-11-25 11:14:43 +05:30
ImgBotApp
d9d922546f [ImgBot] Optimize images
*Total -- 1,755.23kb -> 1,446.79kb (17.57%)

/logo/kitty.svg -- 8.90kb -> 5.57kb (37.39%)
/docs/screenshots/transfer.png -- 31.21kb -> 22.24kb (28.73%)
/docs/screenshots/themes.png -- 139.72kb -> 110.23kb (21.1%)
/logo/beam-cursor@2x.png -- 1.47kb -> 1.19kb (18.76%)
/docs/screenshots/screenshot.png -- 1,178.10kb -> 958.20kb (18.67%)
/docs/screenshots/remote_file.png -- 54.77kb -> 45.50kb (16.93%)
/docs/screenshots/hints_mode.png -- 61.53kb -> 52.64kb (14.45%)
/docs/screenshots/unicode.png -- 87.86kb -> 75.63kb (13.92%)
/docs/screenshots/panel.png -- 11.81kb -> 10.49kb (11.21%)
/docs/screenshots/diff.png -- 131.05kb -> 118.51kb (9.57%)
/docs/screenshots/splits.png -- 42.34kb -> 40.15kb (5.17%)
/logo/kitty-framed.svg -- 6.49kb -> 6.45kb (0.59%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
2021-11-25 05:39:11 +00:00
Kovid Goyal
00167cd9ab Merge branch 'docs-kbd' of https://github.com/page-down/kitty 2021-11-25 10:58:29 +05:30
pagedown
1692516955 ... 2021-11-25 13:24:46 +08:00
Kovid Goyal
0bcf73f980 ... 2021-11-25 10:35:53 +05:30
Kovid Goyal
e68914f46b Rationalize usage of :kbd: 2021-11-25 10:34:25 +05:30
Kovid Goyal
fd331480fc ... 2021-11-25 10:11:12 +05:30
Kovid Goyal
ccf4a0e5e5 Merge branch 'docs-modifier-keys' of https://github.com/page-down/kitty 2021-11-25 10:10:47 +05:30
pagedown
77aa3e7e11 Use Unicode characters for modifier keys 2021-11-25 12:00:36 +08:00
pagedown
716d588ba9 Add command modifier key full name and unicode for ctrl and shift 2021-11-25 11:57:26 +08:00
Kovid Goyal
83041b1c97 Fix #4273 2021-11-25 08:02:49 +05:30
Kovid Goyal
e6311edf53 ... 2021-11-24 19:52:22 +05:30
Kovid Goyal
617316e8d9 Linux: Use copy_file_range for defrag of the disk cache which should give even better performance on filesystems that support it 2021-11-24 19:42:00 +05:30
Kovid Goyal
bd21b79959 Only malloc the buffer for fast file copy when needed 2021-11-24 18:20:37 +05:30
Kovid Goyal
732ff7ee58 Move copy between files into its own module 2021-11-24 16:42:52 +05:30
Kovid Goyal
f081d6a421 Fix #4270 2021-11-24 16:37:27 +05:30
Kovid Goyal
3592a94517 Document the handling of links in the file transfer protocol 2021-11-24 09:03:59 +05:30
Kovid Goyal
e5de16bb01 Use fid_abs prefix for absolute symlinks 2021-11-24 08:41:16 +05:30
Kovid Goyal
a62e831932 Clear prompt markings when erasing the display
Fixes prompt detection failing after ctrl+l
2021-11-24 08:17:04 +05:30
Kovid Goyal
b35dd5a869 Mention updated packager notes in changelog 2021-11-24 08:05:10 +05:30
Kovid Goyal
ec28bd93c3 Minor updates to file transfer protocol docs 2021-11-23 22:29:30 +05:30
Kovid Goyal
c44b5bb03f Allow aliases to apply to default shortcuts as well
The extra reparse costs 0.5ms at startup on my machine and is only incurred if
at least one alias is actually defined.
2021-11-23 20:24:12 +05:30
Kovid Goyal
313add715c Use original definition for no-op 2021-11-23 19:51:25 +05:30
Kovid Goyal
56ea741126 Nicer repr for key definitions 2021-11-23 18:19:34 +05:30
Kovid Goyal
9dbdd58311 Avoid spurious exception printed to stderr when terminating a key sequence with an invalid key 2021-11-23 16:29:10 +05:30
Kovid Goyal
2ca13e886a Avoid cyclic infinite recursion
Note that this means that any alias is only expanded once per action
2021-11-23 15:36:58 +05:30
Kovid Goyal
314efe4f68 Ignore empty alias 2021-11-23 15:10:59 +05:30
Kovid Goyal
ebd2de042d Merge branch 'docs-conf-fmt' of https://github.com/page-down/kitty 2021-11-23 15:07:28 +05:30
Kovid Goyal
c46c551fee ... 2021-11-23 15:07:03 +05:30
Kovid Goyal
cecca854c0 Forgot to port parsing of open actions to use the new action_alias infra 2021-11-23 15:02:19 +05:30
Kovid Goyal
d7df4fa5dc Leave kitten_alias documented 2021-11-23 14:48:45 +05:30
pagedown
3651a101d0 Append long_text only if at least one documented option exists 2021-11-23 17:15:58 +08:00
Kovid Goyal
a97a05b1ec Allow action_alias to work with any action 2021-11-23 14:43:36 +05:30
Kovid Goyal
ee2520e036 Also prevent infinite recursion in kitten_alias 2021-11-23 07:53:40 +05:30
Kovid Goyal
88150b2012 Dont document kitten_alias as it is deprecated 2021-11-22 23:04:59 +05:30
Kovid Goyal
9161c71b51 Show the user an error message when pressing a key results in an exception 2021-11-22 23:01:44 +05:30
Kovid Goyal
d7f569b341 Add a test for recursion 2021-11-22 22:54:21 +05:30
Kovid Goyal
5dfa02b45f Better fix for infinite recursion 2021-11-22 22:44:41 +05:30
Kovid Goyal
45e629c56b Avoid infinite recursion for action_alias 2021-11-22 22:43:06 +05:30
Kovid Goyal
ee437ca2d7 Add a note about kitten invocation 2021-11-22 22:38:56 +05:30
Kovid Goyal
0293d957b2 When using combine to perform multiple actions, perform subsequent actions on event loop ticks, so that they can operate on the result of the previous action
This brings combine into line with open_actions
2021-11-22 22:20:28 +05:30
Kovid Goyal
89069407d2 Make action_alias recursive 2021-11-22 22:15:04 +05:30
Kovid Goyal
495b29bf21 Make nth_window focus the last window for numbers larger than the number of windows
Fix #4262
2021-11-22 22:02:07 +05:30
Kovid Goyal
ec5165d958 Fix action_alias not working when used with arguments 2021-11-22 21:41:55 +05:30
Kovid Goyal
1da8ad3839 Fix some type errors 2021-11-22 21:16:09 +05:30
Kovid Goyal
e97afb3433 Make the repr of SingleKey shorter 2021-11-22 20:40:42 +05:30
Kovid Goyal
a824a45602 Merge branch 'docs-conf-fmt' of https://github.com/page-down/kitty 2021-11-22 20:17:47 +05:30
pagedown
20e546b496 Formatting config options that are not added to default 2021-11-22 22:39:19 +08:00
Kovid Goyal
bf8e18441a Map action URLs automatically for all actions 2021-11-22 20:05:27 +05:30
Kovid Goyal
c5af9613fd Fix building of docs 2021-11-22 20:02:18 +05:30
Kovid Goyal
9ce807069a Replace kitten_alias with action_alias in docs 2021-11-22 19:57:54 +05:30
Kovid Goyal
aa4fa4cc85 Allow defining aliases for more general actions, not just kittens
Fixes #4260
2021-11-22 19:52:43 +05:30
Kovid Goyal
727c69ffdd Mark :code: in CLI help output 2021-11-21 22:44:43 +05:30
Kovid Goyal
b7a28afe7e missed a couple of options 2021-11-21 22:41:30 +05:30
Kovid Goyal
12bcee3b78 Fix #4258 2021-11-21 22:39:36 +05:30
Kovid Goyal
f3376601f2 Mark various options in text correctly 2021-11-21 22:37:11 +05:30
Kovid Goyal
ecea1ba241 ... 2021-11-21 10:05:47 +05:30
Kovid Goyal
81467c2e7e ... 2021-11-20 07:36:52 +05:30
Kovid Goyal
889f2fce6d Avoid deprecation warning from Apple
Apparently Apple invent half-assed language extensions like @available
and then dont implement them properly
2021-11-20 06:08:30 +05:30
Kovid Goyal
ae6318cb5a Forgot to add definitions of the notification constants for old SDKs 2021-11-20 04:58:53 +05:30
Kovid Goyal
19e653ef1b Fix building on older macOS SDKs 2021-11-20 04:42:01 +05:30
Kovid Goyal
d6949a7a3c ... 2021-11-19 22:52:57 +05:30
Kovid Goyal
5050a01856 Update shell integration features list 2021-11-19 22:51:40 +05:30
Kovid Goyal
564f865a63 Fix the :italic: role used for CLI docs not being rendered correctly in the HTML docs 2021-11-19 14:28:05 +05:30
Kovid Goyal
c1cb196365 Set the media role when playing the bell sound to "event"
Fixes #4256
2021-11-19 14:14:50 +05:30
Kovid Goyal
ca0fcada42 Merge branch 'feat-macos-notif-snd' of https://github.com/page-down/kitty 2021-11-19 12:33:34 +05:30
pagedown
8e87b639fa Use macOS 11.0 version number 2021-11-19 14:41:19 +08:00
pagedown
fccba24f0b Allow macOS notification to play sound 2021-11-19 14:41:18 +08:00
Kovid Goyal
62e32ea108 More clarification on windows' file permissions 2021-11-19 10:10:14 +05:30
Kovid Goyal
b17fe747fc Document the representation of file metadata 2021-11-19 10:02:52 +05:30
Kovid Goyal
ccc2d7d2da Document file compression 2021-11-19 09:21:09 +05:30
Kovid Goyal
a528b45d60 More transfer protocol docs 2021-11-19 09:09:01 +05:30
Kovid Goyal
0c84285473 Note chunk size in both modes 2021-11-18 23:04:07 +05:30
Kovid Goyal
1df7400ad5 And an example serialization 2021-11-18 23:01:35 +05:30
Kovid Goyal
1cb65438fe ... 2021-11-18 22:54:55 +05:30
Kovid Goyal
cd5dd131d5 Explain shortening of key names during serialization 2021-11-18 22:54:35 +05:30
Kovid Goyal
f0e8ab8f31 Drop support for python 3.6
It is being EOLed next month (https://www.python.org/dev/peps/pep-0494/)
which is when I expect the next kitty release as well
2021-11-18 22:44:41 +05:30
Kovid Goyal
bfdb09d29f ... 2021-11-18 22:34:58 +05:30
Kovid Goyal
a81e5dd8a5 More documentation of the file transfer protocol 2021-11-18 22:33:25 +05:30
Kovid Goyal
ddb1fcf430 Forgot to end receive sessions 2021-11-18 22:31:05 +05:30
Kovid Goyal
646726b385 ... 2021-11-18 21:23:20 +05:30
Kovid Goyal
d47a80c8e8 Document the escape code format for the file transmission protocol 2021-11-18 21:19:56 +05:30
Kovid Goyal
5f4e326985 Start work on documenting the file transfer protocol 2021-11-18 20:33:06 +05:30
Kovid Goyal
18e747babf Merge branch 'ibus_move_overlay_linefeed' of https://github.com/martinetd/kitty 2021-11-18 12:29:28 +05:30
Kovid Goyal
a3ec988d07 Old python compat 2021-11-18 12:28:03 +05:30
Dominique Martinet
b992a448b1 screen_linefeed: add missing MOVE_OVERLAY_LINE_WITH_CURSOR
fixes ibus positioning problem when shell outputs text with pre-edit
overlay open as per suggestion in this comment:
https://github.com/kovidgoyal/kitty/issues/1000#issuecomment-972550266
2021-11-18 14:31:57 +09:00
Kovid Goyal
c29f50b0d6 Use shorter field names when serializing file transmission commands to reduce overhead 2021-11-18 10:55:57 +05:30
Kovid Goyal
d30ba9654f Nicer formatting of mappings in the comment conf file 2021-11-18 09:21:24 +05:30
Kovid Goyal
3e3dc26e3f Dont duplicate help text 2021-11-18 08:50:43 +05:30
Kovid Goyal
a78138ab61 Add a reference to ctrl+shift+right click in the overview 2021-11-18 08:42:30 +05:30
Kovid Goyal
8fd5f184b7 Merge branch 'feat-cmd-output-mouse-pager' of https://github.com/page-down/kitty 2021-11-18 08:27:11 +05:30
pagedown
fe075ea795 Unset the last visited command output position 2021-11-17 23:00:27 +08:00
pagedown
37b6677608 ... 2021-11-17 22:34:45 +08:00
pagedown
b91809eaa4 Allows to open the command output in pager by mouse click 2021-11-17 22:25:49 +08:00
Kovid Goyal
ca214ffe78 transfer receive: ensure open files are closed 2021-11-17 15:45:13 +05:30
Kovid Goyal
715925795f Ignore errors in various finalizers during exit
This was needed for tui loop to exit cleanly when terminal i/o breaks
2021-11-17 15:43:26 +05:30
Kovid Goyal
17a48f6b9f TUI: exit cleanly when I/O to terminal fails 2021-11-17 15:33:23 +05:30
Kovid Goyal
5c7a1d1b05 Fix typo 2021-11-17 15:19:17 +05:30
Kovid Goyal
46e51811e8 Dont rise an exception in patchfile close()
This allows partial transfers, by overwriting the dest file with the
tempfile even if the transfer was not completed
2021-11-17 14:34:14 +05:30
Kovid Goyal
34df7f6bc8 More docs on file transfer 2021-11-17 14:29:06 +05:30
Kovid Goyal
e8331b23d9 More file transfer docs 2021-11-17 14:12:10 +05:30
Kovid Goyal
1a92f99831 ... 2021-11-17 13:55:33 +05:30
Kovid Goyal
6c95828e6e Add a screenshot of the transfer kitten 2021-11-17 13:26:22 +05:30
Kovid Goyal
14142c320a fix incorrect repeat counts 2021-11-17 13:24:35 +05:30
Kovid Goyal
727260e69b ... 2021-11-17 13:16:50 +05:30
Kovid Goyal
ad804cc01e Redraw progress bar on resize 2021-11-17 13:04:07 +05:30
Kovid Goyal
dab51d33f5 ... 2021-11-17 12:40:06 +05:30
Kovid Goyal
77d7a6180f unicode input kitten: Also allow using ctrl+number to switch tabs and pressing any modifier with the function keys 2021-11-17 12:17:46 +05:30
Kovid Goyal
185669ec72 Use a shorter random id for transfers
Reduces overhead and we dont actually need protection against malicious
actors, only accidental collisions
2021-11-17 11:47:46 +05:30
Kovid Goyal
e68debc94e Handle blocking io errors when writing all to an fd 2021-11-17 11:45:15 +05:30
Kovid Goyal
18ed56b639 Handle all failed using rsync while waiting for path confirmation 2021-11-17 11:28:19 +05:30
Kovid Goyal
dc2bac0068 Only print rsync stats if some data was transferred 2021-11-17 11:18:31 +05:30
Kovid Goyal
005ab58b15 Fix single file transfer path name mapping for receive 2021-11-17 11:07:50 +05:30
Kovid Goyal
c0ff12a7de ... 2021-11-17 10:46:33 +05:30
Kovid Goyal
b11b04ef67 Start documenting the file transfer kitten 2021-11-17 10:33:37 +05:30
Kovid Goyal
c8aba303e8 Merge branch 'docs-ksi' of https://github.com/page-down/kitty 2021-11-16 22:25:18 +05:30
pagedown
555efa4b70 Docs: scrolling to the last jumped position 2021-11-17 00:31:03 +08:00
Kovid Goyal
da3c6945ae There is no need to modify metadata.json when submitting a new theme as that is done by the gen-metadata.py script when merging 2021-11-16 21:46:46 +05:30
Kovid Goyal
12c8fe32d5 Merge branch 'doc/contributing-themes' of https://github.com/erincerys/kitty 2021-11-16 21:42:54 +05:30
Kovid Goyal
053d9df0fe ... 2021-11-16 21:41:21 +05:30
Kovid Goyal
595ab448be Merge branch 'doc/build-deps' of https://github.com/erincerys/kitty 2021-11-16 21:39:50 +05:30
Kovid Goyal
86fec106e0 Document the new ways to browse command output 2021-11-16 21:37:08 +05:30
erin
b9b50bf7b4 Improve doc on building from source
- Reformat build-time dependency list for readability
- Add build-time package dep of librsync-dev
2021-11-16 07:58:02 -08:00
erin
9abd5bf743 Improve theming doc's contriubting section
- Add link to metadata file
- Add link to working with pull requests
- Elaborate on the minutiae of steps involved
2021-11-16 07:52:21 -08:00
Kovid Goyal
31bf212a60 Merge branch 'feat-cmd-output-mouse-sel' of https://github.com/page-down/kitty 2021-11-16 21:21:26 +05:30
Kovid Goyal
624ef272fd Merge branch 'nvim_move_overlay_line' of https://github.com/pjm0616/kitty 2021-11-16 21:18:28 +05:30
Park, Jeongmin
7c59afbca9 Also move overlay line for CSI ECH,DCH
Without this Neovim banner might not be properly cleared when overlay
text is active.
2021-11-17 00:27:13 +09:00
Kovid Goyal
67a92d7dc2 Fix iterating over nested directories of depth > 1 2021-11-16 20:50:09 +05:30
pagedown
369f4125e1 ... 2021-11-16 20:56:57 +08:00
pagedown
aebf654e15 Add command output mouse selection 2021-11-16 18:15:53 +08:00
Kovid Goyal
d936ede790 Finish up rsync for file receives 2021-11-16 15:10:37 +05:30
Kovid Goyal
cd4ded6132 More type checkable code 2021-11-16 14:33:37 +05:30
Kovid Goyal
1603b4b522 More work on rsync based receive 2021-11-16 14:21:42 +05:30
Kovid Goyal
0eac514e52 More rsync integration work 2021-11-16 13:06:16 +05:30
Kovid Goyal
63399fe975 Start work on rsync integration for receiving files 2021-11-16 10:58:32 +05:30
Kovid Goyal
bc03b4dff6 Add a screenshot of the themes kitten 2021-11-15 19:16:24 +05:30
Kovid Goyal
cb2a99bd0e Merge branch 'def-conf-shortcuts' of https://github.com/page-down/kitty 2021-11-15 17:15:44 +05:30
Kovid Goyal
2cc3922108 Resizing the screen does not cause multiple consecutive output start anymore 2021-11-15 15:17:34 +05:30
Kovid Goyal
e771e1ea8a Do not call range_line_() with unsafe parameters in find_cmd_output 2021-11-15 15:17:34 +05:30
Kovid Goyal
6afaec1d62 Use a single function for getting command output 2021-11-15 15:17:34 +05:30
Kovid Goyal
80b5f31256 Cleanup handling of types of kitten input 2021-11-15 15:17:34 +05:30
Kovid Goyal
c96e6822e1 Dont rely on historybuf->count being a constant
This may become dynamically resizable someday
2021-11-15 15:17:34 +05:30
pagedown
e4781b8af0 ... 2021-11-15 15:17:34 +05:30
pagedown
f3dd2a8bfd Get the first command output on screen and the last scrolled one 2021-11-15 15:17:33 +05:30
pagedown
9fe9c74021 Save the last jumped prompt position 2021-11-15 15:17:33 +05:30
pagedown
09c6c3e804 Unify modifier keys ordering ctrl+shift+alt/opt+cmd, and names 2021-11-15 17:38:07 +08:00
pagedown
f5023e3269 Unify option key names, abbreviations, and ordering 2021-11-15 17:26:37 +08:00
pagedown
2db7f559e3 Add the option key abbreviation opt 2021-11-15 17:22:20 +08:00
pagedown
b696d3f960 Include all default shortcuts in the commented config 2021-11-15 17:05:45 +08:00
Kovid Goyal
bc454b4417 Fix --long-opt= completion for bash as well 2021-11-14 13:35:36 +05:30
Kovid Goyal
aa6a800d1a Fix completion for --long-opt= form on zsh 2021-11-14 13:28:09 +05:30
Kovid Goyal
536d6e00d9 Further simplify logic for PUA space ligatures 2021-11-14 12:47:54 +05:30
Kovid Goyal
725a04b321 Fix #4236 2021-11-14 12:42:08 +05:30
Kovid Goyal
3ff8cc58e1 Ignore invalid unicode condepoints in command lines 2021-11-14 11:59:02 +05:30
Kovid Goyal
4fc8267264 Fix #4235 2021-11-14 10:23:42 +05:30
Kovid Goyal
0965fc45f2 macOS: Fix keyboard input not working after toggling traditional fullscreen till the window is clicked in 2021-11-13 14:20:18 +05:30
Kovid Goyal
181178b0ea macOS: use a consistent technique to get window size
This fixes an issue where restoring from traditional fullscreen to a
maximized state was resulting in an incorrectly sized frame buffer. Now
all framebuffer and window size calculation happens in the same way in
all the various glfw codepaths that do it.
2021-11-13 13:42:12 +05:30
Kovid Goyal
95e6e80921 Restore maximized window state when returning from fullscreen 2021-11-13 12:22:52 +05:30
Kovid Goyal
f36b71350d Use an anonymous struct for before_fullscreen 2021-11-13 12:15:27 +05:30
Kovid Goyal
3483722475 Remove pointless code 2021-11-13 12:13:28 +05:30
Kovid Goyal
56e63baf5a macOS: manually trigger windowDidResize when fullscreening
Fixes #4230
Fixes #4229
2021-11-13 11:49:55 +05:30
Kovid Goyal
0830e66e76 broadcast kitten: Show a "fake" cursor in all windows being broadcast too
Fixes #4225
2021-11-12 22:59:20 +05:30
Kovid Goyal
74a5d3a25e allow multiple close and removal actions 2021-11-12 21:16:21 +05:30
Kovid Goyal
4fb29e1b6b Infrastructure to render the unfocused cursor in multiple windows 2021-11-12 20:42:37 +05:30
Kovid Goyal
2c4f616213 Make it easier to reuse collect_cursor_info() 2021-11-12 20:31:29 +05:30
Kovid Goyal
75afe7cd33 Also move overlay line when handling SGR 2021-11-12 19:56:44 +05:30
Kovid Goyal
80eb78033f Better name for macro
What it actually does is move the overlay line to the new cursor location
2021-11-12 19:51:28 +05:30
Kovid Goyal
68013e8fe7 Move overlay line for a few more commands 2021-11-12 19:38:54 +05:30
Kovid Goyal
7fe32301c4 Use __func__ instead of manually specifying function names 2021-11-12 19:23:09 +05:30
Kovid Goyal
41ddc7d33f DRYer 2021-11-12 18:26:18 +05:30
Kovid Goyal
eff5840645 overlay line should move even when using REP 2021-11-12 18:03:37 +05:30
Kovid Goyal
ddf0242f56 Add a changelog entry for IME changes 2021-11-12 17:58:05 +05:30
Kovid Goyal
eae5c65d3e Also move overlay when getting backspace from child
zsh for some reason sends this when you send it a word. Fixes #4219
2021-11-12 17:56:04 +05:30
Kovid Goyal
c85b545f8d Add a debug print when receiving text from child while overlay is active 2021-11-12 17:43:01 +05:30
Kovid Goyal
f24dc80c49 Send IME events in the correct sequence when cocoa both inserts text and marks new text in response to the same key event 2021-11-12 17:27:37 +05:30
Kovid Goyal
9a9de0038c Remove unused code 2021-11-12 15:10:33 +05:30
Kovid Goyal
35626d3929 Update IME position when overlay line is moved on input from child process 2021-11-12 15:07:25 +05:30
Kovid Goyal
c8f26dd968 When text is received from the terminal program and the overlay line is active move the overlay line after drawing the text
This ensures the overlay line follows the current cursor position
2021-11-12 15:03:24 +05:30
Kovid Goyal
7e5cb50925 macOS: Also update IME position when new window is focused 2021-11-12 09:22:36 +05:30
Kovid Goyal
ffa755c723 macOS: Ensure IME position is correct on startup 2021-11-12 09:18:34 +05:30
Kovid Goyal
a060bf7223 Also unmark text on pressing esc
As with backspace, without this the preedit text is not cleared when the
IME is canceled by esc
2021-11-12 08:52:32 +05:30
Kovid Goyal
4ab5d97e9b macOS: Fix IME position incorrect after moving OS window 2021-11-12 08:51:03 +05:30
Kovid Goyal
81babd29e7 DRYer 2021-11-11 22:53:24 +05:30
Kovid Goyal
fac76ddedd DRYer 2021-11-11 22:41:59 +05:30
Kovid Goyal
f34cc1861a Clear marked text when text is inserted
This is apparently what Cocoa expects. Fixes committing pre-edit text no
longer working.
2021-11-11 22:35:02 +05:30
Kovid Goyal
bd4ed38a3c Dump more informatin about what cocoa does when processing key events 2021-11-11 22:32:30 +05:30
Kovid Goyal
8644fed534 Only unmark on backspace key 2021-11-11 22:05:39 +05:30
Kovid Goyal
ca9fdadf3c Dont clear marked text on every keyDown event
Let the input system do it for us. That wy we can hopefully use calls to
unmarkText as a signal to commit the pre-edit text.

Hopefully not clearing the marked text on key down doesnt break anything
else.
2021-11-11 21:14:53 +05:30
Kovid Goyal
228364e317 oops 2021-11-11 20:53:14 +05:30
Kovid Goyal
e65aee4533 Cleanup calls to unmarkText 2021-11-11 20:44:43 +05:30
Kovid Goyal
a1ca607f35 More work on file transmission 2021-11-11 20:05:54 +05:30
Kovid Goyal
efbf156f82 Add a note about mintty support of unscroll 2021-11-11 16:53:59 +05:30
Kovid Goyal
a2533e9a46 Render the progress bar for file receives 2021-11-11 16:32:06 +05:30
Kovid Goyal
09742af92b Forgot to remove some debug prints 2021-11-11 14:42:11 +05:30
Kovid Goyal
880de53d59 When remembering OS window sizes for full screen windows use the size before the window became fullscreen
Fixes #4221
2021-11-11 14:34:02 +05:30
Kovid Goyal
91a24dd2eb oops 2021-11-11 13:56:18 +05:30
Kovid Goyal
60e91b018a Wrap the glfw is fullscreen API 2021-11-11 12:46:13 +05:30
Kovid Goyal
9be37f7d2d cocoa is weird 2021-11-11 12:45:03 +05:30
Kovid Goyal
be79fc1c92 Save before fullscreen sizes even when using normal fullscreen on macOS 2021-11-11 12:40:56 +05:30
Kovid Goyal
502960bfeb Forgot to update the GLFW wrappers 2021-11-11 12:34:57 +05:30
Kovid Goyal
d95a00df73 GLFW API to check if window is fullscreen 2021-11-11 12:33:12 +05:30
Kovid Goyal
b3a9c1a100 Better error message when KITTY_LISTEN_ON is invalid 2021-11-10 08:27:45 +05:30
Kovid Goyal
4318d2d7d0 Cleanup previous PR
Doesnt need a separate changelog entry as its covered by the entry for
focus_visible_window
2021-11-09 22:23:48 +05:30
Kovid Goyal
c3ff888981 Merge branch 'feat-vis-sel-custom-chars' of https://github.com/page-down/kitty 2021-11-09 22:10:00 +05:30
Kovid Goyal
7c85616dcf Add a note about arguments to layout_action rotate 2021-11-09 21:33:55 +05:30
pagedown
353a48d913 Allows to configure the characters for visual window select 2021-11-09 21:05:31 +08:00
Kovid Goyal
4e736e83a3 Also release excess memory from pagerhist buffer when clearing 2021-11-09 10:21:47 +05:30
Kovid Goyal
57583d6b00 When clearing scrollback release used memory beyond ~2000 lines 2021-11-09 10:14:52 +05:30
Kovid Goyal
98dcb32a0c Dedicated function to free a segment 2021-11-09 10:07:14 +05:30
Kovid Goyal
fba5e3a46d Add note for packagers to create kitty shell integration package for servers 2021-11-08 11:56:08 +05:30
Kovid Goyal
2122304515 Only run manual shell integration is KITTY_INSTALLATION_DIR is set
Also add a note about how to get it to work with SSH.
2021-11-08 11:50:21 +05:30
Kovid Goyal
80dbebf0ad Remove unused code 2021-11-08 11:43:14 +05:30
Kovid Goyal
0c160eab7b Avoid needing to exec kitty to get manual shell integration 2021-11-08 11:37:50 +05:30
Kovid Goyal
4841502959 Use a single kitty invocation for manual shell integration 2021-11-08 11:27:10 +05:30
Kovid Goyal
8218df82f2 Add function to get path to integration script for the current shell
Makes setting up manual shell integration much easier. Also clean up
integration docs.
2021-11-08 11:11:16 +05:30
Kovid Goyal
fadc1b539b Merge branch 'docs-ksi-fish' of https://github.com/page-down/kitty 2021-11-08 10:24:49 +05:30
pagedown
c8162324ed ... 2021-11-08 11:36:40 +08:00
pagedown
2c46378886 Add how the fish shell integration works and how to configure it manually 2021-11-08 11:26:15 +08:00
Kovid Goyal
cf7e43fa26 Simplify nested if 2021-11-07 19:23:31 +05:30
Kovid Goyal
b5e8b5a124 Allow users to modify XDG_DATA_DIRS in the fish rc files
The only downside of this new technique is that it is no
longer possible to set XDG_DATA_DIRS to an empty var in kitty.conf
Since an empty XDG_DATA_DIRS breaks lots fo things, I dont think that
is a big concern.
2021-11-07 18:59:50 +05:30
Kovid Goyal
6fa0a21b3c Cancel visual select when its OS Window or Tab is closed 2021-11-07 18:12:50 +05:30
Kovid Goyal
c43637f6cc Dont copy prompt start bits to multiple lines when resizing the screen
This makes it unnecessary to modify the prompt marking protocol to
distinguish consecutive prompts without output in between
2021-11-07 18:00:06 +05:30
Kovid Goyal
f48a430493 Use --global when re-exporting XDG_DATA_DIRS 2021-11-07 10:31:57 +05:30
Kovid Goyal
a1eb341817 ... 2021-11-07 10:25:13 +05:30
Kovid Goyal
cc2419911c shell environ modification should only happen for actual shell processes 2021-11-07 10:22:37 +05:30
Kovid Goyal
2f5d3b073d Ignore exceptions in the environment modifier 2021-11-07 10:13:09 +05:30
Kovid Goyal
4c0a7a9566 KSI should be set even when no-rc is specified 2021-11-07 10:10:19 +05:30
Kovid Goyal
35514e0cc3 Dont change XDG_DATA_DIRS for child processes in fish shell integration
Fixes #4199
2021-11-07 10:06:18 +05:30
Kovid Goyal
0f23edeec3 Fix breakage caused by Color no longer being iterable 2021-11-07 07:15:55 +05:30
Kovid Goyal
69e54cb9c1 More work on file transfer 2021-11-06 20:11:11 +05:30
Kovid Goyal
60b8023928 Ensure transfer is canceled on error 2021-11-06 12:59:13 +05:30
Kovid Goyal
8099ae44d7 create fid_map after collecting files not before 2021-11-06 12:54:20 +05:30
Kovid Goyal
46f88494e3 Merge branch 'feat-sel-win-reactivate-prev-tab' of https://github.com/page-down/kitty 2021-11-06 11:44:40 +05:30
Kovid Goyal
4818ac0750 More consistent method naming 2021-11-06 11:35:08 +05:30
Kovid Goyal
d96429e6b8 When handling mouse events in visual select mode cancel the visual select if the original tab is not active any more 2021-11-06 11:34:22 +05:30
Kovid Goyal
9cda076c93 Fix restoring of OS window title after visual selection 2021-11-06 11:28:56 +05:30
Kovid Goyal
d30c761b3b A new mappable action to close windows with a confirmation
Fixes #4195
2021-11-06 11:09:41 +05:30
Kovid Goyal
49a0e8e242 Move close_window from Tab to Boss
We might eventually implement OS Window level floating windows
and the close_window action actually used the Boss method anyway
2021-11-06 10:45:07 +05:30
Kovid Goyal
8630c7a700 Fix canceling the select window overlay not calling the callback in stack layout 2021-11-06 10:28:34 +05:30
Kovid Goyal
905fbeec14 Fix cancelling visual select not working in stack layout 2021-11-06 10:25:10 +05:30
Kovid Goyal
e1ec8dfe4f Merge branch 'docs-confirm-os-win-close' of https://github.com/page-down/kitty 2021-11-06 09:38:40 +05:30
pagedown
93558f75f2 Docs: Explicitly clarify the scope of confirm_os_window_close in effect 2021-11-06 10:19:47 +08:00
pagedown
7a66c1a01c Allow select-window to reactivate previously activated tab 2021-11-06 09:32:36 +08:00
Kovid Goyal
9f7b975064 Handle timeout errors in the shell 2021-11-05 23:53:29 +05:30
Kovid Goyal
8e8a0d2df6 Fix rel path logic when transferring symlinks 2021-11-05 21:39:07 +05:30
Kovid Goyal
d9f4fadf2d More work on file transfer 2021-11-05 21:33:47 +05:30
Kovid Goyal
3f3fe6b178 Merge branch 'minor-tweaks' of https://github.com/page-down/kitty 2021-11-05 17:16:12 +05:30
pagedown
2e95cd7a62 Docs: Describes the priority order of auto bold fonts 2021-11-05 18:15:29 +08:00
pagedown
9be7345ba6 Capitalize menu item and adjust the order of menu items following the convention 2021-11-05 18:15:29 +08:00
Kovid Goyal
950edb1110 Fix symlink transmission 2021-11-05 13:18:58 +05:30
Kovid Goyal
c4b3723372 More work on file transfer 2021-11-05 13:10:04 +05:30
Kovid Goyal
119841a2c4 Respect --no-response in the kitty shell 2021-11-04 19:07:07 +05:30
Kovid Goyal
2df6f9cdda Fix select-window in the kitty shell 2021-11-04 18:56:20 +05:30
Kovid Goyal
55868da9d3 DRYer 2021-11-04 18:01:54 +05:30
Kovid Goyal
460373803d Merge branch 'fix-get-colors' of https://github.com/page-down/kitty 2021-11-04 18:01:13 +05:30
pagedown
abf9cce6bf When the color is set to none get-colors should not return a color value 2021-11-04 18:27:55 +08:00
Kovid Goyal
d9c400ac32 Forgot to recalculate height_gl leading to vertically stretched characters for window numbers 2021-11-04 08:53:17 +05:30
Kovid Goyal
377607730c Forgot to set the x-axis origin when rendering the glyph, causing right side cut-off 2021-11-03 20:57:05 +05:30
Kovid Goyal
6da5a8073c Wayland: Apparently Java doesnt even set text/plain as a mimetype when copying text. Instead it uses UTF8_STRING and STRING.
So check for those as well. Am guessing whoever wrote this code in Java
just copied their old X11 shit without checking the specs. See #4183
2021-11-03 20:46:33 +05:30
Kovid Goyal
68ad513dd5 Merge branch 'fix-set-colors-err-msg' of https://github.com/page-down/kitty 2021-11-03 11:42:52 +05:30
pagedown
40ff78b1c8 Handle set colors exceptions 2021-11-03 12:55:05 +08:00
Kovid Goyal
477baf390b DRYer 2021-11-03 09:32:49 +05:30
Kovid Goyal
76834c0975 Merge branch 'feat-visual-bell-color' of https://github.com/page-down/kitty 2021-11-03 09:13:27 +05:30
pagedown
a3b7a88e9c ... 2021-11-03 10:17:55 +08:00
pagedown
ce36b09593 Visible bell color falls back to default fg when selection bg is none 2021-11-03 10:07:57 +08:00
Kovid Goyal
ebaac70b27 Fix #4183 (paste in wyland with mime type text/plain) 2021-11-03 07:00:06 +05:30
pagedown
b4a6ed8d8f Allows the visual bell color to be configured 2021-11-02 19:38:36 +08:00
Kovid Goyal
7c161f2d78 Check for actual executable when prepending the path 2021-11-02 15:36:03 +05:30
Kovid Goyal
39dcfb4e5d Auto generate the list of all color config keys 2021-11-02 15:16:55 +05:30
Kovid Goyal
34d87b7a72 Another stab at PATH manipulation 2021-11-02 14:43:20 +05:30
Kovid Goyal
f2d2cfec8f ... 2021-11-02 13:54:51 +05:30
Kovid Goyal
46625d207b Cleanup PATH manipulations 2021-11-02 08:57:44 +05:30
Kovid Goyal
f35112378f Merge branch 'dont-rely-on-nanosecond-resolution' of https://github.com/Luflosi/kitty 2021-11-02 07:53:12 +05:30
Luflosi
bb5ded4e65 Don't rely on nanosecond resolution when testing mtime transmission
Commit 85cea78b3c missed a couple instances where the mtime was not a multiple of 1µs.
See https://github.com/kovidgoyal/kitty/issues/4175.
2021-11-01 21:06:23 +01:00
Kovid Goyal
b2f406f021 put kitty in PATH before setting default env 2021-11-01 21:37:13 +05:30
Kovid Goyal
7821e2508c Cleanup previous PR 2021-11-01 20:52:55 +05:30
Kovid Goyal
3e6cfe3275 Merge branch 'fix-kitty-env-path' of https://github.com/page-down/kitty 2021-11-01 20:41:50 +05:30
Kovid Goyal
588313b9ac Dont re-render window chars unless needed 2021-11-01 20:38:19 +05:30
pagedown
50e4811e6d Make sure kitty is first in the PATH and not repeatedly added when it already exists 2021-11-01 22:37:31 +08:00
pagedown
c182f95684 Make --override parameter compatible with 'env VAR=' syntax 2021-11-01 22:37:30 +08:00
Kovid Goyal
c241524663 Implement rending of visual select chars on macOS 2021-11-01 15:34:38 +05:30
Kovid Goyal
9517c3500d Allow visually selecting upto 36 windows
Also dont draw the window title if the window is too small
2021-11-01 10:46:54 +05:30
Kovid Goyal
1b8978fede Implement rendering of ASCII char with FreeType 2021-11-01 10:17:26 +05:30
Kovid Goyal
5796cbc040 Remove the seven segment shader 2021-11-01 08:42:02 +05:30
Kovid Goyal
49726384f7 Start work on rendering visual select numbers using fonts instead of seven segment display 2021-11-01 08:40:03 +05:30
Kovid Goyal
e7386735f4 Make code to load alpha mask texture re-useable 2021-11-01 07:29:04 +05:30
Kovid Goyal
ddfa653197 resizing size text should be drawn with the current foreground color 2021-11-01 07:19:17 +05:30
Kovid Goyal
fffee1049f Function to get an alpha mask for a single char from freetype 2021-11-01 06:52:24 +05:30
Kovid Goyal
cc502163cb Use slots number for visual selection 2021-10-31 21:20:16 +05:30
Kovid Goyal
d53d92b890 Proper handling of async responses to peers 2021-10-31 21:09:24 +05:30
Kovid Goyal
218582ced8 More work on file transfer 2021-10-31 20:05:48 +05:30
Kovid Goyal
bc1c19b4f7 Merge branch 'fix-pager-cur-pos' of https://github.com/page-down/kitty 2021-10-31 19:18:29 +05:30
Kovid Goyal
85cea78b3c Use 13000 when testing mtime transmission as there exist some systems with a 1000ns resolution. See #4175 2021-10-31 19:13:55 +05:30
pagedown
7a9027a147 Do not report cursor position when the cursor is scrolled off the screen 2021-10-31 21:17:38 +08:00
Kovid Goyal
66db3f9764 Also sanitize various XDG* env vars when running the test suite 2021-10-31 16:21:33 +05:30
Kovid Goyal
7e84343f16 Merge branch 'remove-unused-code' of https://github.com/Luflosi/kitty 2021-10-31 16:18:37 +05:30
Luflosi
e82e57a30c Remove unused code
Since 99d9cb0b0d runs all tests with HOME set to a temporary directory, this code setting the cache directory to a temporary directory is no longer needed. `cache_dir()` will choose a directory in the home directory if neither KITTY_CACHE_DIRECTORY or XDG_CACHE_HOME are set.
2021-10-31 11:42:55 +01:00
Kovid Goyal
336c7ddca8 DRYer 2021-10-31 15:41:19 +05:30
Kovid Goyal
4ffcbc8274 Wake up talk loop when not sending response to peer 2021-10-31 15:22:22 +05:30
Kovid Goyal
22673ebd90 ... 2021-10-31 14:06:02 +05:30
Kovid Goyal
b1c0398bba Avoid unnecessary CPU churn when reading from stdin for @ send-text 2021-10-31 14:04:07 +05:30
Kovid Goyal
6310517ff2 @ send-text: Fix reading from stdin when RC is over a socket 2021-10-31 13:55:11 +05:30
Kovid Goyal
4ff3d6a645 More work on file transfer 2021-10-31 13:12:23 +05:30
Kovid Goyal
23570cc5f7 ... 2021-10-31 11:55:00 +05:30
Kovid Goyal
dc09a5183a Exclude the currently active window when visually selecting 2021-10-31 11:37:38 +05:30
Kovid Goyal
8458b9e7d6 Allow specifying a title for @ select-window 2021-10-31 11:08:28 +05:30
Kovid Goyal
51900996ea When selecting in stack dont exclude the active window 2021-10-31 11:05:00 +05:30
Kovid Goyal
663da130ae Show the choose msg in the OS Window title bar during a visual select 2021-10-31 11:01:34 +05:30
Kovid Goyal
c8b1724ecf Function to change OS Window title from python 2021-10-31 10:56:36 +05:30
Kovid Goyal
c289af8f07 When initiating a visual select make sure its tab is the active tab 2021-10-31 10:45:59 +05:30
Kovid Goyal
da7fa53b1a Consolidate visual select cleanup in one place
Also ensure callback is called even when only a single window is present
and when selecting in stack
2021-10-31 10:36:23 +05:30
Kovid Goyal
d160db1bcd ... 2021-10-31 10:20:27 +05:30
Kovid Goyal
a788cd9f64 Also clear the current visual select when selecting in stack layout 2021-10-31 10:15:06 +05:30
Kovid Goyal
6997e36670 ... 2021-10-31 10:11:50 +05:30
Kovid Goyal
1893b3ce0f Store visual select in flight information in a single object 2021-10-31 10:10:20 +05:30
Kovid Goyal
576abecf7d oops forgot to call cancel current visual select when starting a new one 2021-10-31 09:54:28 +05:30
Kovid Goyal
b9b799533b Eh, mypy doesnt let me ignore requests on CI 2021-10-31 09:40:03 +05:30
Kovid Goyal
70a01955b8 Fix timeout of @ select-window not canceling the visual select 2021-10-31 09:38:55 +05:30
Kovid Goyal
5f9409a91d Fix visual select failing if triggerred when there is already an active visual select 2021-10-31 09:32:12 +05:30
Kovid Goyal
32805ca968 More work on file transfer 2021-10-31 09:28:20 +05:30
Kovid Goyal
8dfb0c6675 Dont bother with type checking requests in the publish script 2021-10-31 09:25:39 +05:30
Kovid Goyal
7428d42c16 Restore environ after running tests 2021-10-31 09:20:06 +05:30
Kovid Goyal
99d9cb0b0d Run tests with HOME set to a tempdir 2021-10-31 08:20:46 +05:30
Kovid Goyal
80ab60f1b6 Merge branch 'fix-clang-warning' of https://github.com/Luflosi/kitty 2021-10-30 20:30:27 +05:30
Luflosi
a1d24028b8 Fix Clang warning
Without this, kitty fails to compile:
```
glfw/cocoa_init.m:462:14: error: case value not in enumerated type
      'NSEventModifierFlags' (aka 'enum NSEventModifierFlags')
      [-Werror,-Wswitch]
        case (NSEventModifierFlagShift | NSEventModifierFlagOption):
             ^
glfw/cocoa_init.m:465:14: error: case value not in enumerated type
      'NSEventModifierFlags' (aka 'enum NSEventModifierFlags')
      [-Werror,-Wswitch]
        case (NSEventModifierFlagShift | NSEventModifierFlagCommand):
             ^
```
I thought about changing the type of the `modifierFlags` function parameter from `NSEventModifierFlags` to `NSUInteger` since `NSEventModifierFlags` is defined as an enum according to https://developer.apple.com/documentation/appkit/nseventmodifierflags?language=objc and is technically not the proper type for a bit field. But since Apple themselves define `modifierFlags` as `NSEventModifierFlags` according to https://developer.apple.com/documentation/appkit/nsevent/1534405-modifierflags?language=objc, I think the fix in this commit is better.
This warning was introduced with commit f9944e6140.
2021-10-30 16:25:20 +02:00
Kovid Goyal
d03f4dbc98 More work on file transfer 2021-10-30 16:54:27 +05:30
Kovid Goyal
f1573654b9 Update changelog for previous PR 2021-10-30 15:16:11 +05:30
Kovid Goyal
e703103fa8 Merge branch 'bgimage-options' of https://github.com/itepechi/kitty into bg 2021-10-30 15:04:41 +05:30
Kovid Goyal
6241369b6c Cancel an async request on timeout so no spurious data is sent to the tty 2021-10-30 14:46:48 +05:30
Kovid Goyal
2a637e4220 Simplify sending of async response 2021-10-30 14:10:09 +05:30
Kovid Goyal
816360c275 A new remote control command to visually select a window
Fixes #4165
2021-10-30 13:56:48 +05:30
Kovid Goyal
c541d7e349 Document --self in the launch rc protocol 2021-10-30 12:36:58 +05:30
Kovid Goyal
df70d8661a Pass the peer id to commands 2021-10-30 12:29:27 +05:30
Kovid Goyal
c3daa969fa Allow individual commands to control the response timeout 2021-10-30 12:20:37 +05:30
Kovid Goyal
66a7c3bc4d Simplify handling of --no-response 2021-10-30 12:15:37 +05:30
Kovid Goyal
3553b3ce3d Pass the peer id to python for potentially async replies 2021-10-30 08:31:13 +05:30
itepechi
9289c2de69 Refactor background_image_anchor for cleaner code 2021-10-30 04:34:33 +09:00
itepechi
dac1612cb0 Calculate background image position on the GPU 2021-10-30 04:34:33 +09:00
itepechi
87d79c7415 Change the naming of directions in option background_image_anchor for consistency
Replaced cardinal directions with "relative" directions.
2021-10-30 04:34:33 +09:00
itepechi
86d7aaa03a Add clamped to option background_image_layout 2021-10-30 04:34:33 +09:00
itepechi
cae31ab336 Read/Write bganchor directly from the options' state
Slight performance improvement, maybe?
Also, `kitty/graphics.h` has been reverted to the original version;
this version would be better in that aspect too.
2021-10-30 04:34:32 +09:00
itepechi
2aa01c58a1 Add option background_image_anchor to configure bgimage position 2021-10-30 04:34:32 +09:00
Kovid Goyal
ee852cf5fc More work on file transmission 2021-10-29 21:52:49 +05:30
Kovid Goyal
5eb87b9f10 Micro-optimizations of fish sheel integration script
By @page-down
2021-10-29 21:51:48 +05:30
Kovid Goyal
820a893d75 More work on file transfer 2021-10-29 15:01:31 +05:30
Kovid Goyal
ce823e4b08 Fix incorrect scissoring for window resize counter
It uses draw_graphics, which uses a scissor, but the scissor was set by
the last call to draw_cells() which is not called during a resize,
leaving us with an incorrect scissor.

Fixes #4160
2021-10-28 21:45:15 +05:30
Kovid Goyal
21830048c9 Fix reading session from STDIN not working when used with --single-instance
Fixes #4155
2021-10-28 17:00:54 +05:30
Kovid Goyal
1251f9ec80 Keep the list of nullable colors up to date automatically 2021-10-28 15:21:42 +05:30
Kovid Goyal
4839cbe9d0 ... 2021-10-28 15:04:36 +05:30
Kovid Goyal
702bfccfa2 Allow reverse video for the mouse selection
Fixes #646
2021-10-28 15:01:48 +05:30
Kovid Goyal
28386cc496 Fix nulling selection_fg not working 2021-10-28 14:38:35 +05:30
Kovid Goyal
0c1a7347db Mark another nullable color 2021-10-28 14:38:09 +05:30
Kovid Goyal
c06a03ab96 Avoid very low contrast colors for reverse video cursor 2021-10-28 14:14:38 +05:30
Kovid Goyal
93dbcab10a Refactor code to get cell colors 2021-10-28 13:35:30 +05:30
Kovid Goyal
5f12fbc2ee Convenient aliases 2021-10-28 11:18:16 +05:30
Kovid Goyal
2443dc135c Use a faster implementation of the Color type
Now implemented in C
2021-10-28 11:15:13 +05:30
Kovid Goyal
40c046f86b ooops 2021-10-28 08:17:16 +05:30
Kovid Goyal
aee5c317f6 ... 2021-10-28 08:12:35 +05:30
Kovid Goyal
0fdafd8398 Allow rendering the cursor with reverse video
Also clean up handling of dynamic global colors.
TODO: Implement none for selection_fg
TODO: Add some tests
TODO: Check that changing colors via remote control works

Fixes #126
2021-10-28 00:21:12 +05:30
Kovid Goyal
3ca3c67828 Remove unused code 2021-10-27 17:15:45 +05:30
Kovid Goyal
336bc2c0e6 Update include path for fish integration script 2021-10-27 16:54:54 +05:30
Kovid Goyal
d3a3f99848 Use an env var for fish shell integration
Less intrusive (in some ways) than adding symlinks to ~/.config/fish
Exploits the fact that fish loads scripts from XDG_DATA_DIRS on startup.
Thanks to @page-down for noticing
2021-10-27 14:59:11 +05:30
Kovid Goyal
d31935b8eb Old python compat 2021-10-27 14:23:07 +05:30
Kovid Goyal
13928d4d35 When showing last command output and similar cursor less text with the scrollback pager set CURSOR_LINE and CURSOR_COLUMN to 0 2021-10-27 14:20:33 +05:30
Kovid Goyal
212af78032 Turn on strict checks for mypy 2021-10-27 14:00:38 +05:30
Kovid Goyal
60472fcee3 Add more type annotations 2021-10-27 14:00:29 +05:30
Kovid Goyal
c899eb4ee3 Add more type annotations 2021-10-27 13:44:12 +05:30
Kovid Goyal
d090db380f Add more type annotations 2021-10-27 13:26:18 +05:30
Kovid Goyal
a26f041964 Add more type annotations 2021-10-27 12:31:10 +05:30
Kovid Goyal
b22bda3cba Add more type annotations 2021-10-27 11:36:34 +05:30
Kovid Goyal
69e903a4c4 Add more type annotations 2021-10-27 11:13:28 +05:30
Kovid Goyal
6f19fd5912 Add more type annotations 2021-10-27 10:50:24 +05:30
Kovid Goyal
9c2f96f7eb Add more type annotations 2021-10-27 08:45:45 +05:30
Kovid Goyal
4494ddd8ff mypy: Turn on return value checks
Its a shame GvR is married to "return None"
https://github.com/python/mypy/issues/7511
2021-10-26 22:39:14 +05:30
Kovid Goyal
5cb36a4632 More work on file transfer 2021-10-26 22:05:38 +05:30
Kovid Goyal
9b7342b231 Mark output before running command
This will help with shell integration erasing the prompt if there is a
resize caused by the command
2021-10-25 20:40:55 +05:30
Kovid Goyal
01ebc8f15a Use a space as content placeholder when resizing 2021-10-25 20:05:26 +05:30
Kovid Goyal
472baf7337 DRYer 2021-10-25 18:12:48 +05:30
Kovid Goyal
c381716ecf Specify we need alpha as well 2021-10-25 17:15:46 +05:30
Kovid Goyal
0e08c6c660 Fix a one pixel line not being drawn at the bottom edge of the fat and tall layouts 2021-10-25 15:28:49 +05:30
Kovid Goyal
6da79ab614 Reset draw data default bg when background is changed 2021-10-25 12:40:36 +05:30
Kovid Goyal
a44a3195ab Ensure border rects are updated when patching colors 2021-10-25 12:37:29 +05:30
Kovid Goyal
f78feb5abf Allow very long middle clicks to close tabs 2021-10-25 12:23:54 +05:30
Kovid Goyal
4385acd3c6 A new option to set the tab bar margin color independently 2021-10-25 12:21:46 +05:30
Kovid Goyal
c0927a3643 Fix rendering of tab bar right margin 2021-10-25 11:39:04 +05:30
Kovid Goyal
37692119e1 Close tab on middle click release not press
Fixes the problem of close causing the tabbar to disappear which could
cause the subsequent release to be delivered to the remaining kitty
window
2021-10-25 10:56:10 +05:30
Kovid Goyal
0f193141af Add support for OSC 777 based desktop notifications
Might as well, since we also support OSC 9, so why not yet another
poorly designed legacy scheme.
2021-10-25 10:46:00 +05:30
Kovid Goyal
24d5fc5f15 Add changelog entries for all the tab bar changes 2021-10-25 10:27:59 +05:30
Kovid Goyal
1ab8d58bf7 Ensure right margin is drawn 2021-10-25 10:27:47 +05:30
Kovid Goyal
691bf75b35 Fix tab bar not being redrawn when colors changed by set-colors
Fixes #4152
2021-10-25 10:17:48 +05:30
Kovid Goyal
63e23d7fe3 Fix set-colors unable to set tab_bar_background to none 2021-10-25 10:04:25 +05:30
Kovid Goyal
23d0db5458 ... 2021-10-25 09:17:29 +05:30
Kovid Goyal
71c62664cd Fix tab bar background not being update in the shader when using set-colors 2021-10-25 09:11:23 +05:30
Kovid Goyal
c9faf5dd59 Extra update_blank_colors() call is not needed 2021-10-25 09:02:08 +05:30
Kovid Goyal
baf080f147 Tab bar left margin should be drawn in the same background color as the other margins 2021-10-25 09:00:49 +05:30
Kovid Goyal
0e29ee9299 ... 2021-10-25 08:48:28 +05:30
Kovid Goyal
d52e5fab1e Merge branch 'master' of https://github.com/python-pitfalls/kitty 2021-10-25 08:43:08 +05:30
Naelson Douglas
9f442eb7e4 removed a consider-using-in pitfall case 2021-10-25 00:04:23 -03:00
Kovid Goyal
0d94ca5399 Better fix for closing non-active tab 2021-10-25 08:11:50 +05:30
Kovid Goyal
13b900faf7 Activate tab before closing on middle click
Also fix compilation on macOS
2021-10-25 07:50:05 +05:30
Kovid Goyal
32ad75c5ab Workaround mypy bug 2021-10-24 23:03:33 +05:30
Kovid Goyal
7a45653575 ... 2021-10-24 22:59:50 +05:30
Kovid Goyal
b316e97a4f Allow middle clicking on a tab to close it
Fixes #4151
2021-10-24 22:56:30 +05:30
Kovid Goyal
6c7420f4e7 Add a comment explaining why we do 1,1,1,0 2021-10-24 13:40:18 +05:30
Kovid Goyal
80a357623d Linux X11: Add support for 10bit colors
Fixes #4150
2021-10-24 13:19:05 +05:30
Kovid Goyal
0a4dfa8fd2 macOS: Prevent resizing of fullscreen OS windows as it leads to visual artifacts 2021-10-24 12:38:44 +05:30
Kovid Goyal
4604558d35 Add some more docs for cursor_shape 2021-10-24 08:22:01 +05:30
Kovid Goyal
089ab9ee9f Use a pre zsh 5.5 syntax for assoc arrays 2021-10-24 08:16:44 +05:30
Kovid Goyal
4fb804efc6 ... 2021-10-23 18:55:55 +05:30
Kovid Goyal
5b2ba448b6 Only modify .zshrc to add shell integration if it already exists 2021-10-23 18:54:59 +05:30
Kovid Goyal
899b5078eb bash integration: fix newline replace in PS1 2021-10-23 18:48:45 +05:30
Kovid Goyal
edd423aad6 macOS; Fix restoring from fullscreen when resize increments are enabled 2021-10-23 13:06:47 +05:30
Kovid Goyal
518e0f4e21 oops 2021-10-22 12:52:57 +05:30
Kovid Goyal
7546e53c23 ... 2021-10-22 12:47:32 +05:30
Kovid Goyal
0f9944190d Shell integration: Better fix for multi-line prompts in bash
Also fix bash redrawing only the last PS2 prompt
2021-10-22 12:19:03 +05:30
Kovid Goyal
18aca275c8 Only libedit doesn't redraw GNU readline does 2021-10-22 12:08:06 +05:30
Kovid Goyal
6d02ef59f8 Shell integration: Fix PS2 support
zsh only redraws the prompt from the last PS2 on a multiline prompt.
Take this into account.
2021-10-22 12:02:21 +05:30
Kovid Goyal
729cea88f3 More sophisticated OSC 133 parsing with support for secondary prompts 2021-10-22 11:54:54 +05:30
Kovid Goyal
9b957a1fdb handle shlex exceptions gracefully 2021-10-22 05:12:12 +05:30
Kovid Goyal
e18b0cd4c8 When a window is moved but not resized, ensure the OS Window is re-rendered 2021-10-22 04:15:47 +05:30
Kovid Goyal
b51be8382f Transmit home directory when sending so filenames can be resolved
Also only send metadata if permission granted by user
2021-10-21 20:06:53 +05:30
Kovid Goyal
a95a1f1158 Specify languages for CodeQL 2021-10-21 19:43:52 +05:30
Kovid Goyal
be8fc47c5f Also report enabled_layouts in kitty @ ls 2021-10-21 16:41:05 +05:30
Kovid Goyal
4fd76b09d9 kitty @ ls: Also report layout options 2021-10-21 13:44:06 +05:30
Kovid Goyal
6546c1da9b run pyupgrade to upgrade the codebase to python3.6 2021-10-21 12:43:55 +05:30
Kovid Goyal
8f0b3983ee Apparently only importlib_resources has actually deprecated contents() 2021-10-20 11:15:51 +05:30
Kovid Goyal
7f2ce045ab Handle deprecation of importlib.resources APIs 2021-10-19 09:14:58 +05:30
Kovid Goyal
38f1fe7742 Make --override parsing a little more forgiving
Handle option values with = in them even if the user uses a space
as a separator rather than an =
2021-10-18 22:44:10 +05:30
Kovid Goyal
a099d2364d kitty should not quit if an invalid set_colors mapping is configured 2021-10-18 21:20:48 +05:30
Kovid Goyal
5f91084968 More work on file transfer 2021-10-18 13:02:37 +05:30
Kovid Goyal
cb9321e925 handle comma separated layout lists as well 2021-10-17 18:34:02 +05:30
Kovid Goyal
716ff187f9 kitty @ set-enabled-layouts
Fixes #4129
2021-10-17 18:30:34 +05:30
Kovid Goyal
16365f2014 When creating tabs via @ launch with the --match option create the tab in the OS Window containing the result of the match rather than the active OS Window
Fixes #4126
2021-10-17 13:27:52 +05:30
Kovid Goyal
0fa03da18c ... 2021-10-17 12:54:55 +05:30
Kovid Goyal
a4a7d49bed A new swap_with_window mappable action
Allows visual selection of a window to swap with the current window
2021-10-17 12:52:08 +05:30
Kovid Goyal
0de319fc73 Refactor visual window select infrastructure to make it reuseable 2021-10-17 12:38:03 +05:30
Kovid Goyal
c06823dd47 Function to swap active window with another 2021-10-17 11:42:02 +05:30
Kovid Goyal
f9944e6140 Pass through more modifier+tab variants 2021-10-17 11:31:54 +05:30
Kovid Goyal
426815f7ab Silence CodeQL warning 2021-10-17 10:32:25 +05:30
Kovid Goyal
2a842e36a1 Finish up title rendering for CoreText 2021-10-17 08:26:35 +05:30
Kovid Goyal
90dfabc644 Use realpath() when reporting kitty_exe 2021-10-17 06:30:26 +05:30
Kovid Goyal
f302c2ae39 Binary builds: If a symlink to the correct kitty executable is already in PATH, dont add the binary bin dir to PATH 2021-10-17 06:29:01 +05:30
Kovid Goyal
93aee3946f Partial work on macOS title rendering 2021-10-16 19:12:38 +05:30
Kovid Goyal
4b7de5d802 Add an alias for --keep-focus 2021-10-16 19:02:15 +05:30
Kovid Goyal
78c63e6a18 Show window titles during visual select
Still has to be implemented on macOS
2021-10-15 14:19:56 +05:30
Kovid Goyal
dcda2bff69 Handle more than 10 windows when doing a visual switch 2021-10-15 14:05:54 +05:30
Kovid Goyal
372c4da8f9 When drawing cells make the window object available 2021-10-15 10:25:11 +05:30
Kovid Goyal
a95025752a DRYer 2021-10-15 09:56:22 +05:30
Kovid Goyal
a16ffcdde2 Handle mouse clicks when displaying focus window overlay 2021-10-15 09:55:15 +05:30
Kovid Goyal
3c2e521dd7 Make blending of foreground more efficient
Avoids an unnecessary reversal of premultiplication when rendering
interleaved.  Also fixes rendering on wayland which for some reason was
using a different blend function than X11. Fixes #4120
2021-10-14 21:31:20 +05:30
Kovid Goyal
f28d9bcd8c Change sybolic constant for insert key 2021-10-14 21:05:21 +05:30
Kovid Goyal
c6039fc399 Also passthrough Insert and Shift+Insert which cocoa seems to intercept 2021-10-14 20:27:22 +05:30
Kovid Goyal
706494016c More work on file transmission 2021-10-14 18:29:02 +05:30
Kovid Goyal
a653233050 Fix #4117 2021-10-14 14:31:11 +05:30
Kovid Goyal
ed5accd702 Add some common readline bindings to the line editor 2021-10-14 14:29:44 +05:30
Kovid Goyal
3a247be758 cleanups 2021-10-14 14:07:02 +05:30
Kovid Goyal
d417aedde0 Allow use of numpad for window select overlay 2021-10-14 12:14:11 +05:30
Kovid Goyal
967aaad482 ... 2021-10-14 10:07:54 +05:30
Kovid Goyal
9c4942b190 Ensure mouse cursor shape is correct
Previously, the shape was only set on focus in events and when hovering
urls. However, on macOS there are no focus events generated when the
mouse moves between the window and the titlebar/menubar, thus causing
incorrect mouse shape.

Fix #4118
2021-10-14 10:05:44 +05:30
Kovid Goyal
67fd07a92a ... 2021-10-14 09:57:35 +05:30
Kovid Goyal
533b0ed591 A new mappable action select_window_in_tab to select a window in the current tab to switch to, by window title
Also when using the focus_visible_window action in a layout that shows
only a single window such as the stack layout, use this facility
automatically.
2021-10-14 09:19:22 +05:30
Kovid Goyal
3f1a0baa84 DRYer 2021-10-14 08:57:55 +05:30
Kovid Goyal
8057c420d9 Fix resize-os-window slightly incorrect on high DPI
Caused by premature clamping of a floating point number
2021-10-12 19:40:02 +05:30
Kovid Goyal
a3717436b6 macOS: Fix resize_in_steps not working correctly on high DPI screens
See #4114
2021-10-12 14:39:06 +05:30
Kovid Goyal
7852e0b618 Clarify docs 2021-10-12 12:54:51 +05:30
Kovid Goyal
5afb16ab8d A new remote control command to change tab color
Fixes #1287
2021-10-12 12:48:25 +05:30
Kovid Goyal
8187ec2cef ... 2021-10-12 12:32:15 +05:30
Kovid Goyal
d55d8ac091 ... 2021-10-12 10:40:25 +05:30
Kovid Goyal
e13c34c2b8 Use a bar cursor for LineEdit 2021-10-12 09:13:06 +05:30
Kovid Goyal
8630c8830a Implement shell integration for the kitty shell 2021-10-12 09:05:53 +05:30
Kovid Goyal
da3f34603a DRYer 2021-10-12 07:41:52 +05:30
Kovid Goyal
97a8ff3478 Fix #4113 2021-10-12 07:35:11 +05:30
Kovid Goyal
2548896656 Dont visually focus select if only one window present 2021-10-11 20:37:59 +05:30
Kovid Goyal
572df007df Add a default shortcut for visually focusing windows
Fixes #4110
2021-10-11 20:28:58 +05:30
Kovid Goyal
440640bbbc A mappable action to visually select the window to focus with the keyboard 2021-10-11 20:18:35 +05:30
Kovid Goyal
563b7ad2d0 Linux binary builds: Fix Pygments not being included 2021-10-11 20:00:56 +05:30
Kovid Goyal
b180702c97 clarify language 2021-10-11 19:06:38 +05:30
Kovid Goyal
c3f4e734f1 API to set screen window number 2021-10-11 18:00:18 +05:30
Kovid Goyal
61a56a0561 macOS: Fix very first keypress after window creation being sent as a repeat instead of a press event
Now the dummy event on input source changed is sent with no key and only
after an actual change instead of on startup as well.
2021-10-11 12:30:42 +05:30
Kovid Goyal
820fb6dda9 Pass through all esc + modifier combinations since they arent generally used in macOS 2021-10-11 11:27:24 +05:30
Kovid Goyal
85db87a121 A shader to draw a single seven segment number over a kitty window 2021-10-11 11:13:29 +05:30
Kovid Goyal
dc11b76bea Restrict the overridden cocoa global shortcuts 2021-10-11 06:46:59 +05:30
Kovid Goyal
2b9408c217 macOS: Fix ctrl or cmd with Esc or Function keys not working
Fixes #4109
2021-10-10 21:39:20 +05:30
Kovid Goyal
5e033773dd More work on transfer sending 2021-10-10 13:04:47 +05:30
Kovid Goyal
855681200f ... 2021-10-08 15:51:45 +05:30
Kovid Goyal
456564f377 Small text clarification for rendering strategy 2021-10-07 18:31:18 +05:30
Kovid Goyal
828e16b45d ... 2021-10-07 13:59:19 +05:30
Kovid Goyal
9289ebf9c9 Old python compat 2021-10-07 13:51:55 +05:30
Kovid Goyal
f4b6cc6628 Forgot the key the is_gcc cache by cc 2021-10-07 13:43:12 +05:30
Kovid Goyal
853f7cc59a Make handling of CC more robust
Allows multi-command compilers and makes detection of gcc more robust.
Fixes #4102
2021-10-07 13:35:56 +05:30
Kovid Goyal
5841776c65 Add the BEGIN key to terminfo
Fixes #4101
2021-10-07 13:15:06 +05:30
Kovid Goyal
fbf47f75d5 Fix soft hyphens not being preserved when round tripping text through the terminal
Also roundtrip all characters in the Cf category.

Characters with the DI (Default Ignorable) property are now
preserved but not rendered and treated as zero-width
as per the unicode standard.
See https://www.unicode.org/faq/unsup_char.html
2021-10-07 12:44:22 +05:30
Kovid Goyal
1b42f69119 Allow specifying extra lib dirs as well
Also use the extra include and lib dirs when detecting librsync
2021-10-06 10:23:01 +05:30
Kovid Goyal
a1b532334e Alias for --extra-include-dirs 2021-10-06 08:08:44 +05:30
Kovid Goyal
edac0e8023 Check for utmpx.h instead of __unix__
There is no reliable macro to test for UNIX
2021-10-05 11:58:09 +05:30
Kovid Goyal
498d3d5906 More cleanups 2021-10-05 11:58:06 +05:30
Kovid Goyal
57152a8e29 Fix utmp test 2021-10-05 11:41:18 +05:30
Kovid Goyal
35d4e2d4e0 Clean up previous PR 2021-10-05 11:36:29 +05:30
Kovid Goyal
fe42b15ec6 Merge branch 'master' of https://github.com/mattfbacon/kitty 2021-10-05 11:15:12 +05:30
Matt Fellenz
1d4a86594b Add tests for UTMP methods 2021-10-04 20:49:48 -07:00
Matt Fellenz
072e583835 Properly evaluate /etc/issue placeholders 2021-10-04 20:49:48 -07:00
Kovid Goyal
463133abbe Fix #4095 2021-10-05 07:20:40 +05:30
Kovid Goyal
34d6c69b2a fix forgotten import 2021-10-04 21:40:07 +05:30
Kovid Goyal
14d36e3727 Stub for receive in the transfer kitten 2021-10-04 21:31:02 +05:30
Kovid Goyal
ed95f7dfa0 Add a note about discarding key presses 2021-10-04 21:30:11 +05:30
Kovid Goyal
f93a10da48 Add a heart 2021-10-04 14:23:42 +05:30
Kovid Goyal
31e623afb3 Add support for Unicode 14
Fixes #3542
2021-10-04 14:00:35 +05:30
Kovid Goyal
2080b3d7fa Print out rsync stats 2021-10-03 13:40:53 +05:30
Kovid Goyal
a8e06a67c2 Better message when transferring rsync signatures 2021-10-03 13:29:50 +05:30
Kovid Goyal
42a79cb269 ... 2021-10-03 13:08:46 +05:30
Kovid Goyal
1ba9cd6138 Avoid progress messages with no actual progress 2021-10-03 13:06:38 +05:30
Kovid Goyal
37f3328147 Fix patching failing when decompressor produces no output 2021-10-03 12:57:32 +05:30
Kovid Goyal
df1ecad7e9 Fix failing test
Ignore progress messages in the tests
2021-10-03 12:01:41 +05:30
Kovid Goyal
5699c3ae7d Dont spin report done files 2021-10-03 11:58:24 +05:30
Kovid Goyal
1877a02378 Dont count dirs in transfer stats 2021-10-03 11:30:08 +05:30
Kovid Goyal
e9f344c53f Improve progress reporting for individual files 2021-10-03 11:26:49 +05:30
Kovid Goyal
d15763f2ad Dont show transfer stats for non regular files 2021-10-03 11:16:07 +05:30
Kovid Goyal
76eab44f53 Have the receiving side send progress updates
This is both more accurate and works for rsync based transfers, where we
dont know the total size to transmit because of the streaming nature of
the rsync protocol.
2021-10-03 11:04:46 +05:30
Kovid Goyal
3a373a200c Add a tell() method to PatchFile to track how much has been written 2021-10-03 10:18:28 +05:30
Kovid Goyal
f6e518d2f9 DRYer 2021-10-02 12:06:56 +05:30
Kovid Goyal
14f9f64bce Fix chunking of signature for transmission 2021-10-02 11:47:29 +05:30
Kovid Goyal
c79a0108a1 Remove unneeded code 2021-10-02 11:24:43 +05:30
Kovid Goyal
20fcc5e31b DRYer 2021-10-02 11:16:47 +05:30
Kovid Goyal
01299421ee Fix typo causing test to fail 2021-10-02 11:07:34 +05:30
Kovid Goyal
5729e33412 librsync actually blocks on output buffer size as well as input availability. So handle that 2021-10-02 09:26:35 +05:30
Kovid Goyal
f85f39e662 Code to easily develop librsync bindings 2021-10-02 07:22:33 +05:30
Kovid Goyal
0e9be57119 ... 2021-10-02 06:25:57 +05:30
Kovid Goyal
ffd7b5779b Fix end of data not being sent when using rsync 2021-10-02 06:15:06 +05:30
Kovid Goyal
1d1d55e2b4 Fix #4084 2021-10-02 05:10:59 +05:30
Kovid Goyal
3cea8f24d4 ... 2021-10-02 04:58:47 +05:30
Kovid Goyal
d6a43a7729 Dont turn on disambiguate keys when receiving th XTMODKEYS escape code
See #4075
2021-10-01 21:26:27 +05:30
Kovid Goyal
cfeeec95fa Start work on delta based file transmission 2021-10-01 17:26:27 +05:30
Kovid Goyal
e6cff61f99 Move management of destination file completely into PatchFile 2021-10-01 14:29:14 +05:30
Kovid Goyal
eeb02ceef4 Shell integration: Workaround bash not redrawing multiline prompts 2021-10-01 09:30:26 +05:30
Kovid Goyal
eaa0ec4fc3 ... 2021-10-01 07:57:21 +05:30
Kovid Goyal
91a719f80e fix query URL 2021-10-01 07:54:04 +05:30
Kovid Goyal
06f67e4765 typo in comment 2021-09-30 14:27:22 +05:30
Kovid Goyal
7530bfd1a1 lang -> source_ext since it is now file extension not language name 2021-09-30 14:25:48 +05:30
Kovid Goyal
abf6a3f91d Fix #4080 2021-09-30 14:23:19 +05:30
Kovid Goyal
21d3856e90 Another attempt at fixing fish cursor movement 2021-09-30 14:17:01 +05:30
Kovid Goyal
2304d0ec5c Ignore extra zero in escape code to manipulate window title stack
See https://github.com/weechat/weechat/issues/1702
2021-09-30 09:16:51 +05:30
Kovid Goyal
5cafe198bf icat: Fix EXIF orientation not taken into account when resizing 2021-09-30 08:45:41 +05:30
Kovid Goyal
4ce2690bd2 DRYer 2021-09-30 08:39:27 +05:30
Kovid Goyal
ea186ac48d Fix click to move cursor in fish multiline text
Thanks to @ridiculousfish, see: https://github.com/kovidgoyal/kitty/issues/3948#issuecomment-930458949
2021-09-30 07:44:30 +05:30
Kovid Goyal
9ab5a03f53 Fix movement of cursor when clicking and dual width chars are present in zsh 2021-09-30 07:38:44 +05:30
Kovid Goyal
7650c8bca9 Remove premature changelog entry 2021-09-29 20:42:06 +05:30
Kovid Goyal
3728d2cfd9 Add changelog entry for previous PR 2021-09-29 19:43:33 +05:30
Kovid Goyal
3214ba4541 Merge branch 'ibus_forward_key_event' of https://github.com/pjm0616/kitty 2021-09-29 19:36:44 +05:30
Park, Jeongmin
4232904055 ibus: Add support for ForwardKeyEvent signal
The ForwardKeyEvent ibus signal is used to maintain ordering between CommitText events and non-IME key events.
The ordering is important for Korean IMEs, where it automatically commits text whenever a character is fully composed. This is different from Chinese/Japanese IMEs, where user manually presses a key to commit each word.

Without this patch, kitty can't handle non-IME key events when used with ibus-hangul, which utilizes ForwardKeyEvent signal.

Without ForwardKeyEvent:
```
key | sequence of events from application's view
r   | UpdatePreeditText 'ㄱ'
k   | UpdatePreeditText '가'
1   | (receives the reply to ProcessKeyEvent call: "native_key: 0x31 release: 0 handled: 0")
    | -> UpdatePreeditText ''
    | -> CommitText '가'
```
Application receives "1가", which is incorrect.

With ForwardKeyEvent:
```
key | sequence of events from application's view
r   | UpdatePreeditText 'ㄱ'
k   | UpdatePreeditText '가'
1   | (receives the reply to ProcessKeyEvent call: "native_key: 0x31 release: 0 handled: 1", and kitty discards the event)
    | -> UpdatePreeditText ''
    | -> CommitText '가'
    | -> ForwardKeyEvent keysym=0x31("1")
```
Application receives "가1", which is correct.

Relevant ibus-hangul github issue to implement ForwardKeyEvent: https://github.com/libhangul/ibus-hangul/issues/42
Relevant changes in Qt to handle ForwardKeyEvent: https://codereview.qt-project.org/c/qt/qtbase/+/212179, https://codereview.qt-project.org/c/qt/qtbase/+/255587
2021-09-29 21:20:09 +09:00
Kovid Goyal
baf8976c2d Keep global_watchers immutable 2021-09-29 14:39:48 +05:30
Kovid Goyal
b3ae857f3c ... 2021-09-29 14:25:13 +05:30
Kovid Goyal
8be0dd0d8e Restore the --watcher command line option for backwards compat
It is now deprecated but not removed. And it now applies to all windows
not just initially created ones.
2021-09-29 14:18:55 +05:30
Kovid Goyal
166ea9deb9 A new watcher option for kitty.conf that replaces the old --watcher cli flag
Applies to all windows, not just initial ones.
2021-09-29 14:01:30 +05:30
Kovid Goyal
7a16ef2cc4 ... 2021-09-29 13:21:42 +05:30
Kovid Goyal
a0cee13652 Also turn on extended key reporting for CSI > 4; 2 m
This is supported by XTerm and used by vim. Fixes #4075
2021-09-29 11:12:01 +05:30
Kovid Goyal
a3b434d2fe ... 2021-09-29 11:01:30 +05:30
Kovid Goyal
36ab05f003 DRYer 2021-09-29 10:59:42 +05:30
Kovid Goyal
35dee0c46e Dont list all releases when publishing, instead just query the API for the existing release directly 2021-09-29 10:52:51 +05:30
Kovid Goyal
cb1858ecc8 Remove unused import 2021-09-29 10:33:04 +05:30
Kovid Goyal
10fbf36e92 Silence bells caused by cursor movement after click at prompt 2021-09-29 10:27:13 +05:30
Kovid Goyal
3c3e97aa6e Fix moved status not being returned to python 2021-09-29 08:37:26 +05:30
Kovid Goyal
f353380e86 Fix #4074 2021-09-29 08:08:29 +05:30
Kovid Goyal
b1375e5ed1 ask kitten: Allow clicking on a choice to select it
Fixes #4071
2021-09-28 20:13:11 +05:30
Kovid Goyal
44bcbc4823 Make it easier to handle simple click events 2021-09-28 20:12:55 +05:30
Kovid Goyal
a402a3ad12 Fix release not reporting button in sgr pixel protocol 2021-09-28 16:20:32 +05:30
Kovid Goyal
343eb56cdf Fix import of MouseEvent 2021-09-28 15:46:35 +05:30
Kovid Goyal
3efa8b6322 In SGR_PIXEL_MODE report pixel co-ords outside of window when dragging 2021-09-28 15:14:29 +05:30
Kovid Goyal
7cd72f344d Update link 2021-09-28 14:23:49 +05:30
Kovid Goyal
066dfc71aa A kitten to demo mouse handling 2021-09-28 13:48:56 +05:30
Kovid Goyal
769cd9be3f DRYer 2021-09-28 13:31:06 +05:30
Kovid Goyal
0f9d6a1e4a Forgot to clear screen before drawing 2021-09-28 12:56:19 +05:30
Kovid Goyal
3c742a0037 Use pixel mode for mouse tracking in kittens 2021-09-28 12:46:41 +05:30
Kovid Goyal
9a3d99515f Add support for reporting mouse events with pixel co-ordinates using the SGR_PIXEL_PROTOCOL introduced in xterm 359 2021-09-28 11:41:35 +05:30
Kovid Goyal
f3447d187d Allow handlers to ask for mouse events 2021-09-28 09:32:53 +05:30
Kovid Goyal
276696414e Use a full handler for choices in the ask kitten 2021-09-28 09:14:34 +05:30
Kovid Goyal
7d41aca0e4 More word selection direction change fixes 2021-09-27 20:42:22 +05:30
Kovid Goyal
c71d8fe1cc Fix #4070 2021-09-27 17:29:22 +05:30
Kovid Goyal
cc261db606 ... 2021-09-27 12:02:23 +05:30
Kovid Goyal
7e17ed21ce Use the atomic update decorator everywhere 2021-09-27 12:00:33 +05:30
Kovid Goyal
b1f4b2d8ed Use pending updates for unicode input kitten
Avoids all possibility of flicker
2021-09-27 11:33:21 +05:30
Kovid Goyal
9cb5f6d9d7 Add changelog entry for last PR 2021-09-27 11:18:47 +05:30
Kovid Goyal
f3177d8878 Merge branch 'unicode-input-scroll-4064' of https://github.com/dusanx/kitty 2021-09-27 11:17:42 +05:30
Kovid Goyal
3bc7b5bad9 Remote file transfer: Fix transfer not working is custom ssh port or identity is specified on the SSH command line
Fixes #4067
2021-09-27 10:58:40 +05:30
Kovid Goyal
b70064d1be Use a default set of ssh options if the binary is not found 2021-09-27 10:49:38 +05:30
Dusan Popovic
ffca2ecf19 scroll in unicode input 2021-09-26 23:18:33 +01:00
Kovid Goyal
a32b6d5cf5 No need for Optional 2021-09-26 12:30:08 +05:30
Kovid Goyal
3ce087a716 ... 2021-09-26 12:26:21 +05:30
Kovid Goyal
15cdeef552 Cleanup test_compile a bit 2021-09-26 12:21:25 +05:30
Kovid Goyal
a038477ce0 Cleanup previous PR 2021-09-26 11:17:54 +05:30
Kovid Goyal
b05e939e05 Merge branch 'patch-1' of https://github.com/unisgn/kitty 2021-09-26 11:11:42 +05:30
Kovid Goyal
6347daf0ac Merge branch 'add-dependency-to-shell.nix' of https://github.com/Luflosi/kitty 2021-09-25 19:24:07 +05:30
Luflosi
327f4ca327 shell.nix: add dependency on librsync
The dependency on librsync was introduced in f0fab80f5b.
2021-09-25 14:37:38 +02:00
Kovid Goyal
fe0d1034aa Cleanup any extra files produced by clang in debug mode when test compiling 2021-09-25 17:41:55 +05:30
Kovid Goyal
d982a3c94e ... 2021-09-25 14:08:44 +05:30
Kovid Goyal
259ca4a11e Speed up parsing of file transfer OSC codes
Avoid roundtrips between unicode and bytes objects
2021-09-25 14:05:21 +05:30
Kovid Goyal
b9ae1fa429 ... 2021-09-25 11:04:13 +05:30
Kovid Goyal
0d32c1656a More work on rsync based transfer 2021-09-25 11:03:17 +05:30
Kovid Goyal
2defd311e1 Fix a couple of typos in schedule_write_to_child_python 2021-09-25 11:01:23 +05:30
unisgn
d078cb264a Update ibus_glfw.c 2021-09-25 00:10:53 +08:00
unisgn
c45a656153 ibus's dbus name owner changed detection
fcitx5 works fine with kitty, except that when you restart fcitx5, kitty stop working with fcitx5, because the dbus_connection_get_is_connected(ibus->conn) in #check_connection is always true when you use fcitx5.
this patch add a dbus name owner changed detection to detect the online status of ibus, in case the ibus backend uses the session bus, like fcitx5.
2021-09-24 23:10:38 +08:00
Kovid Goyal
1cef544cff Allow sending escape code to child in chunks 2021-09-24 16:54:04 +05:30
Kovid Goyal
67cef371dc Allow writing bytes when sending escape code to child 2021-09-24 14:06:09 +05:30
Kovid Goyal
2fcfa8d3eb ... 2021-09-24 12:03:51 +05:30
Kovid Goyal
03391b4f7a Improve docs a little 2021-09-24 09:05:42 +05:30
Kovid Goyal
2dae95bf0b Fix reload config macOS shortcut in docs 2021-09-24 08:40:00 +05:30
Kovid Goyal
558fad1630 Fix test_compile() with debug and clang on macOS 2021-09-24 08:31:16 +05:30
Kovid Goyal
c2641458e7 A new option to specify the path to a sound file to use as the bell sound 2021-09-24 08:28:37 +05:30
Kovid Goyal
bbdfdb978d Modify canberra wrapper to allow specifying a sound file path 2021-09-24 07:31:02 +05:30
Kovid Goyal
4112061a47 Format the INSTALL.md links 2021-09-23 20:31:13 +05:30
Kovid Goyal
25e9ddb4a4 Fix type signature 2021-09-23 20:27:33 +05:30
Kovid Goyal
66bf39db93 DRYer 2021-09-23 20:20:47 +05:30
Kovid Goyal
be439cb887 When a tab_bar_background is specified it should extend to the edges of the OS window
Fixes #4054
2021-09-23 20:12:30 +05:30
Kovid Goyal
f3b601aa06 Make it clear what rects we are using for extra blank rects 2021-09-23 16:19:12 +05:30
Kovid Goyal
f6a6ead0f3 Fix active_tab_foreground ignored in slant style
Fixes #4053
2021-09-23 14:40:08 +05:30
Kovid Goyal
43c04df98a Only report progress if connected to a TTY 2021-09-22 08:14:47 +05:30
Kovid Goyal
581a373dae Echo build commands 2021-09-21 08:17:53 +05:30
Kovid Goyal
ca197a915c ... 2021-09-20 12:07:41 +05:30
Kovid Goyal
061111d822 Dont fail if asset already deleted 2021-09-20 12:05:35 +05:30
Kovid Goyal
41003d106a Set the signature parameters manually when rs_sig_args is not available 2021-09-20 11:42:44 +05:30
Kovid Goyal
c9b1e66c71 Upload the source for nightly builds as well 2021-09-20 11:28:34 +05:30
Kovid Goyal
17e95cb615 Add a test for rsync roundtrip 2021-09-19 20:55:00 +05:30
Kovid Goyal
b5c086aedb ... 2021-09-19 20:25:08 +05:30
Kovid Goyal
1036132838 Rename pw to bypass 2021-09-19 17:21:57 +05:30
Kovid Goyal
1d1d82ca50 Setup ropr buffer sizes for rsync operations 2021-09-19 17:19:34 +05:30
Kovid Goyal
85be3e4ed1 Also avoid mallocs for the output buffer 2021-09-19 15:28:22 +05:30
Kovid Goyal
d5d52ec8b9 When driving a job on a file avoid mallocs for each read 2021-09-19 13:49:10 +05:30
Kovid Goyal
ecb0d1f325 More work on wrapping librsync 2021-09-19 13:26:09 +05:30
Kovid Goyal
68436c93a7 More work on the transfer kitten 2021-09-19 10:17:53 +05:30
Kovid Goyal
2a9dff2846 Function to create the delta for a file 2021-09-18 14:00:59 +05:30
Kovid Goyal
bcd1837924 Generator for loading signatures
Also dont waste memory when no output is expected
2021-09-18 13:52:26 +05:30
Kovid Goyal
77508bfe0d Handle blocking with unused input in librsync 2021-09-18 13:08:53 +05:30
Kovid Goyal
cf517effb3 Wrap more of the librsync API 2021-09-18 12:49:38 +05:30
Kovid Goyal
901a075a38 ... 2021-09-18 11:51:54 +05:30
Kovid Goyal
76d6820af9 Do a full link test for rs_sig_args 2021-09-18 11:44:11 +05:30
Kovid Goyal
7cf73c10ac clang needs a newline at the end of src 2021-09-18 11:16:56 +05:30
Kovid Goyal
71963aa738 Fix librsync detection on freeze builds 2021-09-18 11:10:03 +05:30
Kovid Goyal
dcc0dabe68 Specify the library in the correct place when test compiling
Needed for ancient compilers
2021-09-18 10:58:14 +05:30
Kovid Goyal
348e632dd6 Fix building on the usual ancient Linux distro suspects
Detect if librsync is new enough to have rs_sig_args
2021-09-18 10:49:46 +05:30
Kovid Goyal
067502bd66 Fix warning on ancient gcc 2021-09-18 10:25:18 +05:30
Kovid Goyal
6b576fcf5c Use paths rather than flags in kitten extension definitions 2021-09-18 10:08:28 +05:30
Kovid Goyal
2fc972a173 rename function 2021-09-18 09:39:12 +05:30
Kovid Goyal
a941b1af4e Implement signature generation 2021-09-17 17:42:25 +05:30
Kovid Goyal
fbc8a1cdcb Remove workaround for older pillow in macOS CI 2021-09-17 13:57:09 +05:30
Kovid Goyal
f0fab80f5b Start work on rsync support for file transfers 2021-09-17 13:41:45 +05:30
Kovid Goyal
a0740d1616 Use multi-phase initialization for unicode-names 2021-09-17 08:56:55 +05:30
Kovid Goyal
8986d15a5b Remove unused code 2021-09-17 08:39:41 +05:30
Kovid Goyal
9f4f22743f Document how to install the nightly builds 2021-09-17 07:32:51 +05:30
Kovid Goyal
9eebd2c921 Update nightly release description with timestamp and commit sha 2021-09-16 22:44:18 +05:30
Kovid Goyal
5ce71506c8 Various minor fixes in nightly pipeline 2021-09-16 22:31:43 +05:30
Kovid Goyal
ad5b43f6db Start work on infrastructure for nightly builds 2021-09-16 22:13:01 +05:30
Kovid Goyal
aa9855516f Change memory allocation strategy for pending buf
Now it is allocated on demand. This prevents it from blowing up
to READ_BUF_SZ * 2 (2MB) if a small pending update is followed by a
large non pending section in the read buffer, which is commonly
triggered for instance by the transfer kitten which uses pending updates
for its screen drawing mixed with non-pending data transmission.

This is a slight performance penalty since there is a branch when
writing every char to the pending buffer, but the branch will be almost
always one sided so should be well predicted.

In any case, filling the pending buffer is not a performance bottleneck,
compared to actually dispatching parsed escape codes.
2021-09-16 20:23:15 +05:30
Kovid Goyal
fcd4649642 Use pending mode for progress bar updates 2021-09-16 19:54:48 +05:30
Kovid Goyal
e12246983b Fix the upper limit for the pending buffer
The pending buffer needs to be twice the max size of the read buffer.
2021-09-16 19:53:55 +05:30
Kovid Goyal
e8e7ad3b75 DRYer 2021-09-16 18:34:51 +05:30
Kovid Goyal
e9d648d37c Handle exceptions in the tui context managers 2021-09-16 18:28:29 +05:30
Kovid Goyal
eaeece8177 Use the repeat escape code for progress bar rendering 2021-09-16 17:55:22 +05:30
Kovid Goyal
aa9a991a85 Draw separator for final total 2021-09-16 17:45:11 +05:30
Kovid Goyal
0d37431def Report individual file transfer failures 2021-09-16 17:40:19 +05:30
Kovid Goyal
44dfd7a803 More work on transfer kitten 2021-09-16 17:28:26 +05:30
Kovid Goyal
d2809a0acb More work on transfer kitten 2021-09-16 15:27:53 +05:30
Kovid Goyal
4b074d723e ... 2021-09-16 14:01:48 +05:30
Kovid Goyal
deb6abe50e Ancient python compat 2021-09-16 13:50:05 +05:30
Kovid Goyal
d042ea5ab9 Split up tranfer kitten code into modules 2021-09-16 13:47:12 +05:30
Kovid Goyal
bc7c1e4d05 More work on the transfer kitten 2021-09-16 13:34:32 +05:30
Kovid Goyal
a4c5e7c2ee More work on the transfer kitten 2021-09-16 13:02:39 +05:30
Kovid Goyal
504d915723 Fix div by zero errors 2021-09-16 10:30:28 +05:30
Kovid Goyal
039ea95390 Sanitize displayed file names 2021-09-16 10:19:08 +05:30
Kovid Goyal
5f32d2e56f Uppercase DELETE_ENV_VAR 2021-09-16 10:16:33 +05:30
Kovid Goyal
5b716df45f We dont need a special class for delete_env_var 2021-09-16 09:53:54 +05:30
Kovid Goyal
66e2e60ac4 Allow deleting environment vars from the child environment using env 2021-09-16 08:43:17 +05:30
Kovid Goyal
69dc09489b Fix name collision 2021-09-16 07:59:42 +05:30
Kovid Goyal
33a6abfc07 More work on the transfer kitten 2021-09-16 07:39:07 +05:30
Kovid Goyal
f277cbf3f3 Improved trailing newline handling in the fish shell integration
Thanks to some assistance from @faho
See https://github.com/kovidgoyal/kitty/issues/4032#issuecomment-919936913
2021-09-15 21:06:28 +05:30
Kovid Goyal
0a56ab7a1e Workaround for fish splitting on newlines when doing command substitution 2021-09-15 18:12:40 +05:30
Kovid Goyal
a073936997 Fish shell integration: Strip trailing newlines from the original fish prompt as fish does this 2021-09-15 16:58:31 +05:30
Kovid Goyal
5c1dd69963 forgot this in the last commit 2021-09-15 14:03:01 +05:30
Kovid Goyal
c08dc64581 spinner and progress bar for kittens UI 2021-09-15 13:39:39 +05:30
Kovid Goyal
5916bbd5b3 Merge branch 'master' of https://github.com/DiegoBaldassar/kitty 2021-09-15 07:31:51 +05:30
DiegoBaldassar
8c104b52f9 icat: fix exception thrown if stdin is None
Don't use sys.stdin if --stdin=no is given, or if --stdin=detect is given and sys.stdin is None
2021-09-14 22:18:34 +02:00
Kovid Goyal
7266cb653d Add a reference for the claim of minimal latency 2021-09-14 22:38:58 +05:30
Kovid Goyal
2a8fd278c1 Bring implementation of XTSAVE and XTRESTORE into line with xterm
Now a stack of depth 1 is used to save/restore private mode values. And
saving/restoring individual modes is supported. This latter is used by
midnight commander.
2021-09-14 21:59:41 +05:30
Kovid Goyal
4c25ceff29 Remove duplicated reset of mouse_utf8_mode 2021-09-14 20:22:28 +05:30
Kovid Goyal
26f0b53bb2 Dont compress already compressed files 2021-09-14 20:11:34 +05:30
Kovid Goyal
101377d7f2 Better fix for reflow with last line being empty output start line 2021-09-14 14:18:47 +05:30
Kovid Goyal
2487f55bbc Merge branch 'patch-1' of https://github.com/vincentbernat/kitty 2021-09-14 13:06:57 +05:30
Vincent Bernat
f69e718151 Fix typo in documentation
"programmble" → "programmable"
2021-09-14 09:04:06 +02:00
Kovid Goyal
5d516a8584 ... 2021-09-13 13:26:30 +05:30
Kovid Goyal
b1322fbe04 Prompt for permission when reading from clipboard by default
Fixes #4022
2021-09-13 12:32:40 +05:30
Kovid Goyal
38a5e38f88 Transmit hashed password 2021-09-13 12:00:38 +05:30
Kovid Goyal
78fd05c1c6 ... 2021-09-13 11:49:17 +05:30
Kovid Goyal
6993c905e3 Disallow empty ids in file transfer commands 2021-09-13 09:53:59 +05:30
Kovid Goyal
14f8ce6e15 Add a python wrapper to play arbitrary sounds 2021-09-13 08:59:34 +05:30
Kovid Goyal
d726eb354d Play with human size some more 2021-09-12 13:41:51 +05:30
Kovid Goyal
1136c64d49 Make human_size() a little nicer 2021-09-12 13:28:07 +05:30
Kovid Goyal
3f3179db0c ... 2021-09-12 12:47:58 +05:30
Kovid Goyal
d224a4c39f When receiving a long delayed cancel request process it before pruning 2021-09-12 12:46:30 +05:30
Kovid Goyal
3eee442f28 Output total transfer size when confirming 2021-09-12 12:41:48 +05:30
Kovid Goyal
7c90812e51 ... 2021-09-12 12:21:03 +05:30
Kovid Goyal
5c8bcf9379 Implement confirm paths 2021-09-12 12:12:23 +05:30
Kovid Goyal
d40456d6a9 Add a FAQ entry with a list of alternate icons 2021-09-12 11:53:08 +05:30
Kovid Goyal
8e203af344 cleanup text 2021-09-12 11:40:02 +05:30
Kovid Goyal
31ead3f088 Basic file transfer works for sending 2021-09-12 10:02:23 +05:30
Kovid Goyal
efaeb0f0b2 Remove backslashes from CLI theme names if no theme with the name is found 2021-09-12 09:35:31 +05:30
Kovid Goyal
9db9638bc3 Soak up protocol responses after a cancel to avoid outputting garbage to the shell after the kitten exits 2021-09-11 10:48:40 +05:30
Kovid Goyal
74c1476f6d Disallow more than 10 active receives to prevent DoS attacks 2021-09-10 21:20:05 +05:30
Kovid Goyal
24255be0bd Add a permission password to the transfer kitten 2021-09-10 18:09:59 +05:30
Kovid Goyal
0d89eb2c40 When not using alternate screen dont restore cursor position to what it was before initialization 2021-09-10 17:26:01 +05:30
Kovid Goyal
2350952d05 More work on the transfer kitten 2021-09-10 16:54:36 +05:30
Kovid Goyal
53e38cb1d2 Add a note about hologram.nvim to the graphics protocol page 2021-09-10 10:33:01 +05:30
Kovid Goyal
f9c99a61d4 More work on file transfer 2021-09-09 12:59:31 +05:30
Kovid Goyal
2178c8e4af ... 2021-09-09 08:43:44 +05:30
Kovid Goyal
8aacf30f19 Centralize definition of file transfer OSC code 2021-09-08 13:43:59 +05:30
Kovid Goyal
745e97e0ab Send a started response after each dest file is registered 2021-09-08 09:59:45 +05:30
Kovid Goyal
af5c0b3b71 More work on transmission kitten 2021-09-08 08:56:14 +05:30
Kovid Goyal
d7a1f3104a Add no_op to get_all_actions() 2021-09-06 15:26:48 +05:30
Kovid Goyal
8fb48d7952 Output more kitty global state when debugging config 2021-09-06 08:36:53 +05:30
Kovid Goyal
1ac3de4aeb typo 2021-09-04 10:45:53 +05:30
Kovid Goyal
0c5ea5c3c0 Make paypal button appearance match the rest 2021-09-03 09:24:55 +05:30
Kovid Goyal
78e4f1cde4 Add github sponsors to support page 2021-09-03 09:13:32 +05:30
Kovid Goyal
fb0b94eaa1 ... 2021-09-03 09:06:03 +05:30
Kovid Goyal
7291fef7cc Add github sponsors funding link 2021-09-03 08:39:46 +05:30
Kovid Goyal
6db46850eb Fix #3989 2021-09-02 13:05:14 +05:30
Kovid Goyal
7997295d4c Make a section about terminals implementing the graphics protocol 2021-09-02 12:49:17 +05:30
Kovid Goyal
6daee3a0b5 @get-text: Allow getting the last command output 2021-09-02 10:13:54 +05:30
Kovid Goyal
87f6793552 Allow mocking usage of timers in the test suite 2021-09-01 13:09:42 +05:30
Kovid Goyal
40786427b0 More work on file transmission 2021-09-01 09:22:04 +05:30
Kovid Goyal
59b84ae1a4 Note that chafa added support for the graphics protocol 2021-09-01 06:44:35 +05:30
Kovid Goyal
aafd8a8da4 When expanding vars allow using $$ for literal $ 2021-08-31 17:24:19 +05:30
Kovid Goyal
5ff66f6bfa When reloading config also reload open-actions.conf 2021-08-30 20:24:08 +05:30
Kovid Goyal
e8873804c0 Note that the graphics protocol is now supported in WezTerm as well 2021-08-30 13:56:21 +05:30
Kovid Goyal
0f37521592 Add a note to the graphics protocol about symlink resolution 2021-08-30 12:23:26 +05:30
Kovid Goyal
8ad1180321 Make a note that only regular files are supported for transmission of graphics data 2021-08-30 12:04:43 +05:30
Kovid Goyal
ced03c5d99 More work on file transmission 2021-08-30 09:00:38 +05:30
Kovid Goyal
161a54ceaa Disable transmission tests pending rewrite 2021-08-30 08:08:41 +05:30
Kovid Goyal
c159ac287f Flush input queue when child is removed
This is needed for running kittens that return data by printing
to STDOUT. As otherwise with a long input delay the output never
gets processed. Fixes #3980
2021-08-30 08:03:53 +05:30
Kovid Goyal
4ddd2bf980 More work on transmission 2021-08-29 21:09:20 +05:30
Kovid Goyal
1d9425ecdc Change transmission protocol to not need container formats 2021-08-29 06:27:07 +05:30
Kovid Goyal
495981bade Pass failure to send data to child because of full buffer up the stack 2021-08-25 13:28:50 +05:30
Kovid Goyal
672cf9fffe Start work on transfer kitten 2021-08-25 11:38:41 +05:30
Kovid Goyal
72e15d8b4f Fish integration: Have the value of $status preserved by the prompt functions 2021-08-24 20:29:12 +05:30
Kovid Goyal
075b4d252a DRYer 2021-08-24 07:49:12 +05:30
Kovid Goyal
1953ecdf4d Add tests for container transmission 2021-08-23 22:10:26 +05:30
Kovid Goyal
89f8151579 hints kitten: Fix a regression that caused using the default open program to trigger open actions instead of running the program
Fixes #3968
2021-08-23 11:56:16 +05:30
Kovid Goyal
d9cc1d67c0 Make path comparison more robust 2021-08-23 11:48:21 +05:30
Kovid Goyal
d178f4c75d Implement canceling of file transmission 2021-08-23 11:33:03 +05:30
Kovid Goyal
0668a3bf2a Send a response indicating transmission was successful 2021-08-23 11:09:45 +05:30
Kovid Goyal
d548b21be2 Allow interleaving file transmissions 2021-08-22 22:08:03 +05:30
Kovid Goyal
ebcd053bf3 Fix incorrect prompt reflow when a command is running that has produced no output
Needed to preserve the output start semantics on the first empty dest line
2021-08-22 13:55:59 +05:30
Kovid Goyal
b282464604 ... 2021-08-22 13:13:13 +05:30
Kovid Goyal
42dcecde14 More work on file transmission 2021-08-22 13:01:43 +05:30
Kovid Goyal
aa0b344b55 kitten to confirm file transfer requests 2021-08-22 07:23:49 +05:30
Kovid Goyal
fa77128026 ... 2021-08-21 22:09:20 +05:30
Kovid Goyal
7f1c5d8534 DRYer 2021-08-21 17:32:55 +05:30
Kovid Goyal
d2a31a6a0f Merge branch 'master' of https://github.com/Mukundan314/kitty 2021-08-20 21:51:21 +05:30
Mukundan314
fb9c911ae9 Fix spelling mistake in docs for themes kitten 2021-08-20 21:35:40 +05:30
Kovid Goyal
5bc569c4dd Allow specifying whether to count windows at prompts or not for confirm_clsoe 2021-08-20 17:13:42 +05:30
Kovid Goyal
8397970bf8 Ensure fish config dir exists 2021-08-20 08:54:41 +05:30
Kovid Goyal
6fc7b3d946 Merge branch 'fix-clang-warning' of https://github.com/Luflosi/kitty 2021-08-20 05:56:31 +05:30
Luflosi
0fe7796df0 Fix Clang warning
Without this, Clang would complain:
```
In file included from kitty/fonts.c:9:
In file included from kitty/fonts.h:9:
kitty/lineops.h:67:29: error: suggest braces around initialization of subobject
      [-Werror,-Wmissing-braces]
    const CellAttrs zero = {0};
                            ^
                            {}
```
2021-08-19 22:52:36 +02:00
Kovid Goyal
40b50332de Fix space ligatures not working with Iosevka for some characters in the Enclosed Alphanumeric Supplement
Recognize chars in this block as non-emoji dingbats to turn on space
ligatures for them

Fixes #3954
2021-08-19 22:28:07 +05:30
Kovid Goyal
9a50dfc4b5 broadcast kitten: Allow broadcasting ctrl+c
Fixes #3956
2021-08-19 22:05:29 +05:30
Kovid Goyal
09c18f474f Broadcast kitten: Fix --match and also remove a useless print 2021-08-19 21:58:04 +05:30
Kovid Goyal
51244c4388 Cleanup previous PR 2021-08-19 19:42:15 +05:30
Kovid Goyal
898f162369 Merge branch 'master' of https://github.com/fladson/kitty 2021-08-19 19:41:28 +05:30
Fladson Gomes
2529ef2f0b Add linker fail build notes for macos 2021-08-19 15:08:08 +02:00
Kovid Goyal
fc528941bd remove reference to obsolete kitty-themes repo 2021-08-19 14:20:06 +05:30
Kovid Goyal
8e9ee90d9f More work on file transfer protocol 2021-08-19 14:13:54 +05:30
Kovid Goyal
b03c6f70fe add macOS variants for config scs 2021-08-19 10:00:09 +05:30
Kovid Goyal
42da681f2b Launch command: Allow specifying the OS window title 2021-08-19 09:52:52 +05:30
Kovid Goyal
44561e8cea macOS: Fix SIGUSR1 quitting kitty instead of reloading the config file
Fixes #3952
2021-08-19 09:37:08 +05:30
Kovid Goyal
37735b962e Start work on new file_transmission protocol 2021-08-19 09:23:01 +05:30
Kovid Goyal
34ec3eac44 icat kitten: Fix display of JPEG images that are rotated via EXIF data and larger than available screen size
Fixes #3949
2021-08-19 09:08:35 +05:30
Kovid Goyal
59c14d07fd Update versionadded 2021-08-18 11:02:15 +05:30
Kovid Goyal
86ffb744f5 Move changelog entry for shell integration 2021-08-18 10:06:53 +05:30
Kovid Goyal
fab7cfb113 Handle multiline cursor movement in zsh when clicking 2021-08-18 10:06:10 +05:30
Kovid Goyal
2715947830 DRYer 2021-08-18 10:06:10 +05:30
Kovid Goyal
eb2f3387c5 Add some notes about the shell marking protocol 2021-08-18 10:06:10 +05:30
Kovid Goyal
2472cea69f Fix resizing causing a line or two from the start of the th last cmd output to be skipped
Resizing causes multiple consecutive lines to be marked as being start
of output, so rewind to the first of them.
2021-08-18 10:06:10 +05:30
Kovid Goyal
2a634af2bc When confirming close commands dont count windows sitting at shell prompts 2021-08-18 10:06:10 +05:30
Kovid Goyal
81654c9874 Function to check if cursor is at marked prompt 2021-08-18 10:06:09 +05:30
Kovid Goyal
28914d4450 Remove a macro that is not really needed anymore 2021-08-18 10:06:09 +05:30
Kovid Goyal
4000cce81c DRYer 2021-08-18 10:06:09 +05:30
Kovid Goyal
35ad366427 Fix incorrect prompt marking on screen resize
Forgot to initialize line attrs for src lines in the LineBuf
2021-08-18 10:06:09 +05:30
Kovid Goyal
c257adb56a Add a debug action to dump current lines with their attributes 2021-08-18 10:06:09 +05:30
Kovid Goyal
929e0c126d rename -> replace 2021-08-18 10:06:09 +05:30
Kovid Goyal
b293e4d516 DRYer 2021-08-18 10:06:09 +05:30
Kovid Goyal
6571cf2e89 When showing last cmd output convert wrap markers into line breaks
This matches the behavior of show_scrollback and works well with overlay
windows and if the pager is configured to not wrap
2021-08-18 10:06:09 +05:30
Kovid Goyal
aa739cdfd4 Add shell_prompt_marking to client 2021-08-18 10:06:09 +05:30
Kovid Goyal
35c608ae77 Dont add wrap markers (\r) when showing last command output 2021-08-18 10:06:09 +05:30
Kovid Goyal
8d8095a2d1 Migrate an action spec to the new syntax 2021-08-18 10:06:09 +05:30
Kovid Goyal
1740821bb4 Move changelog entry into correct place 2021-08-18 10:06:09 +05:30
Kovid Goyal
4cd6829657 forgot to geenrate update opts 2021-08-18 10:06:09 +05:30
Kovid Goyal
ef76c075e0 Get rid of bits from CellAttrs 2021-08-18 10:06:08 +05:30
Kovid Goyal
b260a61c8f Get rid of bits from LineAttrs 2021-08-18 10:06:08 +05:30
Kovid Goyal
780e526143 Use a union for cell attributes
Cleaner code, no performance impact
2021-08-18 10:06:08 +05:30
Kovid Goyal
1e0269faa2 Fix sourcing of shell integration changing $? on bash/zsh 2021-08-18 10:06:08 +05:30
Kovid Goyal
73465aa44b Change the shortcuts to z and x for jumping to prompts 2021-08-18 10:06:08 +05:30
Kovid Goyal
1f5fa03015 Use a union for line attrs
Allows faster construction of Line objects without needing to set
individual booleans. And cleaner code.
2021-08-18 10:06:08 +05:30
Kovid Goyal
000e1012c6 Option for packagers to easily tune shell integration 2021-08-18 10:06:08 +05:30
Kovid Goyal
afc5821809 Note when shell integration was added to kitty 2021-08-18 10:06:08 +05:30
Kovid Goyal
e8832a86bb Fix scroll_to_prompt for prompts that have been reflowed over multiple lines 2021-08-18 10:06:08 +05:30
Kovid Goyal
f61b8608de Fix mouse click event using current mouse co-ords rather than the co-ords at the time of the click 2021-08-18 10:06:08 +05:30
Kovid Goyal
92f428b6d1 common prefix should not apply to basename 2021-08-18 10:06:08 +05:30
Kovid Goyal
8795bf8cf9 various fixed for completion
- Fix completion of --directory
- Dont remove common prefix unless it contains path separator
- Dont show suggestions for options on new words
2021-08-18 10:06:08 +05:30
Kovid Goyal
0dee0bfada zsh completion: Dont remove prefix when only a single item is present in the group 2021-08-18 10:06:07 +05:30
Kovid Goyal
482d3bb913 Better integrate shell integration into sidebar toc 2021-08-18 10:06:07 +05:30
Kovid Goyal
48035977e3 Style details summary as a link 2021-08-18 10:06:07 +05:30
Kovid Goyal
6b23921880 Document the new shell integration features 2021-08-18 10:06:07 +05:30
Kovid Goyal
c98e4eb478 Start documenting shell integration 2021-08-18 10:06:07 +05:30
Kovid Goyal
7cd05ad76b ... 2021-08-18 10:06:07 +05:30
Kovid Goyal
fa327d618d Cursor movement at shell prompts on click
Fixes #3825
2021-08-18 10:06:07 +05:30
Kovid Goyal
bc202aec6e Dont discard information on whether a click hit a URL 2021-08-18 10:06:07 +05:30
Kovid Goyal
606ce4e66f Add descriptions to fish completions 2021-08-18 10:06:07 +05:30
Kovid Goyal
a10c19456a Fix completions for fish 2021-08-18 10:06:07 +05:30
Kovid Goyal
20688661aa ... 2021-08-18 10:06:07 +05:30
Kovid Goyal
cbbd9f475e fish completions dont want quoting 2021-08-18 10:06:07 +05:30
Kovid Goyal
f4b3948168 Use a shortened dir path for window title
Also respect named directories
2021-08-18 10:06:07 +05:30
Kovid Goyal
2245d4506f Add title and cursor to fish integration 2021-08-18 10:06:06 +05:30
Kovid Goyal
7f3da135e2 ... 2021-08-18 10:06:06 +05:30
Kovid Goyal
23f94b6e67 Get prompt marking working for th fish shell 2021-08-18 10:06:06 +05:30
Kovid Goyal
0ec10b52e0 Add shebangs 2021-08-18 10:06:06 +05:30
Kovid Goyal
2fcd57410a Dont fail if rc file dir doesnt exist 2021-08-18 10:06:06 +05:30
Kovid Goyal
a993a71857 Add shell integration for bash 2021-08-18 10:06:06 +05:30
Kovid Goyal
01ce0e1d1a Prevent fd leak if copystat fails 2021-08-18 10:06:06 +05:30
Kovid Goyal
040a152f1f Preserve stat attributes when modifying rc files atomically 2021-08-18 10:06:06 +05:30
Kovid Goyal
f4f2013c2b Create shell integration rc file if it doesnt exist 2021-08-18 10:06:06 +05:30
Kovid Goyal
6e172bdc09 Fix cursor in zsh vicmd mode 2021-08-18 10:06:06 +05:30
Kovid Goyal
725ec57bee Automatically setup shell integration for ZSH 2021-08-18 10:06:06 +05:30
Kovid Goyal
8a9234ba4f Move shell integration docs into own file 2021-08-18 10:06:06 +05:30
Kovid Goyal
a00e4ebe3f Improce docstring 2021-08-18 10:06:06 +05:30
Kovid Goyal
2d93a011df Option to control shell integration 2021-08-18 10:06:05 +05:30
Kovid Goyal
bffe7aba8f Add shell integration scripts to kitty package 2021-08-18 10:06:05 +05:30
Kovid Goyal
b581408137 DRYer 2021-08-18 10:06:05 +05:30
Kovid Goyal
2263cd1355 Use a _ksi_ prefix for shell integration
Sadly function in zsh are global so prefix all function and global var
names with _ksi_ as poor mans namespacing.
2021-08-18 10:06:05 +05:30
Kovid Goyal
1bb87c71aa Make all shell integrations disablable 2021-08-18 10:06:05 +05:30
Kovid Goyal
7dec7d615a Use an env var to control shell integration 2021-08-18 10:06:05 +05:30
Kovid Goyal
2e5308ad40 Use an associative array for prompt data 2021-08-18 10:06:05 +05:30
Kovid Goyal
d1015de700 Workaround for base64 on linux inserting line breaks by default 2021-08-18 10:06:05 +05:30
Kovid Goyal
934318adb1 DRYer 2021-08-18 10:06:05 +05:30
Kovid Goyal
179c2b21c0 Make debug_print remove esc and bel
Should really be made more robust, but cant be bothered
2021-08-18 10:06:05 +05:30
Kovid Goyal
85f6d3fed8 Use PS1 to set the prompt start mark
Needed as precmd functions are not called when redrawing the prompt. As
far as I can tell zsh stupidly has no hook that is called when the
prompt is redrawn after a window resize or when a background job
finishes.
2021-08-18 10:06:05 +05:30
Kovid Goyal
a4925eeeb4 ... 2021-08-18 10:06:05 +05:30
Kovid Goyal
196200d03f Dont reflow the current prompt when resizing
This ensures that there is no leftover line when the shell redraws the prompt,
by making the prompt a simple single character prompt before rewrapping.
2021-08-18 10:06:04 +05:30
Kovid Goyal
f2ca0424a0 Use correct src_line for attrs copy when rewrapping 2021-08-18 10:06:04 +05:30
Kovid Goyal
07b971ad5f Add a shortcut to easily browse the output of the last command run in the shell 2021-08-18 10:06:04 +05:30
Kovid Goyal
51fa25e03d Add shortcuts for jumping to prev/next shell prompt 2021-08-18 10:06:04 +05:30
Kovid Goyal
bd5f100f13 Add test for multiline prompt jumping 2021-08-18 10:06:04 +05:30
Kovid Goyal
3b8da7e4c2 implementation of scroll_to_prompt 2021-08-18 10:06:04 +05:30
Kovid Goyal
4a9a021b2c DRYer 2021-08-18 10:06:04 +05:30
Kovid Goyal
d4dd226d8f Preserve prompt markings when copying lines and rewrapping them 2021-08-18 10:06:04 +05:30
Kovid Goyal
0d4237f802 Mark prompt lines 2021-08-18 10:06:04 +05:30
Kovid Goyal
46b9aca16e Start work on shell integration 2021-08-18 10:06:04 +05:30
Kovid Goyal
4931477ef4 typo 2021-08-18 10:06:04 +05:30
Kovid Goyal
dfdd1697c5 Make the signatures of drat tab functions extendable with backwards compat 2021-08-18 10:03:50 +05:30
Kovid Goyal
801f0d51a1 Cleanup docs a bit 2021-08-18 08:31:49 +05:30
Kovid Goyal
bdebb19648 Merge branch 'wayland-hyper' of https://github.com/orki/kitty 2021-08-18 08:29:51 +05:30
Ravi R Kiran
75df0cbcf5 Gate Wayland modifier autodiscovery behind an environment variable 2021-08-17 21:46:09 -05:00
Kovid Goyal
e23b4ce6b4 Document a couple more env vars 2021-08-18 07:49:54 +05:30
Ravi R Kiran
1b88a68b55 Be even more conservative in declaring success
This handles the nonsensical case of Alt_X being mapped to two
different modifiers.
2021-08-17 21:11:55 -05:00
Kovid Goyal
a82bc6738c A new option to draw the tab bar centered or right
Fixes #3946
2021-08-18 07:35:04 +05:30
Kovid Goyal
868626c79c Allow the user to supply a custom Python function to draw tab bar 2021-08-18 07:15:03 +05:30
Kovid Goyal
e4cc8bf828 Merge branch 'update-shell.nix' of https://github.com/Luflosi/kitty 2021-08-18 06:26:31 +05:30
Luflosi
f57fb17d2b shell.nix: add new dependencies for building the documentation 2021-08-17 17:55:40 +02:00
Luflosi
a69170b0ba shell.nix: make more similar to the code in Nixpkgs
Remove the dependency on installShellFiles as it is not needed for building kitty itself and is only used in Nixpkgs for conveniently installing man pages and shell completions.
pkgconfig has been renamed to pkg-config.
Use `with python3Packages;` to reduce code duplication. This is how it's done in Nixpkgs as well.
Also sort the packages in nativeBuildInputs.
2021-08-17 17:43:49 +02:00
Kovid Goyal
4066c2389d Fix a regression that caused --title to not work when opening new OS windows using --single-instance 2021-08-17 20:32:03 +05:30
Kovid Goyal
cd7b4fcd8e version 0.23.1 2021-08-17 11:37:24 +05:30
Ravi R Kiran
b0c963b650 Heuristic to find hyper and meta on wayland 2021-08-16 21:59:53 -05:00
Kovid Goyal
f67995d5d3 See if we can mollify CodeQL 2021-08-16 22:53:46 +05:30
Kovid Goyal
f0e7344bc8 Use bundled CA certs on Linux binary builds as well
Makes it consistent with macOS
2021-08-16 22:47:53 +05:30
Kovid Goyal
aa525c68c7 Only test bundled CA certs on macOS 2021-08-16 22:26:10 +05:30
Kovid Goyal
a2e25331a5 Dont check Linux CA locations on macOS 2021-08-16 22:23:24 +05:30
Kovid Goyal
d8f09d377f Install ca-certificates on Linux CI machines 2021-08-16 22:15:27 +05:30
Kovid Goyal
cc96cb1c75 Check a few more locations for CA certificates 2021-08-16 22:09:39 +05:30
Kovid Goyal
5966f04656 Add a build test for CA certificate loading 2021-08-16 20:44:47 +05:30
Kovid Goyal
dbce9a8f29 themes kitten: Fix only the first custom theme file being loaded
Fixes #3938
2021-08-16 20:27:21 +05:30
Kovid Goyal
4333552523 Matching windows/tabs: allow matching by recency
``recent:0`` matches the active window/tab, ``recent:1`` matches the
previous window/tab and so on
2021-08-16 18:29:06 +05:30
Kovid Goyal
c00e945f6e Make the clipboard size limit configurable
Fixes #3937
2021-08-16 17:29:36 +05:30
Kovid Goyal
56cb628ee8 macOS: Bundle mozilla's root certificates with kitty
Apple doesnt provide root certificates in a form useable by openssl
which means all ssl based network requests fail, so bundle our own

Fixes #3936
2021-08-16 17:16:03 +05:30
Kovid Goyal
827b6598b2 version 0.23.0 2021-08-16 07:38:02 +05:30
Kovid Goyal
59bafea06d Add some docs for non-interactive theme changing 2021-08-16 07:37:59 +05:30
Kovid Goyal
d61aca40b8 Make link to template.conf a download link 2021-08-16 07:14:49 +05:30
Kovid Goyal
bf704d35a2 Add a link to kitty-themes in the changelog 2021-08-16 07:11:05 +05:30
Kovid Goyal
fbc8881a96 Merge branch 'master' of github.com:kovidgoyal/kitty 2021-08-15 08:28:00 +05:30
Kovid Goyal
8cfb1efb01 hints kitten: Make the --program option work with --linenum-action=self
Fixes #3931
2021-08-15 08:27:25 +05:30
Kovid Goyal
f399b8466c Merge branch 'patch-1' of https://github.com/con-f-use/kitty 2021-08-14 19:42:19 +05:30
con-f-use
437ba69049 docs: typo in hint.rst, adaption to new layout 2021-08-14 15:19:27 +02:00
Kovid Goyal
dbc7e8e85d When dragging word or line selections, ensure the initially selected item is never deselected
This matches behavior in most other programs
Fixes #3930
2021-08-13 20:23:43 +05:30
Kovid Goyal
f3333ce941 Fix getting connection data from ssh command line when -- is used in the command line
This broke the remote file kitten when using the ssh kitten as the later
was changed to use -- recently.

Fixes #3929
2021-08-13 17:14:43 +05:30
Kovid Goyal
97a9261096 ... 2021-08-13 17:04:49 +05:30
Kovid Goyal
5a76dab3c6 ControlMaster must not suppress exceptions 2021-08-13 17:02:27 +05:30
Kovid Goyal
5a92d3f312 Fix a regression that broke the edit action in the remote file kitten 2021-08-13 16:59:40 +05:30
Kovid Goyal
b173dd1c39 Fix error getting editor in remote file kitten not being reported 2021-08-13 16:57:01 +05:30
Kovid Goyal
473e1a6f22 Fix #3926
Apparently nvim assumes cnorm doesn't affect cursor shape. It's
ambiguous whether cnorm should affect it or not. So to prevent
regressions in case other programs assume that as well, have it only
make the cursor visible and blinking, without changing its shape.
2021-08-13 09:31:18 +05:30
Kovid Goyal
9c4a890688 Adjust attenuation based on color 2021-08-11 12:41:09 +05:30
Kovid Goyal
a803c8bcc5 Make the visual bell flash more gentle, especially on dark themes
Fixes #2937
2021-08-11 12:09:25 +05:30
Kovid Goyal
5c7ce18379 Move visual bell code into shaders.c 2021-08-11 12:04:52 +05:30
Andrew Mayorov
aff6fdfa84 Make visual bell flash much more gentle
Right now visual bell makes background flash sharply with bright white
(when configured with darkish color theme). This causes eye strain,
especially prominent in unlit environments.

This change makes background bounce smoothly between regular bg color
and highlight (selection) bg color for the configured visual bell
duration. Intensity is animated with cubic easing functions. It
currently peaks at 20% of the duration, this is hardcoded.

Mark functions computing intensity and easing as inline

Do smarter blending of visual bell flash

Blend highlight color with pegtop's softlight mode over both background
and half as much over foreground. This should help with flash visibility
in light themed and inverted colors contexts.

Blend flash in BACKGROUND pass also

Revert "Do smarter blending of visual bell flash"

This reverts commit 9a269d55c7d04334b1c4891c42914423517dfad6.

Revert "Blend flash in BACKGROUND pass also"

This reverts commit 756332cb9d7576b08db78406e37349aa6d1df156.

Revert "Make visual bell flash much more gentle"

This reverts commit cbfe5d59ada2da690e14c7532a7468b0c307c462.

Render flash overlay in a separate drawcall

Trigger frequent repaints to make for smooth animation

Attenuate flash a bit more
2021-08-11 11:54:43 +05:30
Kovid Goyal
477a652b44 Function to update a theme file 2021-08-11 09:09:07 +05:30
Kovid Goyal
15e0b42f04 Make the regex for commenting settings more robust 2021-08-11 08:46:42 +05:30
Kovid Goyal
b25ea9c863 Fix #3913 2021-08-09 08:37:53 +05:30
Kovid Goyal
c838cb03c9 Do not allow reloading the config to affect allow_remote_control 2021-08-08 15:34:34 +05:30
Kovid Goyal
ba9adc127e Use realpath when creating conf.bak as well 2021-08-08 10:49:41 +05:30
Kovid Goyal
b7d603c4de Atomic save should preserve stat if the file exists 2021-08-08 10:41:46 +05:30
Kovid Goyal
71f1f3aa64 Atomic save should use the target of symlinks 2021-08-08 10:35:38 +05:30
Kovid Goyal
7d1c26202a Add completion for options that take choices 2021-08-08 10:08:15 +05:30
Kovid Goyal
80db2f6558 Completion for theme names 2021-08-08 09:57:57 +05:30
Kovid Goyal
e376c79dda Show the current theme name in kitty.conf as well 2021-08-08 09:42:07 +05:30
Kovid Goyal
5a47e0d2e4 Make reload_conf_in_all_kitties re-useable 2021-08-08 09:38:29 +05:30
Kovid Goyal
ca9143bebc Allow reloading conf in all kitty instances as well 2021-08-08 09:33:36 +05:30
Kovid Goyal
a49f6799de Print usage when no args provided to +runpy 2021-08-08 09:10:47 +05:30
Kovid Goyal
d916ecc4f3 Add a non-interactive mode to the themes kitten 2021-08-08 07:57:14 +05:30
Kovid Goyal
e1ed9aca10 clear_all_mouse_shortcuts -> clear_all_mouse_actions 2021-08-07 21:34:16 +05:30
Kovid Goyal
0e2f1b9405 Merge branch 'fork' of https://github.com/bdeshi/kitty 2021-08-07 21:30:57 +05:30
bdeshi
db5a2d2141 add clear_all_mouse_shortcuts option to clear mouse_maps 2021-08-07 21:33:56 +06:00
Kovid Goyal
a9771dccba Change list position in kittens intro 2021-08-07 18:40:36 +05:30
Kovid Goyal
4849e07c26 Document the themes kitten 2021-08-07 18:38:33 +05:30
Kovid Goyal
4645e78fa7 Reload config in parent kitty when running the themes kitten 2021-08-07 16:54:47 +05:30
Kovid Goyal
9e2590eb15 Set the KITTY_PID env var when running child processes 2021-08-07 16:48:34 +05:30
Kovid Goyal
94575a5cf6 Implement modifying of kitty.conf
An include for the current theme is added and
all existing color related settings are commented out
so that the theme overlays on kitty's default settings.
2021-08-07 16:34:41 +05:30
Kovid Goyal
a597a8d86b Make the recent list functional 2021-08-07 15:31:03 +05:30
Kovid Goyal
3287798efe terminfo: Fix "cnorm" the property for setting the cursor to normal using a solid block rather than a blinking block cursor
cnorm should match the default cursor in kitty, which is a blinking
block. Fixes #3906
2021-08-07 15:15:59 +05:30
Kovid Goyal
d01ac17334 Implement placing of selected theme in kitty config dir 2021-08-07 15:04:32 +05:30
Kovid Goyal
2c96727c45 Implement searching in the themes kitten 2021-08-07 11:17:32 +05:30
Kovid Goyal
ca1b2454bd Fix position output in matcher 2021-08-07 10:45:50 +05:30
Kovid Goyal
064fc17ce3 More work on themes kitten 2021-08-05 21:38:39 +05:30
Kovid Goyal
43ccf9cb41 Draw theme demo 2021-08-05 13:17:16 +05:30
Kovid Goyal
96857a197c Allow default theme to have no settings 2021-08-05 11:20:01 +05:30
Kovid Goyal
079ff7785c ... 2021-08-05 07:47:32 +05:30
Kovid Goyal
d6a6cbe153 Migrate import in test 2021-08-05 07:05:19 +05:30
Kovid Goyal
2486cfd45d Move match() into a more re-useable location 2021-08-05 06:59:24 +05:30
Kovid Goyal
30cb7286db Fix building on macOS
macOS defines newlocale() in xlocale.h
2021-08-05 06:47:45 +05:30
Kovid Goyal
9e7253c179 macOS: Set LANG to en_US if cocoa reports language as en_* that is not a valid locale
Fixes #3899
2021-08-05 06:29:21 +05:30
Kovid Goyal
276a82d1f7 Make get_all_actions() work in binary builds 2021-08-05 06:10:41 +05:30
Kovid Goyal
57ced9bc83 Dont send press event for shift+middle when grabbed
Fixes #3902
2021-08-05 05:03:22 +05:30
Kovid Goyal
3c3662b032 Limit display length for theme names 2021-08-04 23:18:57 +05:30
Kovid Goyal
f490b9a8bd Better error message for get_all_actions() when docstrings are missing 2021-08-04 22:58:05 +05:30
Kovid Goyal
c7ccedae95 ... 2021-08-04 22:27:48 +05:30
Kovid Goyal
03517459db Type check set_mode and reset_mode 2021-08-04 22:25:27 +05:30
Kovid Goyal
96326280e5 Use a pending update when drawing the screen 2021-08-04 22:06:05 +05:30
Kovid Goyal
9b7899780b Implement drawing the list of themes 2021-08-04 21:56:33 +05:30
Kovid Goyal
e01cd057e8 Fix timestamp not being updated in downloaded zip file comment
Also clean up tab bar formatting
2021-08-04 20:34:00 +05:30
Kovid Goyal
ba85ca1991 Finish the tab bar for the themes kitten 2021-08-04 19:06:07 +05:30
Kovid Goyal
92a9b71f21 More work on the themes kitten 2021-08-04 18:43:26 +05:30
Kovid Goyal
e50c26d1b9 Allow using a non-toal dict to init Options objects 2021-08-04 17:06:50 +05:30
Kovid Goyal
7090c24321 More work on the themes kitten 2021-08-04 14:13:09 +05:30
Kovid Goyal
55319cd6d6 FreeType: Round glyph advances
The old code would simply add advances and store as a float with
individual glyph positioning using floor() based on the advance +
offset. This breaks rendering of infinite length ligatures at some font
sizes as they either under or overflow. Rounding the advances seems to
fix it. Dont know if it will have other ill-effects for non infinite
length ligatures. If it does we can test total ligature length and
use rounding only for long ligatures.

Fixes #3896
2021-08-04 08:40:49 +05:30
Kovid Goyal
8a6b51441c More work on themes kitten 2021-08-04 07:36:09 +05:30
Kovid Goyal
36670b49a0 Make creation of kitty-themes.zip atomic 2021-08-03 17:47:47 +05:30
Kovid Goyal
a402d848d2 Work on themes kitten UI 2021-08-03 17:32:15 +05:30
Kovid Goyal
37c563802c typo 2021-08-03 12:58:38 +05:30
Kovid Goyal
2d7032973c Change the semantics of --title slightly
Now it no longer overrides the titles of windows/tabs created in the
session. This allows windows/tabs to have their own titles while fixing
the OS Window's title.
2021-08-03 09:51:53 +05:30
Kovid Goyal
70b5f5bce3 Fix kitty --title not overriding tab titles
It must set the OS Window title permanently.

Fixes #3893
2021-08-03 09:34:13 +05:30
Kovid Goyal
be34af4555 Remove inline from .c files
It is ignored by compilers and hides unused static functions
2021-08-03 09:11:17 +05:30
Kovid Goyal
815539a933 Clean up the docs for tab_bar_style 2021-08-03 08:52:19 +05:30
Kovid Goyal
ab889e2945 A new "slant" style for the tab bar 2021-08-03 08:45:55 +05:30
Kovid Goyal
b3231c8003 Fix a link in the conf docs 2021-08-02 21:58:39 +05:30
Kovid Goyal
5f6cb34f77 placeholder 2021-08-02 21:54:06 +05:30
Kovid Goyal
a99a080c50 More work on theme loading 2021-08-02 21:46:33 +05:30
Kovid Goyal
4a1ca8d582 Move theme parser into kitty code 2021-08-02 18:54:48 +05:30
Kovid Goyal
050eb5660d Start work on themes kitten 2021-08-02 17:56:31 +05:30
Kovid Goyal
13e59df1f8 version 0.22.2 2021-08-02 08:20:33 +05:30
Kovid Goyal
c797944923 Also set first underviced render frame request 2021-08-01 12:59:22 +05:30
Kovid Goyal
ade4e67b51 Possible fix for #3890
Try to ensure we have a functioning displaylink always.
GLFW skips over sleeping monitors during a poll and also
had a bug where the display link was not re-created for a monitor
that already had a glfw monitor entry.

Also add a bunch more debug reporting
2021-08-01 12:53:35 +05:30
Kovid Goyal
656f49f2ff ... 2021-08-01 07:56:55 +05:30
Kovid Goyal
0045244295 All option instances must not share the same color table 2021-07-31 18:44:39 +05:30
Kovid Goyal
6bfb704f6f When going from csd->no csd increase window height to compensate for titlebar.
Sway will send the next configure event (for example when focus changes)
with titlebar height added, so to avoid a sudden resize at that time,
bump the height by the titlebar.
2021-07-31 14:56:45 +05:30
Kovid Goyal
80cebdefcd Better fix for CSD toggling on Wayland
Draw CSD if the compositor wants us to. See #3888
2021-07-31 14:15:38 +05:30
Kovid Goyal
68cd863fe0 version 0.22.1 2021-07-31 12:03:42 +05:30
Kovid Goyal
65e5015d19 Allow linking to discussions in docs 2021-07-31 11:51:03 +05:30
Kovid Goyal
c26665ec4d Wayland: If the compositor turns off server side decorations after turning them on do not draw client side decorations
This matches the behavior of GNOME based clients and in any case sway
seems to get very confused if CSD is drawn.

Fixes #3888
2021-07-31 11:41:27 +05:30
Kovid Goyal
91d82ebf4b Remove unused import 2021-07-31 11:27:29 +05:30
Kovid Goyal
303e4baa58 Add GLFW API to set WM_COMMAND
Also have create_os_window take keyword arguments
2021-07-30 08:35:40 +05:30
Kovid Goyal
3c953d47ca Merge branch 'pr-fix-nix' of https://github.com/egnor/kitty 2021-07-29 14:23:08 +05:30
Kovid Goyal
5e629d5c09 Linux binary: Remove any RPATH build artifacts from bundled libraries
Thanks to Dan Egnor for pointing these out.
2021-07-29 13:12:49 +05:30
Kovid Goyal
c6ec2d4282 Update docs to reflect the fact that the shell is run with both --login and --interactive to read its env vars 2021-07-29 12:40:19 +05:30
Kovid Goyal
66b93a9af8 Merge branch 'pr-doc-editor-fix' of https://github.com/egnor/kitty 2021-07-29 12:24:17 +05:30
egnor
8d5479f55e minor tweaks to wording and formatting 2021-07-28 23:50:11 -07:00
egnor
96ce6c9504 Resolve some duplication in glossary.rst 2021-07-28 23:47:55 -07:00
egnor
0d55865545 more accurately describe editor behavior 2021-07-28 23:44:09 -07:00
Kovid Goyal
a1fc383e6f Cleanup the previous PR 2021-07-29 11:52:14 +05:30
Kovid Goyal
c3807e175d Merge branch 'pr-doc-editor' of https://github.com/egnor/kitty 2021-07-29 11:48:34 +05:30
Kovid Goyal
6f83f76d41 Make reading shell environment a bit more robust
Now ensure that --login flag is not duplicated. Also
run the shell in --interactive as well as --login mode.
2021-07-29 11:12:09 +05:30
egnor
9a56d619af clarify the text for the "editor" config variable slightly 2021-07-28 22:18:03 -07:00
Kovid Goyal
f692d586f7 Fix type checking in send_text 2021-07-29 09:04:07 +05:30
Kovid Goyal
d3d3e99979 broadcast kitten: Fix decoding of key events
No clue why mypy didnt catch this error
2021-07-29 08:55:34 +05:30
egnor
8e6a179efe fix shell.nix error with stdenv.lib.getLib 2021-07-28 17:16:52 -07:00
Kovid Goyal
17ff317d30 Allow specifying additional targets for detach_window 2021-07-28 21:50:09 +05:30
Kovid Goyal
faef9f0049 ... 2021-07-28 21:27:43 +05:30
Kovid Goyal
bb0c831601 Fix #3878 2021-07-28 18:22:08 +05:30
Kovid Goyal
9462654738 Update changelog 2021-07-28 15:52:54 +05:30
Kovid Goyal
e872169e4c Graphics protocol: Fix composing onto currently displayed frame not updating the frame on the GPU. Fixes #3874 2021-07-28 15:46:50 +05:30
Kovid Goyal
a22404abe6 Better names 2021-07-28 15:44:17 +05:30
Kovid Goyal
7c06313750 A couple more useful aliases 2021-07-28 15:40:48 +05:30
Kovid Goyal
6f265f448d DRYer 2021-07-28 15:39:21 +05:30
Kovid Goyal
acdc41bd03 Allow sending no payload 2021-07-28 13:39:15 +05:30
Kovid Goyal
bcff2a7fb6 Add aliases to GraphicsCommand to make it more useable 2021-07-28 13:28:21 +05:30
Kovid Goyal
94188fddce pep8-ify sample code 2021-07-28 11:13:29 +05:30
Kovid Goyal
3684e7f54a Merge branch 'cocoa-fix-m1' of https://github.com/horta/kitty 2021-07-28 07:45:50 +05:30
Danilo Horta
890181172f Fix "Cocoa: Failed to find service port...". 2021-07-28 00:39:50 +01:00
Kovid Goyal
9c9d68561e When calling the active tab idx setter do not re-record the current tab in the active tab history if the current tab will not actually change. Fixes #3871 2021-07-27 09:12:35 +05:30
Kovid Goyal
1bd39ff935 Use new URL scheme and define the kitty website centrally as much as possible 2021-07-27 09:03:11 +05:30
Kovid Goyal
17f3d2d581 DRYer 2021-07-27 08:44:50 +05:30
Kovid Goyal
55aa9e11db Dont use globals for role mapping 2021-07-27 08:39:04 +05:30
Kovid Goyal
bc895eacc5 Also prevent unknown roles from causing formatting to error 2021-07-27 08:07:11 +05:30
Kovid Goyal
6c8eb4a19a Fix #3869 2021-07-27 08:05:55 +05:30
Kovid Goyal
887347106d version 0.22.0 2021-07-26 13:57:09 +05:30
Kovid Goyal
419cf78984 A new remote control command to resize OS Windows 2021-07-25 22:57:00 +05:30
Kovid Goyal
aa339a8a9f Expose parameter in boss.py as well 2021-07-25 13:59:36 +05:30
Kovid Goyal
a2f7aedd9c Allow specifying which os window to toggle 2021-07-25 13:58:03 +05:30
Kovid Goyal
630379651e Use union instead of define for graphics commands aliases 2021-07-25 13:14:52 +05:30
Kovid Goyal
3d9b52fbc2 Functions to get and set OS Window size 2021-07-25 12:58:58 +05:30
Kovid Goyal
2e01c1f37e Wayland: Inform compositor of new window geometry when setting window size 2021-07-25 12:26:09 +05:30
Kovid Goyal
174abb352c Fix broken link 2021-07-24 08:29:25 +05:30
Kovid Goyal
85e028cab1 Add links to kitten source code 2021-07-24 08:15:52 +05:30
Kovid Goyal
ff191c9404 clipboard kitten: fix copies to clipboard not working without the --wait-for-completion option 2021-07-24 07:55:50 +05:30
Kovid Goyal
31da01d4df Add clipboard_control to query_terminal 2021-07-24 07:26:12 +05:30
Kovid Goyal
6d45a94125 Always ignore truncated OSC 52 2021-07-24 07:19:58 +05:30
Kovid Goyal
e7bfb04047 Fix mouse actions not working when caps lock or num lock are engaged
Fixes #3859
2021-07-24 07:06:46 +05:30
Kovid Goyal
b9033d721c print KeyPress on a new line 2021-07-24 07:02:52 +05:30
Kovid Goyal
41c0343d33 macOS: Fix automatic detection of bold/italic faces for fonts that use the family name as the full face name of the regular font not working
Fixes #3861
2021-07-23 23:06:42 +05:30
Kovid Goyal
aa8156a7fd Remove mentions of no-append 2021-07-23 22:28:34 +05:30
Kovid Goyal
e48adf7a07 Allow leading/trailing spaces in tab_activity_symbol 2021-07-23 22:26:10 +05:30
Kovid Goyal
8f214c51c0 Get rid of kitty's special OSC 52 protocol
A better solution from an ecosystem perspective is to just work with the
original protocol. I have modified kitty's escape parser to special case
OSC 52 handling without changing its max escape code size.

Basically, it works by splitting up OSC 52 escape codes longer than the
max size into a series of partial OSC 52 escape codes. These get
dispatched to the UI layer where it accumulates them upto the 8MB limit
and then sends to clipboard when the partial sequence ends.

See https://github.com/ranger/ranger/issues/1861
2021-07-23 22:18:02 +05:30
Kovid Goyal
096c4c78c7 Fix #3856 2021-07-23 08:13:47 +05:30
Kovid Goyal
257fce5a1b Merge branch 'dankamongmen/triangle-wrangle' of https://github.com/dankamongmen/kitty 2021-07-23 08:09:25 +05:30
nick black
182bc7b8f9 U+1fb3f: upper middle left to lower right 🭊🬿 2021-07-22 18:21:57 -04:00
Kovid Goyal
3c35999246 Fix code scanning warning 2021-07-22 22:08:55 +05:30
Kovid Goyal
340159b591 Graphics protocol: Support for frame composition
Fixes #3809
2021-07-22 18:58:59 +05:30
Kovid Goyal
075fb2eaf2 DRYer 2021-07-22 17:56:21 +05:30
Kovid Goyal
21a2768ec3 ... 2021-07-22 17:31:54 +05:30
Kovid Goyal
554c840d4e ssh kitten: exit with 255 for unknown arg to match ssh 2021-07-22 17:30:07 +05:30
Kovid Goyal
9c28a1ba31 ssh kitten: handle -- 2021-07-22 17:03:47 +05:30
Kovid Goyal
13fc921fa5 Dont hardcode the ignore path for sphinx-autobuild 2021-07-22 11:03:13 +05:30
Kovid Goyal
61f5d3972f Dont use scrollIntoView as it causes the main content to scroll as well 2021-07-21 16:39:57 +05:30
Kovid Goyal
5027bc743b Mark sidebar toc entry corresponding to current hash
Also scroll it to the top on initial page load
2021-07-21 14:41:01 +05:30
Kovid Goyal
9b8085220f ... 2021-07-21 14:16:53 +05:30
Kovid Goyal
54c04301cc Use html_css_files instead of add_css_file 2021-07-21 13:12:32 +05:30
Kovid Goyal
cfd3bc823c ... 2021-07-21 12:36:55 +05:30
Kovid Goyal
329d95fd3a Include all in page headings in the sidebar ToC
The furo theme tries to make this impossible, fortunately,
this being python, we dont care what it wants
2021-07-21 10:35:58 +05:30
Kovid Goyal
8dfef58f29 Use a glfw specific name for memfd_create 2021-07-20 21:49:11 +05:30
Kovid Goyal
eeb4d3fe55 Dont show individual tools in the page toc 2021-07-20 14:39:52 +05:30
Kovid Goyal
c6da4576b6 ... 2021-07-20 14:37:31 +05:30
Kovid Goyal
2417122ed3 Make the integration tools link targets 2021-07-20 14:28:44 +05:30
Kovid Goyal
e6c17e19d7 Turn on nitpicky in makefile rather than conf.py 2021-07-20 13:57:58 +05:30
Kovid Goyal
d98c2f89aa When redirecting preserve anchors 2021-07-20 13:51:50 +05:30
Kovid Goyal
624991b9b7 Use the builtin envvar role for env vars
Also fix some broken links
2021-07-20 13:29:39 +05:30
Kovid Goyal
c7ee776349 ... 2021-07-20 13:21:45 +05:30
Kovid Goyal
ffeacef394 Document the various env vars kitty uses/sets 2021-07-20 13:19:23 +05:30
Kovid Goyal
f4ebec6759 The graphics protocol spec should link to POSIX not the linux man page 2021-07-20 09:51:15 +05:30
Kovid Goyal
93e3e4d2b1 Also strip \r from marked text 2021-07-19 18:12:29 +05:30
Kovid Goyal
3633049ba5 Forgot to include \r in the url regex 2021-07-19 18:09:00 +05:30
Kovid Goyal
c566ed4643 hints kitten: Detect paths and hashes that appear over multiple lines
Fixes #3845
2021-07-19 17:35:48 +05:30
Kovid Goyal
af956f4d84 Fix debug print for long strings 2021-07-19 16:56:10 +05:30
Kovid Goyal
b70c72fc3b ... 2021-07-19 13:45:20 +05:30
Kovid Goyal
1f35694705 Render ┄ ┅ ┆ ┇ ┈ ┉ ┊ ┋ with spaces at the edges
Matches rendering in most other programs and allows long chains of them to look better

Fixes #3844
2021-07-19 13:42:59 +05:30
Kovid Goyal
d912d96f00 More docs cleanups 2021-07-19 09:08:55 +05:30
Kovid Goyal
94f8fb4a4b Cleanup up some doc formatting 2021-07-19 08:45:56 +05:30
Kovid Goyal
103744e2ca Note the changed docs build requirements 2021-07-19 08:32:39 +05:30
Kovid Goyal
fe18a5de92 Use a shorter title 2021-07-18 22:19:47 +05:30
Kovid Goyal
9b0394860d typo 2021-07-18 19:56:06 +05:30
Kovid Goyal
380c7628d8 Use tabs for C/Python code samples 2021-07-18 13:43:26 +05:30
Kovid Goyal
f787a377c3 A new theme for the kitty website
Supports dark mode. Also re-organize the documentation
a bit, making it more hierarchical.

Have a nicer landing page
2021-07-18 13:29:33 +05:30
Kovid Goyal
7c1b819728 Use nicer URLs without .html suffix on website
Also easier insertion of analytics tag for the website without
needing a custom template.

The old .html URLs are redirected via meta http-equiv refresh, which is
all gh-pages supports
2021-07-17 21:25:29 +05:30
Kovid Goyal
8e5175e56b Revert "icat: Use scandir for slightly better performance"
This reverts commit 2e893690bd.
scandir is not recursive
2021-07-17 09:51:06 +05:30
Kovid Goyal
9e9d1a4e96 Add a glossary to define some commonly used terms in kitty 2021-07-17 06:36:56 +05:30
Kovid Goyal
fd475423cf Fix reference to option in changelog docs 2021-07-17 06:30:48 +05:30
Kovid Goyal
070911d458 Wayland: Fix initial_window_size in cells on scale != 1 screens
Fixes #3834
2021-07-17 06:04:56 +05:30
Kovid Goyal
3b585e6dbb Fix #3840 2021-07-17 05:46:08 +05:30
Kovid Goyal
2e893690bd icat: Use scandir for slightly better performance 2021-07-16 21:55:15 +05:30
Kovid Goyal
d052b020fa Check for dirs when getting mimetypes in a couple more places 2021-07-16 21:49:02 +05:30
Kovid Goyal
ac6224563b Cleanup previous PR 2021-07-16 21:43:56 +05:30
Kovid Goyal
a9630890fd Merge branch 'folder-mime' of https://github.com/william-gooch/kitty 2021-07-16 21:40:14 +05:30
Kovid Goyal
4b889750db Add a new variable `{num_window_groups}` for tab_title_template
See #3837
2021-07-16 19:25:24 +05:30
William Gooch
308bd0d81d Directories should have mime-type inode/directory. 2021-07-16 13:40:00 +01:00
Kovid Goyal
d55a86e39b Cleanup icdir creation 2021-07-13 08:00:15 +05:30
Kovid Goyal
0c193c3ab7 Merge branch 'add-icons' of https://github.com/Artturin/kitty 2021-07-13 07:57:27 +05:30
Artturin
6f513f5706 linux: install a scalable icon 2021-07-13 05:10:15 +03:00
Kovid Goyal
368bc91eed macOS: Render colors in the sRGB colorspace to match other macOS terminal applications
Fixes #2249
2021-07-12 17:34:03 +05:30
Kovid Goyal
3a322c5c6e Fix warning from sphinx 2021-07-12 13:22:39 +05:30
Kovid Goyal
c5ee044343 Merge branch 'patch-1' of https://github.com/con-f-use/kitty 2021-07-12 13:21:08 +05:30
con-f-use
19b918e56f mention kitten_alias in hits documentation
No idea if I correctly referenced this url: https://sw.kovidgoyal.net/kitty/conf.html#opt-kitty.kitten_alias
2021-07-12 07:48:34 +02:00
Kovid Goyal
cf5ed54c84 Dont add formatting escape codes to completion descriptions in ZSH
ZSH gets confused by them, causes the text to move up a line when
completing after the first line
2021-07-11 21:46:17 +05:30
Kovid Goyal
b813e1f7ab ... 2021-07-11 21:39:54 +05:30
Kovid Goyal
cdd8e52116 DRYer 2021-07-11 21:39:08 +05:30
Kovid Goyal
6945eb4186 Better complete debug function 2021-07-11 21:33:19 +05:30
Kovid Goyal
1d9626d493 Graphics protocol: Fix image without placements being deleted when screen scrolls 2021-07-10 14:05:53 +05:30
Kovid Goyal
75b73f6821 Allow using neighboring window operations in the stack layout 2021-07-09 08:54:22 +05:30
Kovid Goyal
f62f94381e also forgot to list the a=a key 2021-07-08 09:17:42 +05:30
Kovid Goyal
cd6b3da665 Fix turning off cursor blink via escape codes not working
Also fix cursor blink stopping after terminal reset. The default cursor
state should be blinking.

Fixes #3808

...
2021-07-07 20:45:46 +05:30
Kovid Goyal
25fb5d0ee6 Forgot to list the f key for a 2021-07-07 18:26:06 +05:30
Kovid Goyal
65b2ca8f57 Fix a typo that broke addition of default mouse mappings in gen-config
Also update options/types.py with new action name
2021-07-07 18:06:39 +05:30
Kovid Goyal
1ec07eb17a diff kitten: Remove limit on max line length of 4096 characters
Fixes #3806
2021-07-07 07:27:42 +05:30
Kovid Goyal
46fbf78da5 Fix #3804 2021-07-06 15:34:02 +05:30
Kovid Goyal
cea8d4a87d ... 2021-07-06 09:05:50 +05:30
Kovid Goyal
e07ba2c53d Dont move back glyph on overflow in infinite ligatures 2021-07-05 14:47:01 +05:30
Kovid Goyal
0af3f102aa ... 2021-07-05 14:38:07 +05:30
Kovid Goyal
a5b293401d Add an action to restore move-end behavior when extending selections 2021-07-04 19:02:33 +05:30
Kovid Goyal
05d0bda044 Allow selecting blanks at the start of the top line 2021-07-04 18:49:17 +05:30
Kovid Goyal
3dee3aba59 Fix #3794 2021-07-04 18:05:54 +05:30
Kovid Goyal
e732df46b8 Have right clicking to extend selection operate on the nearest selection boundary instead of the selection end. This matches both vim and xterm 2021-07-04 18:00:41 +05:30
Kovid Goyal
86a8b231f4 ... 2021-07-04 07:15:15 +05:30
Kovid Goyal
10d359c222 Better error message for application escape mode
tmux apparently uses it
2021-07-03 12:24:51 +05:30
Kovid Goyal
1ef895e246 When dumping commands dump stop_pending_mode at the correct place 2021-07-03 12:07:46 +05:30
Kovid Goyal
38ae370202 Fix #3789 2021-07-03 10:12:44 +05:30
Kovid Goyal
610a09817f Fix incorrect Sync terminfo entry 2021-07-03 09:18:33 +05:30
Kovid Goyal
c6938c9039 Add some missed actions 2021-07-02 21:43:18 +05:30
Kovid Goyal
7a8fb8f430 Merge branch 'dankamongmen/the-vs-then' of https://github.com/dankamongmen/kitty 2021-07-01 20:17:03 +05:30
nick black
3495591c5f [trivial] s/the/then/ 2021-07-01 10:34:43 -04:00
Kovid Goyal
050c31094b toggle_layout action to zoom/unzoom active window 2021-07-01 17:57:00 +05:30
Kovid Goyal
6a4668974b Forgot to mark layout actions 2021-07-01 17:38:26 +05:30
Kovid Goyal
026d200add Fix a bug in the implementation of the synchronized updates escape code that could cause incorrect parsing if either the pending buffer capacity or the pending timeout were exceeded
Fixes #3779
2021-07-01 15:32:53 +05:30
Kovid Goyal
fe991ee767 DRYer 2021-07-01 08:53:11 +05:30
Kovid Goyal
b2a219f9d8 Add the Sync non-standard capability for synchronized updates to terminfo
Since the geniuses at terminal-wg are trying their best to create chaos
by retroactively changing the escape code used for this feature, it is
good to have a property for it in terminfo. Since tmux already uses Sync
for it, follow that in kitty's terminfo.
2021-07-01 08:48:59 +05:30
Kovid Goyal
64810e0e0b Add some missing blank lines before code blocks 2021-07-01 07:22:49 +05:30
Kovid Goyal
6e5ed38b76 Add syntax highlighting for mouse_map 2021-06-30 15:56:03 +05:30
Kovid Goyal
8d308ef2b8 Add a ref to vim-kitty for syntax highlighting kitty.conf 2021-06-30 15:50:43 +05:30
Kovid Goyal
ab76ae3778 Dont set the filetype in the default config file modeline
This enables people using custom syntax highlighting such as
https://github.com/fladson/vim-kitty
2021-06-30 15:36:33 +05:30
Kovid Goyal
222055fcff Add link to detailed cp buffers docs 2021-06-30 15:15:41 +05:30
Kovid Goyal
247d700c30 Fix docs build failure 2021-06-30 15:12:46 +05:30
Kovid Goyal
cf41d56c00 Clean docstrings when generating actions docs 2021-06-30 15:06:12 +05:30
Kovid Goyal
a8f7b1eb92 Disable text justification in website
Looks really bad in many places as there are quite a few non-breakbale
phrases.
2021-06-30 15:03:06 +05:30
Kovid Goyal
90d3ce4162 make target to publish website 2021-06-30 15:01:25 +05:30
Kovid Goyal
bc66b7f16e Fix a bunch of broken links 2021-06-30 14:59:54 +05:30
Kovid Goyal
606708a96e Cross reference builtin shortcuts from actions 2021-06-30 14:52:47 +05:30
Kovid Goyal
2ec0d94c31 Document all mappable actions 2021-06-30 14:33:28 +05:30
Kovid Goyal
e6a17f78b6 Use the main VT parser in pending mode as well
Should get much closer semantics in the two cases and its nice not to
have an extra mini VT parser for pending mode. There is a performance
hit in pending mode, since now the pending mode bytes are round tripped
via utf-8 decoding/encoding, but its worth it for the code
simplification.
2021-06-30 10:52:22 +05:30
Kovid Goyal
d6b6d3f59f Make dispatch_unicode_char re-useable 2021-06-30 08:29:40 +05:30
Kovid Goyal
5932ddb0fe DRYer 2021-06-30 07:57:21 +05:30
Kovid Goyal
d1e5c2f86f ... 2021-06-29 22:31:23 +05:30
Kovid Goyal
1f2f25f7a3 Mark the mouse actions 2021-06-29 22:27:31 +05:30
Kovid Goyal
b0edbf2857 Mark more actions 2021-06-29 22:21:01 +05:30
Kovid Goyal
91f0da9dcd Document actions in the tab object 2021-06-29 20:12:39 +05:30
Kovid Goyal
3d5d60bc5b ... 2021-06-29 16:37:29 +05:30
Kovid Goyal
5c5599592a abort CSI parsing on NUL or DEL 2021-06-29 12:37:34 +05:30
Kovid Goyal
c60d09f3b2 Mark combine as an action 2021-06-29 12:28:44 +05:30
Kovid Goyal
5768c54c5b Add support for pending mode via SM/RM 2026
Because, why the hell not, it's not like I have an actual life.
More seriously, terminal-wg (aka Bikeshedder's Anonymous) is
pushing for it so it's likely at least one poor application writer
will fall for their propaganda.
2021-06-29 12:24:34 +05:30
Kovid Goyal
6d413e2492 Start documenting mappable actions 2021-06-28 21:44:52 +05:30
Kovid Goyal
331675d413 Fix ResourceWarning 2021-06-28 20:40:10 +05:30
Kovid Goyal
2105940286 Better error message for +launch 2021-06-28 19:38:51 +05:30
Kovid Goyal
90164dfee7 make clean should not clean bypy build artifacts 2021-06-28 06:39:12 +05:30
Kovid Goyal
73f641cb66 version 0.21.2 2021-06-28 06:22:35 +05:30
Kovid Goyal
3d51835b9b Avoid unneccessary mallocs and copying when return code points for word 2021-06-28 05:56:49 +05:30
Kovid Goyal
f358d76409 Fix type sig 2021-06-28 05:51:49 +05:30
Kovid Goyal
ce486e9244 Move the if condition out of the inner loops 2021-06-27 21:09:06 +05:30
Kovid Goyal
691b7215a0 Unicode input kitten: Fix searching when a word has more than 1024 matches
Fixes #3773
2021-06-27 21:04:43 +05:30
Kovid Goyal
5be45d0ff2 Turn on all warnings when running test suite 2021-06-26 12:55:53 +05:30
Kovid Goyal
8a4b326127 Finish completion for ssh kitten
Fixes #3760
2021-06-26 12:28:12 +05:30
Kovid Goyal
051374cd55 Add support for comma separated completions 2021-06-26 10:52:14 +05:30
Kovid Goyal
71cd92da29 Store match group properties on the match group object 2021-06-26 09:47:21 +05:30
Kovid Goyal
c2d3a0c8b4 Completion for choice args 2021-06-26 09:18:36 +05:30
Kovid Goyal
fe8b151666 Complete option 2021-06-25 22:53:55 +05:30
Kovid Goyal
9e2d67f7a1 Show option descriptions when completing in ZSH 2021-06-25 19:13:16 +05:30
Kovid Goyal
23ea3745ca Make zsh completion headings bold 2021-06-25 18:05:18 +05:30
Kovid Goyal
d8d5a8fada More work on completion for the SSH kitten 2021-06-25 17:50:08 +05:30
Kovid Goyal
21ce0e90bf Code to get list of known host names 2021-06-25 15:04:17 +05:30
Kovid Goyal
ec420b8012 Start work on completion for ssh kitten 2021-06-25 15:04:17 +05:30
Kovid Goyal
bd67899943 Allow using super and sub scripts in tab titles
The syntax is

{sup.whatever}

works by translating enhlish letters/number to their unicode
equivalents.

Fixes #3763
2021-06-25 15:02:43 +05:30
Kovid Goyal
4b7600f3a5 Nicer error message on unknown entry point 2021-06-25 10:25:54 +05:30
Kovid Goyal
5eabd69659 ... 2021-06-25 08:03:20 +05:30
Kovid Goyal
e83be21756 Add a note about completions for the SSH kitten 2021-06-25 08:02:28 +05:30
Kovid Goyal
13c58536be Cleanup previous PR and add changelog entry 2021-06-24 21:27:15 +05:30
Kovid Goyal
512dccdbfa Merge branch 'ripgrep-context' of https://github.com/allemangD/kitty 2021-06-24 21:25:11 +05:30
David Allemang
bb3a8453e0 Make hyperlinked_grep kitten respect context
Fix regex so that context lines (from -C option) are still hyperlinked.

Also add a case so that any non-matching lines are still output raw.
2021-06-24 11:04:35 -04:00
Kovid Goyal
e337fcaadc query terminal kitten: Allow querying font face and size information
Fixes #3756
2021-06-24 13:31:50 +05:30
Kovid Goyal
890a149a5d Move generation of query responses into the query classes 2021-06-24 12:31:17 +05:30
Kovid Goyal
5b3ac259ce Fix a resource warning 2021-06-24 11:27:02 +05:30
Kovid Goyal
ce50043048 Add an issue reference to the changelog 2021-06-23 14:16:41 +05:30
Kovid Goyal
ebfbf6082f ... 2021-06-21 21:23:29 +05:30
Kovid Goyal
b44bec2207 Move processing of coca_pending_actions() into its own function
Makes process_global_state less crowded and easier to grok
2021-06-21 21:03:41 +05:30
Kovid Goyal
576ce21fc8 macOS: Fix shortcuts in the global menu bar responding slowly when cursor blink is disabled/timed out
The event loop needed to be forced to tick over immediately otherwise
the changes were not being rendered till some other event such as mouse
motion or key release was not delivered.

Fixes #3693
2021-06-21 20:58:44 +05:30
Kovid Goyal
2ba015d0be Add an issue reference to the changelog
Fixes #3405
2021-06-21 16:46:49 +05:30
Kovid Goyal
98ae2ac96a ssh kitten: Use sh rather than /bin/sh
It's not actually required that sh be in /bin.  The hope is that fewer
users alias sh to non POSIX things than put sh in places other than /bin
2021-06-21 16:43:59 +05:30
Kovid Goyal
1c25ed7666 ssh kitten: Fix "Connection closed" message being printed by ssh when running remote commands
Don't force allocate a tty when running remote commands. This
matches ssh behavior as well.
2021-06-21 16:40:07 +05:30
Kovid Goyal
fd4c7a4ed2 ssh kitten: Support system where the login shell is a non-POSIX shell
Now the kitten passes its script to /bin/sh and detects the login shell
using various strategies based on the value of $USER on the remote
machine. The strategies are tried one after another till one succeeds:

1) getent passwd $USER
2) id -P
3) python pwd module
4) parsing /etc/passwd

The hope is that these strategies will fail on fewer systems than
relying on the login shell being POSIX compliant.
2021-06-21 16:30:49 +05:30
Kovid Goyal
32d275c138 Document how to use the new config framework with external kittens 2021-06-21 05:31:17 +05:30
Kovid Goyal
f8924286ce gen-config for third party kittens 2021-06-21 05:11:46 +05:30
Kovid Goyal
6e77345263 Ensure sys.path is preserved even if there are errors importing a custom kitten 2021-06-21 04:35:10 +05:30
Kovid Goyal
1438c64b9e Move the config generation code into kitty proper 2021-06-21 04:25:04 +05:30
Kovid Goyal
2ff1256aef mouse_discard_event -> discard_event 2021-06-21 04:01:45 +05:30
Kovid Goyal
5d169854c4 Merge branch 'typo' of https://github.com/Luflosi/kitty 2021-06-18 20:21:08 +05:30
Luflosi
e61d328cb0 Fix typo in changelog 2021-06-18 16:36:27 +02:00
Kovid Goyal
0c196888fb Clarify meaning of grabbed/ungrabbed a bit more 2021-06-18 17:56:21 +05:30
Kovid Goyal
85efed8308 Fix #3743 2021-06-18 17:54:13 +05:30
Kovid Goyal
857c88a951 Add a note to the keyboard protocol elucidating the use of separate main and alternate screen mode stacks in more detail 2021-06-18 09:58:19 +05:30
Kovid Goyal
74b0a7f6f8 Make it clearer that there are separate keyboard mode stacks for main and alternate screens 2021-06-18 09:41:35 +05:30
Kovid Goyal
5da5d00aec text typos 2021-06-18 08:20:32 +05:30
Kovid Goyal
eb59fae9b0 ... 2021-06-18 08:20:04 +05:30
Kovid Goyal
b6b38d6f44 Linux: Fix emoji/bitmapped fonts not useable in symbol_map 2021-06-18 08:01:23 +05:30
Kovid Goyal
4f4d9e0ae3 ... 2021-06-17 21:34:26 +05:30
Kovid Goyal
43c1776594 Handle systems that use less -F as pagers
Fix #3740
2021-06-17 21:33:26 +05:30
Kovid Goyal
397638998b Dont use static memory for the list of chars options
Saves a couple of KB of RAM and is more flexible in terms
of max number of allowed chars, although for large numbers one really
needs a hash for fast lookups.
2021-06-17 13:27:11 +05:30
Kovid Goyal
6ddbda00df Clean up url excluded chars PR 2021-06-17 13:11:23 +05:30
Kovid Goyal
df0bf74bfe Merge branch 'url_excluded_characters' of https://github.com/rbutoi/kitty 2021-06-17 13:01:31 +05:30
Radu Butoi
5ee0651f56 Add url_excluded_characters option to exclude characters from URLs.
This option, like select_by_word_characters, is a set of characters, but
for which to *exclude* from URL parsing. See
https://github.com/kovidgoyal/kitty/issues/3688#issuecomment-862711148.
2021-06-17 01:55:21 -04:00
Kovid Goyal
9ec1c28b35 Merge branch 'cleanup-adjust-baseline' of https://github.com/ytang/kitty 2021-06-16 21:24:59 +05:30
Yang Tang
bfdbf06731 Remove redundant code 2021-06-16 11:44:27 -04:00
Kovid Goyal
ca58b30c47 Fix compiler warning 2021-06-16 20:51:47 +05:30
Kovid Goyal
0fb2f383ac Clean up the baseline adjustment PR 2021-06-16 20:39:00 +05:30
Kovid Goyal
5d0eb1d330 Merge branch 'adjust-baseline' of https://github.com/ytang/kitty 2021-06-16 20:04:15 +05:30
Kovid Goyal
ee77144e2b Make the sample script a little nicer 2021-06-16 18:51:21 +05:30
Kovid Goyal
9d3a2cc219 Fix space based ligatures not rendering correctly
The new infinite ligature cache needed to be keyed by total number of
cells as well as total number of glyphs, otherwise a space based
ligature which is the same glyph rendered in different numbers of cells
wold render incorrectly when present in multiple forms. Fixes #3729
2021-06-16 18:41:01 +05:30
Yang Tang
e964ac86d5 Allow specifying adjust_baseline as either pixels or percentage 2021-06-16 01:11:51 -04:00
Yang Tang
bb26b3d549 Add option adjust_baseline to adjust the baseline position on macOS 2021-06-15 14:52:43 -04:00
Kovid Goyal
71c8d82c33 Merge branch 'doc-harfbuzz' of https://github.com/The-Compiler/kitty 2021-06-15 21:52:39 +05:30
Florian Bruhin
9fffe0d710 doc: Link to harfbuzz font feature format 2021-06-15 17:36:12 +02:00
Kovid Goyal
51f8b22dfa macOS: Fix middle-click to paste from clipboard not working
Fixes #3730
2021-06-15 13:45:50 +05:30
Kovid Goyal
63a36a1054 Add Smulx to terminfo
A couple of other terminals use it for styled underlines, in
contravention of the spec. But, in the interests of wider
interoperability add it to kitty as well.

Fixes #3725
2021-06-14 11:58:52 +05:30
Kovid Goyal
057084a708 Add support for XTVERSION version reporting escape code 2021-06-14 10:20:50 +05:30
Kovid Goyal
79b130ed23 version 0.21.1 2021-06-14 07:47:32 +05:30
Kovid Goyal
75e8b16ea3 Dont limit the number of possible cocoa pending actions to the number of bits in an int 2021-06-14 07:34:28 +05:30
Kovid Goyal
1b35708d89 macOS: Fix a crash when rendering ligatures larger than 128 characters
Fixes #3724
2021-06-14 07:15:52 +05:30
Kovid Goyal
ebff343a55 macOS: Add reload config to kitty global menu 2021-06-13 20:34:27 +05:30
Kovid Goyal
c7b91e5f19 Cocoa grabs control+function key presses so use dedicated cmd based shortcuts for those on macOS 2021-06-13 18:20:14 +05:30
Kovid Goyal
b9d52dfaf7 Update Changelog 2021-06-13 10:01:38 +05:30
Kovid Goyal
2c8f66586f macOS: Fix a regression in the previous release that broke rendering of strikeout
The new cell height code forgot to adjust strikeout position.
Fixes #3717
2021-06-13 09:29:30 +05:30
Kovid Goyal
219bf564f7 Fix #3719 2021-06-13 09:07:08 +05:30
Kovid Goyal
291be6f5a6 Silence incorrect compiler warning on older gcc 2021-06-12 13:15:05 +05:30
Kovid Goyal
1da2344aa3 Fix a possible crash when handling mouse clicks 2021-06-12 13:03:47 +05:30
Kovid Goyal
750cf7ad20 version 0.21.0 2021-06-12 08:41:37 +05:30
Kovid Goyal
962acd1537 ssh kitten: Fix non-standard properties in terminfo such as the ones used for true color not being copied 2021-06-12 07:27:14 +05:30
Kovid Goyal
7a44765860 Remove unused pyc files from frozen bundles 2021-06-11 12:46:12 +05:30
Kovid Goyal
007be8e52c Add a note about matching source to binary versions 2021-06-11 09:14:05 +05:30
Kovid Goyal
5e4c98eae6 Remote control: Allow matching tabs by index number in currently active OS Window
Fixes #3708
2021-06-11 09:12:08 +05:30
Kovid Goyal
858a6dc27e Document KITTY_DEVELOP_FROM 2021-06-11 08:59:55 +05:30
Kovid Goyal
ad5d14c672 Fix #3703 2021-06-10 16:53:27 +05:30
Kovid Goyal
199685a25b Graphics protocol: Add support for shared memory on Windows 2021-06-10 12:44:50 +05:30
Kovid Goyal
d99e243f57 Respect --ignore-compiler-warnings when building the launcher 2021-06-10 07:48:52 +05:30
Kovid Goyal
64f1211cf8 Fix example in FAQ
Mapping wont work in kitty keyboard mode.
2021-06-09 20:46:36 +05:30
Kovid Goyal
9432f86e43 Remove no longer needed type: ignore
Looks like the type signature for runpy.run_path has finally been fixed
2021-06-09 08:30:22 +05:30
Kovid Goyal
fc99d4d757 Specify the type of files to make mypy happy (I hope) 2021-06-09 08:24:36 +05:30
Kovid Goyal
7fb2b21a22 Also needs types for docutils 2021-06-09 08:18:04 +05:30
Kovid Goyal
260b300da9 Now mypy wants types for requests installed 2021-06-09 08:14:02 +05:30
Kovid Goyal
f26d5b02cb ... 2021-06-09 08:01:46 +05:30
Kovid Goyal
c9ff061feb Merge branch 'leiserfg-doc-patch' of https://github.com/leiserfg/kitty 2021-06-08 08:11:51 +05:30
Leiser Fernández Gallo
86ad318e6c Fix Iosevka version in the docs
Iosevka with kitty support is already out, just waiting for kitty to be released too 🎉
2021-06-07 17:36:40 +02:00
Kovid Goyal
df05339d2a Allow reloading config by sending the SIGUSR1 signal 2021-06-07 20:51:45 +05:30
Kovid Goyal
ec1303a232 Fix some more warnings 2021-06-07 17:30:13 +05:30
Kovid Goyal
c1049734e6 Simpler implementation of scroll and clear screen 2021-06-07 17:13:39 +05:30
Kovid Goyal
99fa79caaf Fix warning 2021-06-07 17:12:53 +05:30
Kovid Goyal
761062a6d7 Discard press event for ctrl+shift+release open_url mapping as it can causes issues when delivered to the terminal program 2021-06-07 17:00:09 +05:30
Kovid Goyal
11227b3ee1 Fix motivation for ctrl+shift+release mapping 2021-06-07 16:36:39 +05:30
Kovid Goyal
8d63d50aea Sort imports 2021-06-07 15:01:30 +05:30
Kovid Goyal
3360aa6c33 Fix #3695 2021-06-07 14:57:38 +05:30
Kovid Goyal
bfffd98fd4 Add a changelog entry for config reloading
Fixes #1292
2021-06-07 09:38:41 +05:30
Kovid Goyal
9a86184a45 Add a note about binding ctrl+l to scroll and clear instead of just clear 2021-06-07 09:35:08 +05:30
Kovid Goyal
00828cb804 More reloading work for various options 2021-06-07 09:30:15 +05:30
Kovid Goyal
ec31a36fd9 Fix reloading of various settings 2021-06-07 08:27:58 +05:30
Kovid Goyal
9003c76261 Add a shortcut to reload the config file 2021-06-06 18:49:58 +05:30
Kovid Goyal
7148f262c0 Reload for keys, fonts and colors now working 2021-06-06 14:31:22 +05:30
Kovid Goyal
3ab417e291 Start work on config file reloading 2021-06-05 15:29:28 +05:30
Kovid Goyal
4ced7b7657 Missed one reference to --debug-config 2021-06-05 15:12:52 +05:30
Kovid Goyal
ad69143573 Improve config debug output for is_multiple variables 2021-06-05 14:39:43 +05:30
Kovid Goyal
4a71afaf96 Get rid of --debug-config
Instead have a keybind that shows the configuration used
by the currently running kitty instance
2021-06-05 14:27:24 +05:30
Kovid Goyal
a1b87f445b Store the paths from which config data is read on the created options object 2021-06-05 12:55:00 +05:30
Kovid Goyal
33e63f000a Make mouse mapping gen-config order stable 2021-06-05 12:22:54 +05:30
Kovid Goyal
1c8b7955eb Have gen-config output action names as comments 2021-06-05 12:20:43 +05:30
Kovid Goyal
0bade29c25 Fix a gen-config bug that was causing macos shortcuts to be defined on linux as well 2021-06-05 10:14:30 +05:30
Kovid Goyal
4cff3e51cb macOS: Add a global menu entry to reset the terminal 2021-06-05 10:12:44 +05:30
Kovid Goyal
d264c3d91e typo 2021-06-05 10:10:23 +05:30
Kovid Goyal
099fed07e9 Note that set-font-size --all changes configured size 2021-06-05 09:39:10 +05:30
Kovid Goyal
091fec0867 Add tab bar margin height to changelog
Fixes #3685
Fixes #3247
2021-06-05 09:18:52 +05:30
Kovid Goyal
a670268a6b Add blank rects for tab bar padding 2021-06-05 09:16:24 +05:30
Kovid Goyal
caa44b3d4a Position tab bar as per new margin options
Also mouse clicking anywhere in the tab bar margins should be the same
as clicking in the tab bar, for ease of use.
2021-06-05 09:02:01 +05:30
Kovid Goyal
f3977da8f3 Start work on options for tab bar vertical margins
Create the option, now need to implement it.
2021-06-05 09:01:57 +05:30
Kovid Goyal
7dc3184f31 ... 2021-06-04 22:00:15 +05:30
Kovid Goyal
d09c20aa01 Store the global font_size on the opts object where it belongs 2021-06-04 21:51:02 +05:30
Kovid Goyal
81411e6b54 Fix trailing parentheses in URLs not being detected
Also fix URLs starting near the end of the line not being detected.

Fixes #3688
2021-06-04 18:13:36 +05:30
Kovid Goyal
a8d1c73fec API to get text for currently marked URL 2021-06-04 14:35:22 +05:30
Kovid Goyal
1b3742efbb Add a link to Iosevka in the changelog 2021-06-04 12:20:27 +05:30
Kovid Goyal
e01bb09e8c Fix ligatures not working with the Iosevka font
Fixes #297
2021-06-04 12:18:17 +05:30
Kovid Goyal
2c9c0751a4 Speed up import of options.types
The color table attributes are never used in a type checked
environment, only via setattr/gettattr so dont create individual
get/setters for them. Reduaces the import time for this module from 2ms
to 0.7ms

Since attribute access is implemented via __getattr__ there should be no
performance implications for normal attribute access, as __getattr__ is
only called if normal attribute access fails. setattr becomes slightly
slower but that is done very rarely.
2021-06-04 06:01:55 +05:30
Kovid Goyal
e10a7579e8 Remove unreachable code 2021-06-04 05:40:27 +05:30
Kovid Goyal
c52a04c7d3 Use a tuple for clipboard control
Avoids churn in the generated options files as python randomized set
ordering
2021-06-04 05:36:05 +05:30
Kovid Goyal
79dd98b20e Use a more efficient representation of the color table on the Options object 2021-06-03 22:17:37 +05:30
Kovid Goyal
2e71429b03 Auto generate the boilerplate code to convert python opts to c opts 2021-06-03 18:30:13 +05:30
Kovid Goyal
4ab299d0af When reflowing the screen, also reflow the saved cursor position 2021-06-03 15:35:48 +05:30
Kovid Goyal
c60a941d1b Allow rewrap_inner to track multiple positions 2021-06-03 12:29:27 +05:30
Kovid Goyal
e2197c586b Forgot a brace 2021-06-03 12:11:31 +05:30
Kovid Goyal
93e9d3cb5f Fix a crash on exit on macOS
Calling Python API functions is not allowed in atexit handlers.

Fixes #3686
2021-06-03 11:54:55 +05:30
Kovid Goyal
2e7b68bf74 Move python to C converters into their own header 2021-06-01 21:18:39 +05:30
Kovid Goyal
6ffb198e9c DRYer 2021-06-01 21:15:36 +05:30
Kovid Goyal
604458810e Start work on autogenerating opts to c conversion boilerplate 2021-06-01 13:33:19 +05:30
Kovid Goyal
af5ed093b8 Fix test failing on macOS 2021-05-31 17:54:57 +05:30
Kovid Goyal
8f491e7dbb Add newslines at end of generated files and do imports in sorted order 2021-05-31 17:45:02 +05:30
Kovid Goyal
c1324da3fc missing newline in debug print 2021-05-31 17:42:10 +05:30
Kovid Goyal
0bbc4462fd Coalesce shortcuts as well 2021-05-31 17:40:49 +05:30
Kovid Goyal
e0261e925e DRYer 2021-05-31 17:40:49 +05:30
Kovid Goyal
46b3f71b8f Start work on porting docs generation 2021-05-31 17:40:49 +05:30
Kovid Goyal
3e598a17cf Add headers to options def files 2021-05-31 17:40:49 +05:30
Kovid Goyal
c1b13f2db2 DRYer 2021-05-31 17:40:49 +05:30
Kovid Goyal
a059e49579 Restore conf file generation in the new framework 2021-05-31 17:40:49 +05:30
Kovid Goyal
6d7df1c5e8 Refactor configuration file parsing
Now the time for importing the kitty.config module has been halved, from
16ms from 32ms on my machine. Also, the new architecture will eventually
allow for auto generating a bunch of python-to-C boilerplate code.
2021-05-31 17:40:49 +05:30
Kovid Goyal
dd5715ce79 Rename parsing placeholders for actions 2021-05-31 17:40:48 +05:30
Kovid Goyal
43acf3c5b1 name parser for deprecated send text appropriately 2021-05-31 17:40:48 +05:30
Kovid Goyal
f7db9e3527 Move deprecated parsers into utils 2021-05-31 17:40:48 +05:30
Kovid Goyal
1621a67f36 unused import 2021-05-31 17:40:48 +05:30
Kovid Goyal
248631a1a8 Add tests for conf parsing 2021-05-31 17:40:48 +05:30
Kovid Goyal
b4cb6e10ca Dont resolve kitty_mod in the defaults key definitions
Needed to allow multiple load_config calls
2021-05-31 17:40:48 +05:30
Kovid Goyal
5fa73e4413 Dont use a unneccessary global variable 2021-05-31 17:40:48 +05:30
Kovid Goyal
49c4b20113 Report bad choice values when parsing config 2021-05-31 17:40:48 +05:30
Kovid Goyal
43ece23b89 the args for KeyAction are not just strings 2021-05-31 17:40:48 +05:30
Kovid Goyal
f976851442 Make the repr for KeyAction more compact 2021-05-31 17:40:48 +05:30
Kovid Goyal
5470dd74bd Move options code into its own directory 2021-05-31 17:40:48 +05:30
Kovid Goyal
ddd178fa82 Move clear_all_shortcuts to options_types 2021-05-31 17:40:48 +05:30
Kovid Goyal
8d411cac5f ... 2021-05-31 17:40:48 +05:30
Kovid Goyal
bfbb85399e Move action parsing to option_types 2021-05-31 17:40:47 +05:30
Kovid Goyal
9f8a120664 Add __repr__ for action definitions 2021-05-31 17:40:47 +05:30
Kovid Goyal
e1cd6b6037 kitten_alias is also an is_multiple option 2021-05-31 17:40:47 +05:30
Kovid Goyal
2fd4487922 Better naming of action parsers 2021-05-31 17:40:47 +05:30
Kovid Goyal
27a459b0dd Refactor action parsers as generators 2021-05-31 17:40:47 +05:30
Kovid Goyal
6c344d4ae2 Move the action parsing code into options_types 2021-05-31 17:40:47 +05:30
Kovid Goyal
d7aa9952d8 Fix a regression that caused using the `title` command in session files to stop working
Fixes #3676
2021-05-31 09:31:29 +05:30
Kovid Goyal
09093c8f3e Cleanup PR 2021-05-30 12:47:00 +05:30
Kovid Goyal
222bf09df4 Merge branch 'libstartup-notification' of https://github.com/ctrlcctrlv/kitty 2021-05-30 12:45:13 +05:30
Fredrick Brennan
3041ff8d25 Downgrade libstartup-notification-1.so non-existence to warning
I'm not sure how common this library actually is. On my system, an Arch
Linux system with 2,170 packages installed, including KDE (Plasma), I
didn't have it.

It's downgraded to a warning instead of printing a traceback.
2021-05-30 03:05:42 -04:00
Kovid Goyal
bfe1952705 Merge branch 'less-contrast-for-powerline-alt-separator' of https://github.com/chipaca/kitty 2021-05-30 07:37:41 +05:30
John R. Lenton
97181a39da Use less contrasting color for powerline alt separator
This change makes it so that when using powerline-style tab bars, and
if the `tab_bar_background`, `inactive_tab_background` and
`inactive_tab_foreground` are all different, the separator between
inactive tabs uses the less contrasting color between the inactive
foreground, and the tab bar background.

This fixes #3664.
2021-05-29 16:54:51 +01:00
Kovid Goyal
39b3d3de0f macOS: Fix the baseline for text not matching other CoreText based applications for some fonts
Finally found an API to query CoreText for the adjusted baseline
position, so the baseline should now match up with other CoreText
based applications.

Fixes #2022
2021-05-29 14:19:20 +05:30
Kovid Goyal
056d16017f Fix #3660 2021-05-28 05:33:12 +05:30
Kovid Goyal
5cef0aef92 Update changelog for last PR 2021-05-25 18:19:34 +05:30
Kovid Goyal
f794de5b9b Merge branch 'new-menu-items' of https://github.com/Luflosi/kitty 2021-05-25 18:18:32 +05:30
Luflosi
4a67af9b90 macOS: add menu items for new_window and close_window 2021-05-25 13:54:02 +02:00
Kovid Goyal
f178dff4e0 Remove the special_types kludge for is_multiple options 2021-05-25 11:25:39 +05:30
Kovid Goyal
ba821cb02f DOnt be lazy about typing font features 2021-05-25 09:29:47 +05:30
Kovid Goyal
b169831810 remove unused import 2021-05-25 09:00:54 +05:30
Kovid Goyal
06b3c71304 Make is_multiple explicit 2021-05-25 08:46:26 +05:30
Kovid Goyal
fe94f4cbb4 Move type parsers for config into own module 2021-05-24 22:29:28 +05:30
Kovid Goyal
a4daa49f70 Micro-optimization 2021-05-24 17:11:20 +05:30
Kovid Goyal
3b1d534f6d The parser doesnt need the full defaults object 2021-05-24 14:01:50 +05:30
Kovid Goyal
c1777b1098 DRYer 2021-05-24 13:42:51 +05:30
Kovid Goyal
c827a29a7b Use the new get_options() function
Nicer than carrying around opts objects everywhere
2021-05-24 12:29:11 +05:30
Kovid Goyal
253b219d67 Store the options object globally 2021-05-24 11:50:03 +05:30
Kovid Goyal
b702f3daf1 In extend from point mode always restrict the top line to be from the point, even for multiline selections
Otherwise soft wrapped lines cause the full first line to be selected.
2021-05-23 15:52:48 +05:30
Kovid Goyal
76c9f46438 Disambiguate between click and doublepress
A doubleprpess should not generate a click event
2021-05-23 13:38:19 +05:30
Kovid Goyal
c6c203da43 Remove unused imports 2021-05-23 11:48:30 +05:30
Kovid Goyal
00302b74d1 Add a default mapping for line_from_point selection 2021-05-23 11:37:26 +05:30
Kovid Goyal
32f6f18527 DRYer 2021-05-23 11:22:29 +05:30
Kovid Goyal
4fd0446538 Merge branch 'new-menu-bar-item' of https://github.com/Luflosi/kitty 2021-05-22 06:03:32 +05:30
Luflosi
082ad61d14 macOS: move menu bar items for opening and closing OS windows and tabs to new menu
Most apps on macOS have the menu items for opening and closing tabs and windows in the "File" menu. Since this doesn't really apply to Terminal emulators, both Terminal.app and iTerm2 have them in the "Shell" menu instead.
This change makes the menu bar of kitty more consistent with these applications.
2021-05-21 18:21:31 +02:00
Kovid Goyal
0ca4faa25b New OS window -> New OS Window 2021-05-21 17:57:53 +05:30
Kovid Goyal
46a0566e2e Special handling for IOSevka's future ligatures
See https://github.com/be5invis/Iosevka/issues/1007
2021-05-21 17:53:49 +05:30
Kovid Goyal
97440d45d6 Add an example showing how to run things in scripts via launch 2021-05-21 16:02:05 +05:30
Kovid Goyal
c5afe4e745 Merge branch 'feat/undercurl-retina' of https://github.com/disrupted/kitty 2021-05-21 08:30:21 +05:30
Kovid Goyal
bc6e819396 typos in text 2021-05-19 20:35:43 +05:30
disrupted
d650a97dda Fix undercurl height & thickness on HiDPI screens
Update positioning
2021-05-18 19:00:46 +02:00
Kovid Goyal
cf88eb9d60 ssh kitten: Mimic behavior of ssh more closely
Execute any command specified on the command line via the users' shell
on the remote side just as ssh does

Fixes #3638
2021-05-18 15:12:57 +05:30
Kovid Goyal
0a742ea8d0 middle is more common than start or end 2021-05-18 09:55:00 +05:30
Kovid Goyal
cb8935746f Pass the font group to init_face
Allows using the DPI there if needed
2021-05-18 07:58:32 +05:30
Kovid Goyal
608ac953e5 Pass DPI through to special render function 2021-05-18 07:46:04 +05:30
Kovid Goyal
4d0d0b205d Improve parser error messages a bit 2021-05-17 21:29:54 +05:30
Kovid Goyal
07b643e24c Remove expected behavior section from issue template
Its largely redundant and a waste of time. Not to mention
no one likes being told what's expected of them :))
2021-05-17 18:38:46 +05:30
Kovid Goyal
02fb020dfd Better fix for minimal border layout issue
Keep _set_dimensions() private
2021-05-17 15:30:03 +05:30
Kovid Goyal
bac6ebdf95 Fix incorrect border drawing when multiple tabs and multiple OS Windows are present and some of the OS Windows have tab bars and some dont
Fixes #3634
2021-05-17 15:04:33 +05:30
Kovid Goyal
b7072d4097 Mention how to unmap mouse actions 2021-05-17 08:26:12 +05:30
Kovid Goyal
d7c7bb00b8 Merge branch 'master' of https://github.com/copy/kitty 2021-05-17 07:42:13 +05:30
Fabian
0485f0c7ed kitty @ get-text add an option to wrap long lines 2021-05-16 15:19:22 -05:00
Kovid Goyal
2ade6c0739 Update outdated info in build docs 2021-05-16 21:22:33 +05:30
Kovid Goyal
5eeb19871b Update dependency requirements for build from source 2021-05-16 21:20:11 +05:30
Kovid Goyal
083a0ae5fc ... 2021-05-16 09:33:06 +05:30
Kovid Goyal
ccc370e1c4 Dont initialize FontConfig when importing fast_data_types
This reduces the import time for fast_data_types by 12ms on my machine.
FontConfig initialization is very slow and it is only needed by the
main kitty program, however fast_data_types is imported in kittens and
remote control as well, where FontConfig is useless.
2021-05-15 10:41:54 +05:30
Kovid Goyal
23b8cafc41 Add layout name completion to @ goto-layout 2021-05-15 10:25:34 +05:30
Kovid Goyal
d7ab96856c ... 2021-05-15 09:42:52 +05:30
Kovid Goyal
3c77229f61 Add --no-response to set-background-image 2021-05-15 09:41:22 +05:30
Kovid Goyal
fcd206891f kitty @ get-text add an option to also get the current cursor position and state as ANSI escape codes
Fixes #3625
2021-05-15 09:27:28 +05:30
Kovid Goyal
3bf9130b0a Fix deleting windows that are not the last window via remote control leaving no window focused
Fixes #3619
2021-05-14 07:25:48 +05:30
Kovid Goyal
4125ac013f Validate command line args to @ goto-layout better 2021-05-13 20:46:37 +05:30
Kovid Goyal
e089e9c121 Clarify what --debug-config does 2021-05-13 20:19:34 +05:30
Kovid Goyal
81af379bbc correct spelling 2021-05-13 17:46:21 +05:30
Kovid Goyal
9b07aa6894 Simplify Quickstart section by delegating repo link to repology.org
Also add a warning about some Linux distros with outdated packages.
2021-05-13 17:42:29 +05:30
Kovid Goyal
a75140c6d7 Add a --working-directory alias for --directory as this is commonly used in many terminal emulators 2021-05-13 16:13:46 +05:30
Kovid Goyal
f3364cfdc0 Guard against invalid cache file in a couple more places 2021-05-13 09:51:57 +05:30
Kovid Goyal
f64b4e0e56 ... 2021-05-12 20:26:38 +05:30
Kovid Goyal
a1356d3bcf ... 2021-05-12 12:29:53 +05:30
Kovid Goyal
4c5a1ceefa Add a FAQ entry for why one should never output binary data into terminals 2021-05-12 12:24:29 +05:30
Kovid Goyal
e4b4a35375 macOS: Fix rendering getting stuck on some machines after sleep/screensaver
This is caused, as far as I can tell, by CVDisplayLink getting stuck.
Apple apparently are incapable of writing a simple timer robustly.
So if it remains stuck after a second delete and recreate it to force it
to restart.

Fixes #2016
2021-05-12 07:30:17 +05:30
Kovid Goyal
cc2afef390 Make the max number of unscrolled lines implementation defined 2021-05-11 14:55:14 +05:30
Kovid Goyal
7c5706ead9 Add the ability to unscroll the screen to the `kitty @ scroll-window` remote control command
Fixes #3604
2021-05-11 14:36:52 +05:30
Kovid Goyal
bcb739fcd2 Allow clicking URLs to open them without needing to also hold ctrl+shift 2021-05-11 14:20:12 +05:30
Kovid Goyal
85ef3724f1 Proper prefix when reporting Move events 2021-05-11 14:02:17 +05:30
Kovid Goyal
cb21422836 Add click and doubleclick events as well 2021-05-11 13:59:52 +05:30
Kovid Goyal
1c9674cec9 SPlit up add_click into two functions 2021-05-11 13:19:34 +05:30
Kovid Goyal
6dcc09a96f Port mouse selection tests to new framework 2021-05-11 11:49:44 +05:30
Kovid Goyal
0260c9d3fb Add a note about selection drag being auto-released 2021-05-11 11:18:10 +05:30
Kovid Goyal
80c03f28f8 Add a note about backward incompatibility 2021-05-11 10:36:48 +05:30
Kovid Goyal
eeaf67079a DRYer 2021-05-11 10:33:01 +05:30
Kovid Goyal
c50863c0d5 Add a note about --debug-input 2021-05-11 10:28:27 +05:30
Kovid Goyal
f4ab6542fa ... 2021-05-11 10:24:48 +05:30
Kovid Goyal
dfbe1bd234 Add debug prints for mouse events 2021-05-11 10:22:30 +05:30
Kovid Goyal
1e89cdc055 Get middle click paste working and dont trigger when mouse is grabbed 2021-05-11 09:20:27 +05:30
Kovid Goyal
7a40959f13 Add a configurable mouse action to select from the clicked point to the end of the line.
Fixes #3585
2021-05-11 09:01:52 +05:30
Kovid Goyal
2b4d55804c Document the mouse action mapping infrastructure 2021-05-11 08:39:13 +05:30
Kovid Goyal
858dac5601 Port mouse selection handling to the new generic mouse actions framework 2021-05-10 21:33:13 +05:30
Kovid Goyal
e944945b7a Implement URL clicking handler 2021-05-10 15:35:50 +05:30
Kovid Goyal
920151a460 Fix mouse event dispatch 2021-05-10 14:48:29 +05:30
Kovid Goyal
ac2a01fb09 Implement documentation generation and conf file generation for mouse actions 2021-05-10 14:27:45 +05:30
Kovid Goyal
a7933018cb Start work on intercepting mouse events 2021-05-10 07:16:43 +05:30
Kovid Goyal
5ee889eadd Dont carry around a bunch of definitions that were only needed during parsing on the opts object 2021-05-10 07:16:43 +05:30
Kovid Goyal
e811f03011 Match key names 2021-05-10 07:16:43 +05:30
Kovid Goyal
417c81de60 Implement parsing for mouse_map config 2021-05-10 07:16:43 +05:30
Kovid Goyal
212c653165 Maintain separate click queues for every button 2021-05-10 07:16:43 +05:30
Kovid Goyal
e36f11385f Convert mouse buttons to an enum 2021-05-10 07:16:43 +05:30
Kovid Goyal
abb05f4883 ... 2021-05-10 07:16:43 +05:30
Kovid Goyal
2973f33959 Start work on parsing mouse mappings 2021-05-10 07:16:43 +05:30
Kovid Goyal
053c2ed2b9 Make pow10_array const 2021-05-10 07:16:43 +05:30
Kovid Goyal
1865570390 Dont force dragging to be with left button 2021-05-10 07:16:43 +05:30
Kovid Goyal
ba1ee7e6cc Code to dispatch mouse events to python 2021-05-10 07:16:43 +05:30
Kovid Goyal
f6b0fcbc0f Add a link to patat 2021-05-10 07:12:31 +05:30
Kovid Goyal
a802058886 Add a link to hologram.nvim 2021-05-10 07:08:27 +05:30
Kovid Goyal
bbc1f68966 Add a link to euporie 2021-05-10 07:04:45 +05:30
Kovid Goyal
ca0b42c3bd oops 2021-05-10 06:28:03 +05:30
Kovid Goyal
9536a475ff Add changelog entry for last PR 2021-05-10 06:12:41 +05:30
Kovid Goyal
cfd731c376 Merge branch 'background-process-always-inherit-env' of https://github.com/trygveaa/kitty 2021-05-10 06:11:31 +05:30
Trygve Aaberge
de1015f6ac When running a background process, always inherit env
subprocess.Popen inherits the current environment if you pass env=None,
but only sets the environment you pass when you pass something else.
This causes an issue with using launch with --stdin-source and
--type=background, e.g. that DISPLAY is not set so you can't launch
graphical processes. Therefore, we have to include os.environ when we
pass an env to Popen.

Fixes #3602
2021-05-09 20:52:25 +02:00
Kovid Goyal
6c0730fef4 ... 2021-05-09 15:27:36 +05:30
Kovid Goyal
c73132610e Merge branch 'master' of https://github.com/jean/kitty 2021-05-09 15:26:56 +05:30
Jean Jordaan
77abaaf8b8 Oh yes, gather stow'd directories in one place for tidiness 2021-05-09 16:43:22 +07:00
Jean Jordaan
2787e86fd7 Shout-out to stow, it deserves to be used :-) 2021-05-09 16:38:49 +07:00
Kovid Goyal
355808b0f6 Fix dynamically changing the background color in a window causing rendering artifacts in the tab bar
Fixes #3595
2021-05-09 11:54:51 +05:30
Kovid Goyal
80c13fa75b Use same co-ord system for cursor as in KITTY_PIPE_DATA 2021-05-09 08:11:05 +05:30
Kovid Goyal
9a6c2aa1ea Add a few more special command line arguments for launch
Now all ``KITTY_PIPE_DATA`` is also available via command line argument substitution
Fixes #3593
2021-05-09 07:46:37 +05:30
Kovid Goyal
63d76ee837 macOS: When the Apple Color Emoji font lacks an emoji glyph search for it in other installed fonts
Fixes #3591
2021-05-09 07:17:32 +05:30
Kovid Goyal
7c48db7da8 Merge pull request #3592 from aaronjanse/allocation_typo
fix allocation typo
2021-05-08 15:10:10 +05:30
Aaron Janse
bd8d5f6288 fix allocation typo 2021-05-08 01:51:29 -07:00
Kovid Goyal
7413b7c4f6 Merge pull request #3590 from dankamongmen/master
graphics-protocol.rst: s/and/an/
2021-05-07 16:37:17 +05:30
nick black
80e3c871ce graphics-protocol.rst: s/and/an/ 2021-05-07 06:15:12 -04:00
Kovid Goyal
74c1e02274 Remove redundant F1-F4 defs in cursor key more 2021-05-07 15:20:26 +05:30
Kovid Goyal
efb0f6f24a Fix a regression in 0.20.0 that sent incorrect bytes for the F1-F4 keys in rmkx mode
Fixes #3586
2021-05-07 15:09:42 +05:30
Kovid Goyal
dbf8580dc3 Add issue reference for infinite length ligatures
Fixes #3504
2021-05-07 11:55:38 +05:30
Kovid Goyal
f110a01ffe Only use the last line of ssh hostname -f output incase the user has configured ssh to print random junk on login 2021-05-07 11:42:52 +05:30
Kovid Goyal
eced40a761 ... 2021-05-07 09:31:31 +05:30
Kovid Goyal
5ac315bc3a DRYer 2021-05-07 09:30:44 +05:30
Kovid Goyal
32df4daa63 Fix warning from CodeQL 2021-05-07 09:27:52 +05:30
Kovid Goyal
5836e456e5 Cleanup mouse features documentation 2021-05-07 09:19:17 +05:30
Kovid Goyal
dc6ab69387 Workaround spurious error reported by ASAN 2021-05-07 08:34:18 +05:30
Kovid Goyal
7301c56753 ... 2021-05-07 07:42:39 +05:30
Kovid Goyal
3b76d657bd Fix colored indication not being sent to GPU 2021-05-07 07:41:19 +05:30
Kovid Goyal
2adb6240e4 Reduce GPU memory for infinite length ligatures
An infinite length ligature (longer than 9 glyphs) that has long
sequences of a repeated glyph now does not store a separate sprite
for every repeat.

For example in the ligature ---------- even though there are 10 hyphen
glyphs only four will be stored on the GPU.
2021-05-07 06:59:30 +05:30
Kovid Goyal
e11af496da Remove incorrect cast 2021-05-07 06:59:30 +05:30
Kovid Goyal
f6e33406d7 Dont assume all sprites are rendered if the first one is 2021-05-07 06:59:30 +05:30
Kovid Goyal
6eab138d68 ... 2021-05-07 06:59:29 +05:30
Kovid Goyal
33287115de Support infinite length ligatures 2021-05-07 06:59:24 +05:30
Kovid Goyal
8e36056dd8 oops 2021-05-07 06:58:55 +05:30
Kovid Goyal
4a34f596a8 Remove MAX_EXTRA_GLYPHS_IN_GROUP 2021-05-07 06:58:55 +05:30
Kovid Goyal
7616a3e743 ... 2021-05-07 06:58:55 +05:30
Kovid Goyal
c64353c324 Dont make canvas dependent on max num of glyphs 2021-05-07 06:58:55 +05:30
Kovid Goyal
8eac22d37a typo 2021-05-07 06:58:55 +05:30
Kovid Goyal
35fab12330 Dont rely on max glyphs limit for scratch space 2021-05-07 06:58:55 +05:30
Kovid Goyal
a46988bc50 Simplify code by getting rid of ExtraGlyphs 2021-05-07 06:58:54 +05:30
Kovid Goyal
26e1d6fe5c Use uthash for glyph properties as well 2021-05-07 06:58:54 +05:30
Kovid Goyal
ec68739585 Make it harder to forget to redefine uthash_fatal 2021-05-07 06:58:54 +05:30
Kovid Goyal
33de0f821f Use uthash for the sprite position cache 2021-05-07 06:58:54 +05:30
Kovid Goyal
86ce11134a Unicode input kitten: Fix a regression in 0.20.0 that broke keyboard handling when the num lock or caps lock modifiers were engaged.
Fixes #3587
2021-05-07 06:55:25 +05:30
Kovid Goyal
bef4905416 Also remove -pedantic-errors when using --ignore-compiler-warnings
Fixes #3584
2021-05-07 06:26:00 +05:30
Kovid Goyal
baa8152248 Add link to changelog in github release notes
Fixes #3588
2021-05-07 06:18:42 +05:30
Kovid Goyal
34fe103c2b Prefix by GPG signature instead 2021-05-07 06:14:40 +05:30
Kovid Goyal
0d08014bd5 Dont append GPG signature twice to release file descs 2021-05-07 06:13:21 +05:30
Kovid Goyal
dd0130180b Use the kitty fatal function 2021-05-06 11:19:06 +05:30
Kovid Goyal
accdf9a6a8 DRYer 2021-05-06 08:57:38 +05:30
Kovid Goyal
c891432c9d version 0.20.3 2021-05-06 08:11:41 +05:30
Kovid Goyal
1a4efd9d81 Remove unused code 2021-05-06 07:46:31 +05:30
Kovid Goyal
bf462e535a Fix focus changes not being sent to windows when focused window changes because of the previously focused window being closed
Fixes #3571
2021-05-05 14:45:57 +05:30
Kovid Goyal
5cf228e362 Fix tab activity tracking not working unless there is some other activity in tab bar as well
Fixes #3571
2021-05-05 14:30:16 +05:30
Kovid Goyal
4dcccc553c ... 2021-05-05 14:02:58 +05:30
Kovid Goyal
7e53db8aac DRYer 2021-05-05 13:58:10 +05:30
Kovid Goyal
4a83584934 Fix #3576 2021-05-05 13:55:46 +05:30
Kovid Goyal
c735d1f6ac Merge branch 'master' of https://github.com/alexDarcy/kitty 2021-05-05 08:39:44 +05:30
Alexis Praga
7bd0fdf3da Freebsd: use gmake to build docs 2021-05-04 22:48:23 +02:00
Kovid Goyal
b570dfcd09 Move the inline ToC above quickstart
local doesnt work below quickstart and it also serves as a good overview
2021-05-04 11:31:34 +05:30
Kovid Goyal
2bc35539f0 Exclude document titles from local ToCs 2021-05-04 11:19:49 +05:30
Kovid Goyal
80e05319c6 ... 2021-05-04 11:08:04 +05:30
Kovid Goyal
49459b3774 Merge branch 'fix-help-menu-spotlight-search' of https://github.com/Luflosi/kitty 2021-05-04 08:20:58 +05:30
Luflosi
0788032003 macOS: fix spotlight search in help menu not working on some machines
The spotlight search in the "Help" menu of the menu bar did not appear when the system language is set to a language other than English. macOS magically adds the search box when the text in that menu matches the translation of "Help" in the system language. On my German system for example replacing "Help" with "Hilfe" will make the search box appear again. This is however not a good solution for kitty as it would require implementing localization support for all languages. Removing `CFBundleAllowMixedLocalizations=True` from `setup.py` also brings back the search box but that may break the locale again. The line was added in  8818b5d8df to fix an issue related to https://github.com/kovidgoyal/kitty/issues/1233.
Luckily I found a seemingly undocumented function that helps us out here, which does not rely the text comparison magic.
2021-05-02 22:21:09 +02:00
Kovid Goyal
d4c7c205cb Add a changelog entry for universal binaries 2021-05-02 07:35:59 +05:30
Kovid Goyal
96ce33792d Build kitty as a universal binary 2021-05-01 14:58:06 +05:30
Kovid Goyal
13bf8a20b0 Build universal binaries of all deps on macOS 2021-05-01 14:50:22 +05:30
Kovid Goyal
6b9b478492 Linux: Fix keyboard layout change keys defined via compose rules not being ignored 2021-05-01 08:09:26 +05:30
Kovid Goyal
c4e8bcb876 Merge branch 'add_attribution_logo' of https://github.com/MindTooth/kitty 2021-04-29 13:11:23 +05:30
Kovid Goyal
28b4fe5cb6 A new show_key kitten
Fixes #3556
2021-04-29 13:10:20 +05:30
Birger J. Nordølum
58b5e645c6 chore(logo): add missing attribution
The Big Sur template includes a CC BY 4.0 license, hence the attribution
with the details of the change.
2021-04-29 09:11:20 +02:00
Kovid Goyal
3e00ee4155 When releasing also upload GPG signatures
Fixes #3555
2021-04-29 08:08:35 +05:30
Kovid Goyal
d1169a0f37 Fix #3549 2021-04-28 19:46:56 +05:30
Kovid Goyal
c8c22d3dd2 Merge branch 'update_macos_icon' of https://github.com/MindTooth/kitty 2021-04-28 19:22:37 +05:30
Birger J. Nordølum
689fd03250 fix(logo): make the icon more inline with Big Sur
This tries to follow the Human Interface Guidelines
from Apple.
2021-04-28 15:37:13 +02:00
Kovid Goyal
56fe6480ce Merge branch 'patch-1' of https://github.com/kidonng/kitty 2021-04-28 16:00:49 +05:30
Kid
017d5f2991 Fix tasks shortcut on macOS 2021-04-28 16:59:39 +08:00
Kovid Goyal
ae43b1565e DRYer 2021-04-28 13:41:48 +05:30
Kovid Goyal
3206e1b12c ... 2021-04-28 13:11:59 +05:30
Kovid Goyal
93d4eca2d4 Fix kitty.conf man page being installed in incorrect location
Fixes #3543
2021-04-28 13:11:01 +05:30
Kovid Goyal
57b5e493a4 version 0.20.2 2021-04-28 10:50:34 +05:30
Kovid Goyal
fc184984a0 ... 2021-04-27 15:11:34 +05:30
Kovid Goyal
2178ff1c48 DRYer 2021-04-27 15:07:27 +05:30
Kovid Goyal
ae1df38c88 Fallback to mkostemp if O_TMPFILE fails 2021-04-27 12:03:24 +05:30
Kovid Goyal
162e498347 Fix @ set-colors for active_tab_foreground 2021-04-26 20:18:50 +05:30
Kovid Goyal
172023afca Forgot the double backslash in the docs 2021-04-26 17:31:43 +05:30
Kovid Goyal
18c7ea50b4 Cleanup text 2021-04-26 13:46:03 +05:30
Kovid Goyal
bdddb238f8 Also generate a man page for kitty.conf 2021-04-26 13:35:22 +05:30
Kovid Goyal
8d46237935 Add the most common keyboard shortcuts to the kitty man page 2021-04-26 12:39:25 +05:30
Kovid Goyal
3fcf83e685 Use a framed icon on macOS
Fits better with Apple's icon style
2021-04-26 12:07:35 +05:30
Kovid Goyal
d374af4341 Type check supersampled functions 2021-04-26 09:12:38 +05:30
Kovid Goyal
f32ad617a2 Special case rendering of the few remaining Powerline box drawing chars
Fixes #3535
2021-04-26 09:07:55 +05:30
Kovid Goyal
62656b24eb GNOME: Add a new option to control the color of the kitty window titlebar 2021-04-25 11:22:23 +05:30
Kovid Goyal
12763e19d8 Add a build argument to turn off -Werror
Fixes #3530
2021-04-24 18:32:57 +05:30
Kovid Goyal
89fd726e07 A new remote control command @env to change the default environment passed to newly created windows
Fixes #3529
2021-04-24 18:06:57 +05:30
Kovid Goyal
0b428987b1 ... 2021-04-24 18:02:16 +05:30
Kovid Goyal
1e29fad5f0 Typecheck @ls cli opts 2021-04-24 17:51:02 +05:30
Kovid Goyal
19524a4459 Update uthash 2021-04-24 09:47:40 +05:30
Kovid Goyal
7043d565c9 ... 2021-04-24 09:44:40 +05:30
Kovid Goyal
d6f856f2f2 Fix https://trac.macports.org/ticket/62732 2021-04-24 07:43:02 +05:30
Kovid Goyal
24f0451c10 Merge branch 'bug3514-fix' of https://github.com/orki/kitty 2021-04-23 21:27:31 +05:30
Ravi R Kiran
3c4460ca98 Give shift, control and caps lock precedence over other modifiers 2021-04-23 10:47:26 -05:00
Kovid Goyal
cbf33fa14b Fix #3523 2021-04-23 16:23:13 +05:30
Kovid Goyal
d782654819 Forgot to handle case of empty scrollback 2021-04-23 16:07:10 +05:30
Kovid Goyal
3c39cbf333 Add a note about over large scrollback fill 2021-04-23 15:54:21 +05:30
Kovid Goyal
bd746e5151 Add a note about what happens when no scrollback lines are present 2021-04-23 15:48:47 +05:30
Kovid Goyal
b32c346eed A new protocol extension to unscroll the screen
See https://gitlab.freedesktop.org/terminal-wg/specifications/-/issues/30
2021-04-23 15:44:38 +05:30
Kovid Goyal
77b8e204ad Fix graphics being cleared when switching to alt screen if the switch mode is to not clear the alt screen 2021-04-23 14:51:32 +05:30
Kovid Goyal
93dfe19c35 GNOME: Fix maximize state not being remembered when focus changes and window decorations are hidden
Apparently mutter needs window geometry set after the surface commit not
before, otherwise it doesnt "stick". When decorations are not hidden
there were other commits caused by the decorations, masking the issue.

Fixes #3507
2021-04-23 14:04:12 +05:30
Kovid Goyal
6dc8df5178 icat kitten: Respect EXIF orientation when displaying JPEG images
Fixes #3518
2021-04-23 07:31:37 +05:30
Kovid Goyal
237fd73702 Fix removal of inactive tab that is before the currently active tab causing the highlighted tab to be incorrect
Fixes #3516
2021-04-22 22:28:05 +05:30
Kovid Goyal
5f2d0142d1 Re-organize README a bit 2021-04-22 20:32:34 +05:30
Kovid Goyal
572d576d5b Merge branch 'fix-compilation-on-old-macos' of https://github.com/Luflosi/kitty 2021-04-22 14:30:38 +05:30
Luflosi
6606f51636 Fix compilation on macOS 10.12
The constants `NSControlStateValueOn`, `NSControlStateValueOff` and `NSControlStateValueMixed` are only available for macOS 10.13 or above according to https://developer.apple.com/documentation/appkit/nscontrolstatevalueon?language=objc.
Without this commit, compilation fails with this message:
```
glfw/cocoa_window.m:1537:28: error: use of undeclared identifier 'NSControlStateValueOn'
              item.state = NSControlStateValueOn;
                           ^
glfw/cocoa_window.m:1539:28: error: use of undeclared identifier 'NSControlStateValueMixed'
              item.state = NSControlStateValueMixed;
                           ^
glfw/cocoa_window.m:1542:47: error: use of undeclared identifier 'NSControlStateValueOn'
          item.state = controller.isDesired ? NSControlStateValueOn : NSControlStateValueOff;
                                              ^
glfw/cocoa_window.m:1542:71: error: use of undeclared identifier 'NSControlStateValueOff'
          item.state = controller.isDesired ? NSControlStateValueOn : NSControlStateValueOff;
                                                                      ^
```
To fix this, simply redefine the constants to use the old and now deprecated constants on older macOS versions.

The code that causes this was introduced in 98519bf326.
2021-04-22 10:53:34 +02:00
Kovid Goyal
36da65120a It's only alt and alt+shift that dont work in global menubar
alt in combination with ctrl/cmd works fine.
2021-04-22 10:50:43 +05:30
Kovid Goyal
b6c1e1a609 ... 2021-04-22 10:24:57 +05:30
Kovid Goyal
5d003ec772 Fix @close-tab not working with pipe based remote control
Fixes #3510
2021-04-22 10:23:04 +05:30
Kovid Goyal
b9210a2ba4 macOS: Prevent option based shortcuts for being used for global menu actions
Fixes #3515
2021-04-22 10:15:10 +05:30
Kovid Goyal
f3c559ea13 Cleanup secure keyboard entry logging 2021-04-22 09:41:01 +05:30
Kovid Goyal
6cee6b6429 More accurate ignoring message 2021-04-22 09:31:41 +05:30
Kovid Goyal
84f6aabf5b Clean up debug keyboard on macOS 2021-04-22 09:28:11 +05:30
Kovid Goyal
9ce947d6ea Ignore failure to read the readline init file on Linux as well
There are apparently people that like to break things randomly on their
systems by removing needed files. Fixes #3513
2021-04-22 08:13:57 +05:30
Kovid Goyal
0f23ad0d7e Merge branch 'u_int8_t' of https://github.com/sgn/kitty 2021-04-21 18:45:18 +05:30
Đoàn Trần Công Danh
1b760b6c53 freetype_render_ui_text: use uint8_t instead of u_int8_t
uint8_t is a standard type, while u_int8_t isn't. And we're assigning to
an uint8_t anyway.
2021-04-21 19:23:43 +07:00
Kovid Goyal
cdf64bf016 Linux: Fix binary kitty builds not able to load fonts in WOFF2 format
Fixes #3506
2021-04-20 17:07:47 +05:30
Kovid Goyal
f3726023c2 version 0.20.1 2021-04-19 21:45:08 +05:30
Kovid Goyal
cb41683f47 ... 2021-04-19 20:12:20 +05:30
Kovid Goyal
629a8ad055 Fix #3501 2021-04-19 19:58:02 +05:30
Kovid Goyal
4ba0fa00b4 Update changelog 2021-04-19 18:07:03 +05:30
Kovid Goyal
f1e73c015a Merge branch 'hyperlink_unbound_variable' of https://github.com/miseran/kitty 2021-04-19 18:03:18 +05:30
Reto Schnyder
926c3540ff Fix unbound variable in hyperlink handling 2021-04-19 14:19:13 +02:00
Kovid Goyal
1aebd83e45 A little clearer code 2021-04-19 17:42:15 +05:30
Kovid Goyal
8225351145 icat: When displaying an animated GIF image with no delays between frames, add a 100ms delay between every frame.
This allows some broken images tested with broken software *cough* browsers to work.
See #3498
2021-04-19 17:17:45 +05:30
Kovid Goyal
379add8d6f IntEnum was needed 2021-04-19 17:09:23 +05:30
Kovid Goyal
ea11ce8664 Use a normal enum for Dispose rather than an IntEnum 2021-04-19 16:57:43 +05:30
Kovid Goyal
82e9e96f0c Fix CodeQL warnings 2021-04-19 14:00:53 +05:30
Kovid Goyal
8c4e426534 Silence some unused parameter warnings 2021-04-19 13:53:27 +05:30
Kovid Goyal
636771e566 Fix test crashing on 32bit machines 2021-04-19 13:48:39 +05:30
Kovid Goyal
363b20bdd2 Add debug symbols when not stripping 2021-04-19 13:29:50 +05:30
Kovid Goyal
b16317e2ca Silence spurious compiler warning 2021-04-19 13:27:17 +05:30
Kovid Goyal
2c5c869228 Print command used to run tests 2021-04-19 13:14:25 +05:30
Kovid Goyal
3f5f218e0b Use correct printf codes 2021-04-19 13:00:48 +05:30
Kovid Goyal
c9cc425aad version 0.20.0
Fixes #3248
Fixes #3287
2021-04-19 10:14:00 +05:30
Kovid Goyal
9a2b0b6995 Wayland CSD: Double clicking on titlebar should toggle window maximize 2021-04-19 08:58:29 +05:30
Kovid Goyal
50f8aeeaf6 Dont output an error when none is used as a modifier 2021-04-18 18:11:56 +05:30
Kovid Goyal
fe291dd769 ... 2021-04-18 10:46:06 +05:30
Kovid Goyal
58850a0e14 Switch to ALE instead of syntastic 2021-04-17 16:53:48 +05:30
Kovid Goyal
518057489c Also output layout state in kitty @ ls 2021-04-17 12:11:56 +05:30
Kovid Goyal
cf0b2389a3 Also report window sizes in kitty @ ls 2021-04-17 11:49:57 +05:30
Kovid Goyal
6179cfc670 Abort parsing of APC and PM escape codes on 0x00 and 0x7f
Correct as per ECMA-48 section 8.3 and matches parsing of other escape
codes
2021-04-15 12:57:58 +05:30
Kovid Goyal
e6ccc2d178 Fix #3485 2021-04-15 08:57:47 +05:30
Kovid Goyal
db719eafac Remove num/caps locks from modifier processing in mouse events 2021-04-14 10:08:33 +05:30
Kovid Goyal
a4db27a807 Ignore the lock modifiers in legacy mode 2021-04-13 21:35:18 +05:30
Kovid Goyal
111c123435 X11: Fix resize_in_steps being applied even when window is maximized
Fixes #3473
2021-04-13 12:48:23 +05:30
Kovid Goyal
75d067e411 Merge branch 'fix-timg-link' of https://github.com/hzeller/kitty 2021-04-13 11:09:31 +05:30
Henner Zeller
fbeb991f7d Fix timg link (underscore was missing).
Signed-off-by: Henner Zeller <h.zeller@acm.org>
2021-04-12 22:27:32 -07:00
Kovid Goyal
ea2db51bbb Output all modifier indices in debug 2021-04-13 10:21:26 +05:30
Kovid Goyal
15f4c476c3 Ignore locked mods for legacy encoding in a few more places 2021-04-13 10:01:16 +05:30
Kovid Goyal
a7c5b8c634 Fix #3471 2021-04-13 09:53:57 +05:30
Kovid Goyal
1aeafcaebf Remove unused code 2021-04-13 09:02:30 +05:30
Kovid Goyal
8d743e9511 Fix is_self 2021-04-13 08:54:45 +05:30
Kovid Goyal
958d4d8a6a kitty @ ls: Show only environment variables that are different for each window, by default.
Makes the output much less noisy, and env vars that are common across
all windows are useless for selection/identification purposes.
2021-04-13 08:44:11 +05:30
Kovid Goyal
05fb09f56c Fix #3470 2021-04-13 08:23:15 +05:30
Kovid Goyal
cdcf8ed3bd Add some colors to keyboad debug output 2021-04-13 07:41:47 +05:30
Kovid Goyal
572466eed1 XKB: Honor numlock state when reporting keypad keys 2021-04-13 07:35:13 +05:30
Kovid Goyal
4c644b8556 Add NumLock and CapsLock reporting to the keyboard protocol 2021-04-13 07:10:00 +05:30
Kovid Goyal
c989a7198b Add support for the keypad Begin key
Fixes #3468
2021-04-11 07:58:27 +05:30
Kovid Goyal
084b028eac Merge branch 'macos-secure-keyboard-entry' of https://github.com/multi/kitty
This is the usual Apple security theatre. Prevent key loggers from
reading key events from the OS, but those same key events are written to
the unsecured tty device from where the keylogger could read them
anyway.

But, since I dont want to have to explain why this is simply security
theatre to every rando on the internet, merging anyway. It only costs
one line in the application menu and maybe it will make some people that
click on it *feel* more secure.
2021-04-10 14:41:54 +05:30
Kovid Goyal
699d88e393 ... 2021-04-10 14:36:31 +05:30
Kovid Goyal
8c6566580a ... 2021-04-10 14:32:13 +05:30
Kovid Goyal
effe30ad3f Add a FAQ entry about memory leaks 2021-04-10 14:23:28 +05:30
Kovid Goyal
e91b8d4556 ... 2021-04-10 14:08:03 +05:30
Kovid Goyal
76fca0641e Fix memory leak in utf_8_strndup test 2021-04-10 13:39:04 +05:30
Kovid Goyal
7ec803222f Fix a mem leak of the disk cache directory path 2021-04-10 13:21:58 +05:30
Kovid Goyal
03f0f065ee Use a single alloc per history buf segment 2021-04-10 13:18:27 +05:30
Kovid Goyal
63e5be6ff0 Dont use the python memory pool for the history buffer
It's not optimized for this use case
2021-04-10 12:11:05 +05:30
Kovid Goyal
4ccd2afd78 Free ChildMonitor at end of dealloc 2021-04-10 11:49:39 +05:30
Georgi Yonchev
98519bf326 [macos] - Add "Secure Keyboard Entry" menu item 2021-04-09 16:39:51 +03:00
Kovid Goyal
82d11b80dd Add a test for filling from scrollback with large continued line 2021-04-09 17:04:55 +05:30
Kovid Goyal
cf3662442f Fix #3460 2021-04-09 16:56:53 +05:30
Kovid Goyal
0be5347e6a Better error message when screen_resize() fails 2021-04-09 10:09:17 +05:30
Kovid Goyal
1b39c42e92 ... 2021-04-08 12:36:44 +05:30
Kovid Goyal
5b4f5a1e2a Add a link to the nb note taking application 2021-04-08 12:06:02 +05:30
Kovid Goyal
4eb8b1db01 Merge branch 'bug3446-fix' of https://github.com/orki/kitty 2021-04-08 08:37:55 +05:30
Ravi R Kiran
b5555b9a8d Handle multiple real modifiers mapping to the same virtual modifier 2021-04-07 21:36:11 -05:00
Kovid Goyal
67bb426eb2 Fix recent Wayland chagelog entries in the incorrect section 2021-04-08 07:59:34 +05:30
Kovid Goyal
cf3a088a53 Allow running under Wayland on GNOME by default 2021-04-08 07:52:28 +05:30
Kovid Goyal
a79d024c09 Accept window_id as an alias for id when matching 2021-04-08 07:19:45 +05:30
Kovid Goyal
253de1eeca Move the CSD metrics initialization into the CSD module 2021-04-07 22:28:04 +05:30
Kovid Goyal
4e6d5d3f1e Fix GNOME breaking when setting window geometry
The current version of GNOME has a regression that causes the compositor
to send incorrect geometry with the next configure event if the CSD
buffers are created after a call to set_window_geometry.

So call set_window_geometry last. And shake head sadly.
2021-04-07 22:14:09 +05:30
Kovid Goyal
82a5733ec5 _glfwPLatformSetWindowSize() should not be called when handling configure events as it does a bunch of work already done before 2021-04-07 19:55:15 +05:30
Kovid Goyal
4822fa989e Wayland: wire up live resize notification 2021-04-07 18:29:28 +05:30
Kovid Goyal
fe0e1adb2a DRYer 2021-04-07 15:26:30 +05:30
Kovid Goyal
850a8218db Allow toggling xdg configure debug output at runtime 2021-04-07 15:24:58 +05:30
Kovid Goyal
bf3fc5fb92 Also implement programmatic window resizing 2021-04-07 15:13:22 +05:30
Kovid Goyal
a19d1fc140 Restore size after all types of docking not just maximize/unmaximize
We make use of the fact that wayland tells us when the window is being
resized to track actual user requested sizes as opposed to compositor
requested ones.
2021-04-07 15:08:44 +05:30
Kovid Goyal
593eb1d952 Focus state needs to be updated always 2021-04-07 14:28:11 +05:30
Kovid Goyal
75ec801941 Get the window geometry with CSD fully correct (I think)
The co-ordinates are in the surface co-ordinate system. When the
compositor specifies sizes it apparently adds one subsurface size
in both x and y directions, not both. Possibly because the origin is
placed after the top and left subsurfaces. So modify it by adding
and extra subsurface size to that.
2021-04-07 14:21:43 +05:30
Kovid Goyal
5a1bd93518 Handle all known xdg top level states 2021-04-07 13:33:06 +05:30
Kovid Goyal
f849f383cb Use the proper number for wayland CSD vertical shadow geometry
Apparently set_wayland_geometry uses buffer co-ordinates not surface
co-ords so the numbers need to be multiplied by the scale
2021-04-06 22:19:17 +05:30
Kovid Goyal
ac3080f0e2 Fix #3446 (I hope) 2021-04-06 21:51:03 +05:30
Kovid Goyal
0935dd053c Modifier indices are unsigned 2021-04-06 21:45:02 +05:30
Kovid Goyal
7e78f30739 Wayland: Fix un-maximizing a window not restoring its size to what it was before being maximized 2021-04-05 13:47:50 +05:30
Kovid Goyal
d0f34e99a6 Fix fringing in shadow due to using integer operations 2021-04-05 11:09:34 +05:30
Kovid Goyal
c781825b00 Make setting sigma independent of kernel size 2021-04-05 10:55:30 +05:30
Kovid Goyal
7199c62b76 ... 2021-04-05 10:13:33 +05:30
Kovid Goyal
2074a0d958 Forgot that the top margin is scaled 2021-04-05 09:57:44 +05:30
Kovid Goyal
3e2b626107 Inform compositor of visible window geometry
The numbers dont make logical sense, but they do what is expected on
GNOME and since only GNOME is stupid enough to insist on CSD, that's
all we care about.
2021-04-05 09:10:47 +05:30
Kovid Goyal
abf515ece9 Mention that w3m now supports the kitty graphics protocol 2021-04-05 08:15:34 +05:30
Kovid Goyal
07de9c021d Decrease shadow intensity when un-focused 2021-04-04 23:04:12 +05:30
Kovid Goyal
ff420b6495 Render top CSD shadow 2021-04-04 22:49:07 +05:30
Kovid Goyal
78908e5b93 Finish rendering of side shadows for CSD 2021-04-04 20:16:13 +05:30
Kovid Goyal
bd6643a523 Use a tile to reduce startup CPU cost of shadows 2021-04-04 18:16:33 +05:30
Kovid Goyal
71fddeb1f5 Start work on shadow based CSD 2021-04-04 17:13:50 +05:30
Kovid Goyal
9f708be8fd Fix name of wttr -> wttr.in 2021-04-04 17:13:17 +05:30
Kovid Goyal
a13f815591 Fix index_selection() not updating empty selections
Newly created selections are empty but must still be indexed.
Fixes #3431
2021-04-03 10:48:43 +05:30
Kovid Goyal
b5ac06e652 Fix #3422 2021-04-03 06:48:10 +05:30
Kovid Goyal
e56d259b8e Also free() when loading fails 2021-04-03 06:41:11 +05:30
Kovid Goyal
11d13c406a Fix a memory leak when setting default window icon or background image 2021-04-03 06:37:57 +05:30
Kovid Goyal
d5448e6902 Add documentation and cleanup previous PR 2021-04-03 06:25:47 +05:30
Kovid Goyal
777b9eb68e Merge branch 'hyper' of https://github.com/orki/kitty 2021-04-03 06:15:55 +05:30
Kovid Goyal
ff1585acfe Unicode input: Make diamond a synonym for gem
Fixes #3437
2021-04-02 12:53:58 +05:30
Kovid Goyal
cb515157b3 Fix the selection getting changed if the screen contents scroll while the selection is in progress
When the selection object was refactored to track the input
co-ordinates, index_selection() was not updated accordingly.
Fixes #3431
2021-04-01 23:17:13 +05:30
Kovid Goyal
da39fb2880 Add a note about when the splits layout was added to kitty
Bloody Ubuntu/Debian and their absurd release policies.
2021-04-01 23:04:13 +05:30
Kovid Goyal
eb3a2126ee Changelog entry for CSD work
Bloody two days of my life I will never get back thanks to those
*&^(*&%*%*& at GNOME.
2021-04-01 22:57:19 +05:30
Kovid Goyal
9c1c399716 ... 2021-04-01 22:52:13 +05:30
Kovid Goyal
e209c3329b Allow specifying a right_margin that is not rendered for the CSD title
Can void double rendering if I ever decide to add button to the titlebar
2021-04-01 22:50:54 +05:30
Kovid Goyal
802147e255 More robust ellipsis width calculation 2021-04-01 22:18:13 +05:30
Kovid Goyal
1a7291276c Add a cat face emoji at the start of the CSD title 2021-04-01 22:07:37 +05:30
Kovid Goyal
6d6273af48 Properly scale emoji rendered in the CSD 2021-04-01 22:07:00 +05:30
Kovid Goyal
b7d967b6bc Dont offset title from left edge 2021-04-01 18:19:59 +05:30
Kovid Goyal
779a06fa72 DRYer 2021-04-01 13:54:20 +05:30
Kovid Goyal
0656a5079a CSD titles: Render ellipsis when too long 2021-04-01 13:48:58 +05:30
Kovid Goyal
a1669267b3 Fix hiding on window decorations not working with new CSD code 2021-04-01 12:32:48 +05:30
Kovid Goyal
bbb40f2a21 Use a little less contrast for CSD title 2021-04-01 12:20:53 +05:30
Kovid Goyal
c5b3e43b6c Use bold for CSD titles 2021-04-01 12:18:48 +05:30
Kovid Goyal
55dc354e68 Improve at exit cleanup functions
Now they are run in a defined order not based on
the order of initialization
2021-04-01 11:48:36 +05:30
Kovid Goyal
0ec7e6c36f Make the freetype text rendering code re-useable in multiple contexts 2021-04-01 11:28:23 +05:30
Kovid Goyal
b1da76eefa Set CSD color based on focus state 2021-04-01 10:54:22 +05:30
Kovid Goyal
5c6e55d37f Vertically center CSD title 2021-04-01 10:34:22 +05:30
Kovid Goyal
5d496216e0 Implement rendering of titles in CSD 2021-04-01 10:23:04 +05:30
Kovid Goyal
e92ed67021 Add a callback glfw can use to request text rendering 2021-04-01 08:22:06 +05:30
Ravi R Kiran
b074533b29 Fix regression 2021-03-31 08:54:10 -05:00
Kovid Goyal
f3665ddfab Cleanup some used memory 2021-03-31 15:29:28 +05:30
Kovid Goyal
dd2b6119b3 Implement rendering of emoji for CSD 2021-03-31 15:23:05 +05:30
Kovid Goyal
ada3f9e547 Add a wcswidth() implementation useable from C code 2021-03-31 15:19:39 +05:30
Kovid Goyal
0372242d12 Use an enum for UTF8 decoder state 2021-03-31 15:19:27 +05:30
Kovid Goyal
9838a336d5 Make wcwidth-std.h more generally includeable 2021-03-31 15:18:19 +05:30
Kovid Goyal
debd9fe419 Dont render glyphs that would overflow the canvas 2021-03-31 11:06:37 +05:30
Kovid Goyal
73a06b0e9e Text rendering for CSD now works 2021-03-31 11:02:35 +05:30
Ravi R Kiran
fdfba4ea04 Fix pyflakes failures 2021-03-30 14:57:41 -05:00
Ravi R Kiran
953253de99 Implementation of hyper and meta 2021-03-30 14:23:17 -05:00
Kovid Goyal
da0009a46b More work on CSD title rendering 2021-03-30 22:12:54 +05:30
Kovid Goyal
d7e1e53450 More work on text rendering for CSD 2021-03-30 08:25:01 +05:30
Kovid Goyal
4a3c57054f Function to get fallback font for a char 2021-03-29 15:35:38 +05:30
Kovid Goyal
41b9495588 More work on text rendering 2021-03-29 14:56:49 +05:30
Kovid Goyal
cdbc096990 Start work on rendering text for CSDs 2021-03-29 12:15:47 +05:30
Kovid Goyal
53f2df115e Hook up re-render of title bar when title changes 2021-03-29 12:15:47 +05:30
Kovid Goyal
0593158a86 Refactor CSD code to avoid un-needed rerenders and use a single shm pool for all CSD buffers 2021-03-29 12:15:47 +05:30
Kovid Goyal
c1f8372efc Hide edges when not focused 2021-03-29 12:15:47 +05:30
Kovid Goyal
6e3db0be3d Rename variable 2021-03-29 12:15:47 +05:30
Kovid Goyal
0f084faca5 Forgot to scale the title buffer 2021-03-29 12:15:47 +05:30
Kovid Goyal
c6829766bb Properly scale the decorations buffers 2021-03-29 12:15:47 +05:30
Kovid Goyal
e7931b0121 Get rid of the no longer needed viewporter protocol 2021-03-29 12:15:47 +05:30
Kovid Goyal
aeb82e7fb0 Refactor the rendering of CSD on Wayland 2021-03-29 12:15:47 +05:30
Kovid Goyal
1e6fe7785a Dont set the EDITOR env var in child processes
It isnt really needed, since the various kittens dont rely on it
anymore, instead calling get_editor() to get the path to the editor.
Has the nice side-effect of not needing to run the shell at startup
to read its environment. Now the shell is only run if the user calls
the edit config file kitten. Fixes #3426
2021-03-29 11:56:48 +05:30
Kovid Goyal
4edbe0ea4f Remove unnecessary opacity marking for decoration buffers 2021-03-25 16:28:49 +05:30
Kovid Goyal
0788b98ae4 Fix header comment 2021-03-25 16:05:14 +05:30
Kovid Goyal
8a267894f3 Make createShmBuffer re-useable 2021-03-25 16:04:12 +05:30
Kovid Goyal
0510cd47f4 Rename buffer -> edge_buffer 2021-03-25 15:19:11 +05:30
Kovid Goyal
5dbbed3dcc Ignore text input done if serial is incorrect 2021-03-25 15:05:48 +05:30
Kovid Goyal
7b130dc220 Double buffer pre-edit and commit events 2021-03-25 14:59:58 +05:30
Kovid Goyal
d28caf15b2 More glyph grouping fixes 2021-03-25 14:06:16 +05:30
Kovid Goyal
44df11c443 Move CSD metrics into the window object
Makes them potentially configurable
2021-03-25 12:52:09 +05:30
Kovid Goyal
63a50ec066 Use the correct mouse cursor theme on GNOME
Relies on a working desktop settings portal (xdg-desktop-portal-gtk)
2021-03-25 12:20:13 +05:30
Kovid Goyal
3d0cff1f47 Merge branch 'fix-rectircle-subpixel-rendering' of https://github.com/jesseleite/kitty 2021-03-25 09:55:05 +05:30
Jesse Leite
97a8b718dd Merge branch 'master' of https://github.com/kovidgoyal/kitty into fix-rectircle-subpixel-rendering 2021-03-25 00:17:47 -04:00
Kovid Goyal
fc8e147e4a Fix mouse handling when using client side decorations
The mouse co-ordinates used by glfw were all wrong.
2021-03-25 09:27:25 +05:30
Jesse Leite
af4083a8b7 Prevent subpixel rendering via floor/ceil on left/right side of box drawn corners. 2021-03-24 23:56:53 -04:00
Kovid Goyal
7c7933efa9 Fix #3416 2021-03-24 13:17:38 +05:30
Kovid Goyal
317ecbc9fa Wayland: Add support for the text input protocol
Fixes #3410
2021-03-24 11:24:37 +05:30
Kovid Goyal
67445a22d3 ... 2021-03-23 16:33:05 +05:30
Kovid Goyal
62997956a0 Start work on Wayland text input protocol support 2021-03-23 16:33:04 +05:30
Kovid Goyal
df7790fdfe ... 2021-03-23 16:31:25 +05:30
Kovid Goyal
34d06fa3e9 Use a struct for IME update events
Allows for easier extension in the future
2021-03-23 16:05:22 +05:30
Kovid Goyal
a981b46ec9 Use an enum for updateimestate as well 2021-03-23 10:52:11 +05:30
Kovid Goyal
84dcf8fd27 Use an enum for ime_state 2021-03-23 10:42:07 +05:30
Kovid Goyal
11268ffa16 Fix marking of text not working on lines that contain zero cells
Zero cells are passed to the regex engine as spaces, so they must
increment the match_pos counter. Fixes #3403
2021-03-23 10:04:58 +05:30
Kovid Goyal
c0ec60c113 Forgot to change a couple of usages of line_as_unicode 2021-03-23 09:56:58 +05:30
Kovid Goyal
ca7587c084 Allow skipping zero cells when converting a line to unicode 2021-03-23 09:53:22 +05:30
Kovid Goyal
33ecfc6f84 ... 2021-03-22 22:33:30 +05:30
Kovid Goyal
83bbcf0aa1 Graphics protocol: Add a control to allow clients to specify that the cursor should not move when displaying an image
Fixes #3411
2021-03-22 22:16:40 +05:30
Kovid Goyal
ba32e481ca ... 2021-03-22 10:46:41 +05:30
Kovid Goyal
af9da2e495 Make pt_to_px useable in state.c 2021-03-21 07:29:48 +05:30
Kovid Goyal
77f7672e98 ... 2021-03-20 13:19:11 +05:30
Kovid Goyal
9dd8185f37 rectciricle -> rectircle 2021-03-20 13:17:17 +05:30
Kovid Goyal
12f61fd24f super sample factor is included in height 2021-03-20 13:11:26 +05:30
Kovid Goyal
c9864c994f Improve rendering of rounded corners by using a rectcircle equation rather than a cubic bezier
Fixes #3409
2021-03-20 12:59:20 +05:30
Kovid Goyal
9e476127d3 macOS: Add native keyboard shortcut for unicode input
Fixes #3407
2021-03-19 14:44:38 +05:30
Kovid Goyal
fae99a24bf Merge branch 'installation-doc-bug' of https://github.com/Dsantra92/kitty 2021-03-18 18:17:14 +05:30
Deeptendu Santra
8d9ab15c40 Fix installation docs
Added `/` at the applications, otherwise applications may be considered a file if the directory is not present. The addition of `/` also ensures user knows that he/she needs to create new directory if it is not present.
2021-03-18 17:55:53 +05:30
Kovid Goyal
ccafdacc6f Ensure cursor position is correct when filling line buffer 2021-03-18 10:39:08 +05:30
Kovid Goyal
4a996c1f76 Use the final cursor position when calculating number of continued lines in resized buffer 2021-03-17 22:29:59 +05:30
Kovid Goyal
d743aff4bc Make the code to copy lines into linebufs general 2021-03-17 22:02:47 +05:30
Kovid Goyal
0f3ff4e2d9 Scrollback filling should happen after cursor position is finalized 2021-03-17 21:59:11 +05:30
Kovid Goyal
a4d9d948ab ... 2021-03-17 14:45:23 +05:30
Kovid Goyal
32e6c0c6a6 Add a security policy 2021-03-17 14:38:57 +05:30
Kovid Goyal
ba2efaacd8 Fix regression in launching executables as command line arguments without full paths 2021-03-17 14:32:43 +05:30
Kovid Goyal
37e3e29c8c Fix a crash on systems using musl as libc
Fixes #3395
2021-03-17 14:13:50 +05:30
Kovid Goyal
90722ecbe7 historybuf should be used only when current screen is the main linebuf 2021-03-17 13:51:30 +05:30
Kovid Goyal
5a2eaa24d0 Add changelog entry for last PR 2021-03-17 13:49:24 +05:30
Kovid Goyal
071986138b Cleanup previous merge 2021-03-17 13:43:26 +05:30
Kovid Goyal
d61c4a9569 Merge branch 'scrollback-fill-enlarged-window' of https://github.com/elebow/kitty 2021-03-17 12:22:12 +05:30
Eddie Lebow
9fff829ab4 Implement scrollback_fill_enlarged_window 2021-03-17 02:27:59 -04:00
Eddie Lebow
4682da83c1 Add linebuf_continued_lines_count() 2021-03-17 02:27:58 -04:00
Eddie Lebow
c93c87e8fe Add linebuf_add_line_to_top() 2021-03-17 00:09:03 -04:00
Kovid Goyal
f3e2a42c29 Fix #3400 2021-03-16 20:59:54 +05:30
Kovid Goyal
b063c8cda1 Fix inactive tab closing causing active tab to change
Fixes #3398
2021-03-16 18:06:01 +05:30
Kovid Goyal
d360d077d1 Handle the XTMODKEYS escape code
Treat the XTerm specific modifyOtherKeys escape codes as putting the
disambiguate mode on/off the stack. The escape code causes XTerm to use
a (broken, naturally) variant of CSI u encoding for many keys, so we
treat it as going into the disambiguate mode.
2021-03-16 17:46:11 +05:30
Kovid Goyal
a548c31d50 Add links to rasterm and notcurses in the graphics protocol docs 2021-03-16 17:11:01 +05:30
Eddie Lebow
6c44b4f451 Add historybuf_pop_line() 2021-03-15 23:59:26 -04:00
Eddie Lebow
b76491ba82 Add tests for scrollback_fill_enlarged_window 2021-03-15 23:58:11 -04:00
Eddie Lebow
e10919496f Add scrollback_fill_enlarged_window config option 2021-03-15 23:57:43 -04:00
Kovid Goyal
543b7dcf94 Increase the default set of recognized URL prefixes 2021-03-15 12:17:15 +05:30
Kovid Goyal
271c39cc9d Fix reading image index not working on older ImageMagick
Fixes #3384
2021-03-12 12:00:44 +05:30
Kovid Goyal
18186da90e Better error message for people running icat on systems with outdated/broken ImageMagick 2021-03-12 11:28:57 +05:30
Kovid Goyal
02d29d4816 Better error message when ImageMagick does not write correct output filenames 2021-03-12 11:07:42 +05:30
Kovid Goyal
82934b84d6 ... 2021-03-12 08:25:19 +05:30
Kovid Goyal
6177a7d71f Fix duplicated line in graphics protocol delete table
Fixes #3383
2021-03-12 08:06:13 +05:30
Kovid Goyal
1f4fdb174a Fix rendering of the new infinite length ligatures on CoreText
Apparently on CoreText, harfbuzz gives incorrect values for glyph
positions. So we use it only for selection and grouping of glyphs.
Actual positioning is done using CoreText. This means sophisticated
positioning using GPOS tables is probably broken, but that isn't really
useable in a character grid anyway.

Also remove the hack where glyph_centering was done for calt ligatures
as it seems to not be needed with modern FiraCode and CoreText
rendering. Fixes #3372
2021-03-11 20:11:40 +05:30
Kovid Goyal
a94b94cab0 Fix macos-freeze building everything twice 2021-03-11 13:03:45 +05:30
Kovid Goyal
399c700939 Prevent Cocoa from sending us open file events from command line args
We process command line args ourselves, thank you very much.
2021-03-11 10:59:03 +05:30
Kovid Goyal
077097c112 Also implement openFiles 2021-03-10 21:55:00 +05:30
Kovid Goyal
f70c9842f5 macOS: Allow opening script and command
Fixes #3366
2021-03-10 21:33:29 +05:30
Kovid Goyal
0f020d5b37 When passing a directory or a non-executable file as the program to run to kitty open it with the shell, instead of just failing.
Allows using kitty as the program to open directories or shell scripts
from desktop environments.
2021-03-10 14:27:07 +05:30
Kovid Goyal
2eccc81fee Show a message about how to exit --hold 2021-03-10 14:26:11 +05:30
Kovid Goyal
9fdaef1da6 Graphics protocol: Fix suppression of responses not working for chunked transmission
Now the starting escape codes q value is used unless the last escape
code specifies a non-zero q value of its own. Fixes #3375
2021-03-10 09:58:49 +05:30
Kovid Goyal
eb42edff09 Use builtin rfc linking 2021-03-10 08:30:13 +05:30
Kovid Goyal
07f27d0f54 Add a link to RFC 1950 2021-03-10 08:22:59 +05:30
Kovid Goyal
48d2aa14c8 Install libx11-xcb-dev on CI
Looks like it is no longer pre-installed
2021-03-10 08:20:35 +05:30
Kovid Goyal
3c1c8ecd20 Merge branch 'dankamongmen/deflate-docs' of https://github.com/dankamongmen/kitty 2021-03-10 08:07:32 +05:30
nick black
dcb8fcece4 Add some notes to graphics protocol docs
Clarify that RFC1950-style zlib-wrapped deflate (as opposed
to RFC1951-style raw deflate) payloads are sent in the
graphics protocol, and that base64 encoding follows
compression (implied by remarks elsewhere, but go ahead and
make it explicit here).
2021-03-09 18:25:18 -05:00
Kovid Goyal
958ccadc09 Also detect gemini:// URLs when hovering with the mouse
Fixes #3370
2021-03-06 11:12:45 +05:30
Kovid Goyal
c48a42bec5 Merge branch 'add-timg-to-graphics-docs' of https://github.com/hzeller/kitty 2021-03-06 10:48:54 +05:30
Henner Zeller
50858322d6 Add timg (http://timg.sh/) to graphics protocol users program list.
Signed-off-by: Henner Zeller <h.zeller@acm.org>
2021-03-05 20:45:32 -08:00
Kovid Goyal
62912a800a Ban a bunch of unsafe C functions from the codebase
List is taken from the git codebase
2021-03-05 08:26:05 +05:30
Kovid Goyal
1ded78a98c A new command to show the env vars of the kitty process 2021-03-03 16:04:08 +05:30
Kovid Goyal
90c6c2a366 ... 2021-03-03 15:11:05 +05:30
Kovid Goyal
fbe84698c4 Add a FAQ entry about env vars 2021-03-03 15:06:30 +05:30
Kovid Goyal
2c642406d8 Dont exclude glfw.c from LoC as it no longer is largely auto-generated 2021-03-01 10:59:57 +05:30
Kovid Goyal
b811976018 Ensure global shortcuts are never sent to children
This was happening with ctrl+tab and ctrl+shift+tab because cocoa eats
these and so glfw has a workaround to always send them. If they are
added as global shortcuts, for exmaple for next/previous tab they were
then being sent to children
2021-02-28 21:42:57 +05:30
Kovid Goyal
3ee7e5f800 Fix another use after free caused by a re-assigned pointer 2021-02-28 12:30:12 +05:30
Kovid Goyal
945cbca387 hints kitten: When using the linenumber action with a background action, preserve the working directory
Fixes #3352
2021-02-27 09:14:12 +05:30
Kovid Goyal
30c7ff341f DRYer 2021-02-27 09:10:16 +05:30
Kovid Goyal
12d7c7314a Only warn about Wayland's inadequacy once 2021-02-26 19:21:48 +05:30
Kovid Goyal
ce3cd691cc macOS: Add global menu action to detach current tab 2021-02-25 12:27:10 +05:30
Kovid Goyal
81f144df15 macOS: Add entries to global menu bar for creating and changing tabs 2021-02-25 11:54:53 +05:30
Kovid Goyal
78854d4a10 macOS: Disable cocoa tabs
kitty has its own tabs, and macOS inserts confusing menu entries for its
non-functional tabs into the global menu. So disable tabs. Fixes #3325
2021-02-25 11:26:55 +05:30
Kovid Goyal
dc3ad80d24 Window may not be in current os window if triggerred shortcut is detach_window 2021-02-25 07:20:07 +05:30
Kovid Goyal
ed1188dc61 Forgot modifier mask 2021-02-25 07:12:00 +05:30
Kovid Goyal
52347ced85 macOS: Make the global keybinding used for preferences also configurable 2021-02-25 06:58:20 +05:30
Kovid Goyal
5fd6c6b9a1 typos in docs 2021-02-24 14:17:28 +05:30
Kovid Goyal
9e7031f5d8 Dont call window_for_id() unnecessarily 2021-02-24 13:38:38 +05:30
Kovid Goyal
cca590c20a Fix a use-after-free introduced in the recent key handling refactor 2021-02-24 13:32:27 +05:30
Kovid Goyal
863fff8620 Cleanup previous PR 2021-02-24 12:32:26 +05:30
Kovid Goyal
18f42fe4c1 Merge branch 'tab_powerline' of https://github.com/slfotg/kitty 2021-02-24 12:23:11 +05:30
Sam Foster
2a3cc71641 Made powerline tab_bar_style have different display options 2021-02-24 00:14:00 -06:00
Kovid Goyal
bd67814485 Fix building with asan on macOS 2021-02-23 17:06:00 +05:30
Kovid Goyal
40dbf7f1c8 Use log_error instead of print 2021-02-22 08:33:26 +05:30
Kovid Goyal
42a7023203 Fix #3332 2021-02-21 13:18:48 +05:30
Kovid Goyal
14b33a845e Avoid compiler warning about using main as a variable name 2021-02-21 11:20:10 +05:30
Kovid Goyal
56fcbb95ab Key encoding: in legacy mode use legacy encoding for a few more combinations
Some legacy terminal applications get confused seeing CSI u escape
codes. Since it is relatively common to press ctrl or shift and
space/enter/tab/backspace, emit the same bytes as traditional terminals
do for these common keys.
2021-02-21 11:14:25 +05:30
Kovid Goyal
de100ac67c DRYer 2021-02-20 11:39:31 +05:30
Kovid Goyal
2a96d2621c Use cleanup in a few more places to simplify the code 2021-02-19 18:53:30 +05:30
Kovid Goyal
a097f5df23 Use the gcc cleanup attribute in launcher 2021-02-19 18:34:12 +05:30
Kovid Goyal
6a901ea048 Forgot that wayland is not built on CI 2021-02-19 18:09:12 +05:30
Kovid Goyal
dbc1ade5a9 Fallback to importlib_resources on python 3.6 2021-02-19 18:02:15 +05:30
Kovid Goyal
c2a924a5ea Run all tests on the full frozen build using the frozen launcher
Much more comprehensive test coverage at the cost of slightly increasing
the frozen build size.
2021-02-19 17:57:59 +05:30
Kovid Goyal
e06d40cb31 Fix test suite getting type checked accidentally 2021-02-19 15:19:04 +05:30
Kovid Goyal
45d89cfe55 Install importlib.resources on python 3.6 2021-02-19 15:08:47 +05:30
Kovid Goyal
d45a8309cb Dont use VLAs in launcher.c 2021-02-19 15:04:49 +05:30
Kovid Goyal
9cd8637e9c Remove another use of __file__ 2021-02-19 14:49:07 +05:30
Kovid Goyal
38992e25d7 Make the tests into a package
Useful to make the tests runnable in a frozen build.
2021-02-19 14:35:25 +05:30
Kovid Goyal
f25b3c2aee Canonicalize resource pathnames in the frozen build 2021-02-19 13:59:33 +05:30
Kovid Goyal
e3e2261005 Fix resources path in macOS bundle 2021-02-19 13:57:58 +05:30
Kovid Goyal
38a7e77058 Add build test for filesystem locations 2021-02-19 13:42:20 +05:30
Kovid Goyal
a920919b13 Workaround for bug in libxkbcommon/Debian/Ubuntu on en_IN locale
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903373
2021-02-19 12:35:59 +05:30
Kovid Goyal
625f0f77bb Ensure disk cache is cleared 2021-02-19 09:43:57 +05:30
Kovid Goyal
12604072fc Allow querying number cached in ram from c code as well 2021-02-19 09:28:56 +05:30
Kovid Goyal
0341b64748 Allow caching of disk cache entries in RAM 2021-02-18 10:22:42 +05:30
Kovid Goyal
e0620fbb1d Also implement the bypy freeze on macOS 2021-02-17 22:01:09 +05:30
Kovid Goyal
9114bda24c Get the new bypy based freezing process working with linux builds 2021-02-17 15:50:53 +05:30
Kovid Goyal
4cf73204a2 Forgot to exclude modules 2021-02-16 13:57:23 +05:30
Kovid Goyal
55e7f69768 Use importlib.resources to enumerate kitten names 2021-02-16 13:48:02 +05:30
Kovid Goyal
d2a16bc8e8 ... 2021-02-16 13:14:36 +05:30
Kovid Goyal
5fdeb3b3b4 Use a temp dir as cache dir when running tests during freezing on linux 2021-02-16 13:07:45 +05:30
Kovid Goyal
9ad5ef8b2d Fix compilation on ancient Linux distros without sys/random.h 2021-02-16 12:39:18 +05:30
Kovid Goyal
c244bcd978 Allow overriding the location of the kitty base directory in frozen builds 2021-02-16 10:29:19 +05:30
Kovid Goyal
7eb8e1df79 Use importlib to load the shaders 2021-02-16 10:23:18 +05:30
Kovid Goyal
74c4e94c3d ... 2021-02-16 10:21:28 +05:30
Kovid Goyal
275b8ce2e7 Fix #3322 2021-02-15 21:27:52 +05:30
Kovid Goyal
ff1b0a7e1b Maybe it's uuid-dev instead 2021-02-15 16:44:59 +05:30
Kovid Goyal
39026bc45c Apparently fontconfig now depends on uuid 2021-02-15 16:39:07 +05:30
Kovid Goyal
3d9a95d0cd ... 2021-02-15 16:24:39 +05:30
Kovid Goyal
085bc09dfb Micro-optimization 2021-02-15 16:24:04 +05:30
Kovid Goyal
886309850f Dont add alpha when rendering alpha mask on canvas
Instead use the larger of the two alphas. This gives better results
for overlapping text, such as the infinite length ligature glyphs used
by FiraCode. I dont think adding ever gave better results anyway.
2021-02-15 16:08:06 +05:30
Kovid Goyal
ba005e991a Improve handling of infinite length ligatures in newer versions of FiraCode and CascadiaCode.
Now such ligatures are detected based on glyph naming convention.
This removes the gap in the ligatures at cell boundaries. However, at
least in Fira Code the infinite length ligature glyphs define a negative
left side bearing. This means they overlap when drawn consecutively,
leading to unsightly bumps at the joins.

Fixes #2695
2021-02-15 15:49:09 +05:30
Kovid Goyal
912c46fc57 Fix rendering of ligatures in the latest release of Cascadia code
For some reason it puts empty glyphs after the ligature glyph rather than before it.
There is a possibility this fix might break something else, we will see.
Fixes #3313
2021-02-15 11:57:57 +05:30
Kovid Goyal
5675944c0c Recognize remaining ASCII keys for legacy mode as well 2021-02-15 05:33:57 +05:30
Kovid Goyal
6b9c280214 Add a test for encoding of : as a legacy ascii key 2021-02-15 05:27:32 +05:30
Kovid Goyal
19b882a0bd Also handle : as a legacy ASCII key
Fixes #3315
2021-02-15 05:24:21 +05:30
Kovid Goyal
323d5dba7e SingleKey parsing requires ASCII lowercase 2021-02-15 04:55:51 +05:30
Kovid Goyal
cd9755ffb3 Sphinx: replace use of deprecated css_files 2021-02-15 04:35:24 +05:30
Kovid Goyal
fbcdf352ac Allow resizing of OS Window framebuffers to a single cell
This is much smaller than before and essentially works around the issue
of the text being scaled when the window is resized to small sizes. Also
has the nice side effect of making the code simpler for the panel
kitten. Fixes #3307
2021-02-14 22:17:41 +05:30
Kovid Goyal
015fe9054e Fix shifted keys not matching shortcuts in kittens
Broke after keyboard refactoring for new keyboard protocol. Now a key
event will match a shortcut specification if either the mods and key
match or mods without shift and shifted key match. Fixes #3314
2021-02-14 07:52:08 +05:30
Kovid Goyal
9a031c5b0c Bump versions for bundled deps 2021-02-12 12:29:38 +05:30
Kovid Goyal
de0f225c45 Fix #3299 2021-02-09 22:10:40 +05:30
Kovid Goyal
41533bffdd Merge branch 'build_doc' of https://github.com/spenczar/kitty 2021-02-09 07:45:25 +05:30
Spencer Nelson
cdf7c4bf97 Add two more build-time dependencies to the docs 2021-02-08 10:40:15 -08:00
Kovid Goyal
57db384953 Add packaging status to README 2021-02-06 12:10:30 +05:30
Kovid Goyal
9f0785a160 Add a link to the RFC 2021-02-05 11:36:03 +05:30
Kovid Goyal
4541cf8807 Another CodeQL warning 2021-02-05 10:41:35 +05:30
Kovid Goyal
fe07306ff1 Use a nicer decorator for functions that only need to be run once 2021-02-05 10:40:52 +05:30
Kovid Goyal
726d736aac Type check return value of cache_dir 2021-02-05 10:34:17 +05:30
Kovid Goyal
db0360dc81 Fix a bunch of CodeQL warnings 2021-02-05 10:05:54 +05:30
Kovid Goyal
4ba35d4a93 Clear cache_dir lru cache when testing 2021-02-05 09:56:17 +05:30
Kovid Goyal
1d51fca879 Python 3.6 compat 2021-02-05 09:49:46 +05:30
Kovid Goyal
67ca1902a0 Use a cache dir in the cwd on CI 2021-02-05 09:42:01 +05:30
Kovid Goyal
1ef326e220 Better error message 2021-02-05 09:29:56 +05:30
Kovid Goyal
0e483f81ac Compat for python < 3.8 2021-02-05 09:23:54 +05:30
Kovid Goyal
e969dea3b7 Remove unused function 2021-02-05 09:20:58 +05:30
Kovid Goyal
89b4f59efa Update changelog to note animation support 2021-02-05 09:20:02 +05:30
Kovid Goyal
95dc87cf04 Prevent stack overflows when recursing to coalesce frames 2021-02-05 09:12:08 +05:30
Kovid Goyal
3fc29e0d11 ... 2021-02-05 09:03:39 +05:30
Kovid Goyal
cc3b71154d Document the animation protocol 2021-02-05 09:00:19 +05:30
Kovid Goyal
e4e9e29949 Add a note about broadcast kitten to index 2021-02-05 06:33:48 +05:30
Kovid Goyal
7a1785e1e8 Get chunked loading working with frames 2021-02-04 21:04:44 +05:30
Kovid Goyal
5d2baaac38 ... 2021-02-04 17:52:18 +05:30
Kovid Goyal
b479510f6c Allow controlling the number of loops in icat 2021-02-04 17:47:53 +05:30
Kovid Goyal
8033e9fef5 Fix error checking when rendering single frame 2021-02-04 17:16:52 +05:30
Kovid Goyal
83b8c8ea12 Reduce frequency of key frames slightly 2021-02-04 17:08:06 +05:30
Kovid Goyal
a447ba7d76 Fix typo in coalesce function causing incorrect coalesce for more than one level of recursion 2021-02-04 16:50:13 +05:30
Kovid Goyal
450e1c2f95 Use key frames for performance 2021-02-04 16:20:30 +05:30
Kovid Goyal
cf3a01f502 Handle images whose first frame is smaller than the canvas 2021-02-04 15:57:49 +05:30
Kovid Goyal
3925e18964 Use rgba data for opaque animations that uses blended frames 2021-02-04 14:39:06 +05:30
Kovid Goyal
2650c7dd9e Avoid calculation when over px is transparent 2021-02-04 14:26:10 +05:30
Kovid Goyal
0f18fedf13 Add support for animations to icat 2021-02-04 14:18:47 +05:30
Kovid Goyal
f18a56682f Fix animations not resuming when OS window is hidden and then shown 2021-02-04 13:34:27 +05:30
Kovid Goyal
af94e07618 Cache exe lookups 2021-02-04 11:36:59 +05:30
Kovid Goyal
7eba3b6cbc Use the magick executable from IMv7 preferentially 2021-02-04 11:34:32 +05:30
Kovid Goyal
e5ef9d9062 Ensure IM outputs multiple images in rgba format 2021-02-04 11:23:54 +05:30
Kovid Goyal
b72dbc973d Allow controlling how many times an animation will loop 2021-02-03 20:54:43 +05:30
Kovid Goyal
55d0e23c38 ... 2021-02-03 19:29:46 +05:30
Kovid Goyal
d3489712a6 Store mode data per frame 2021-02-03 18:00:36 +05:30
Kovid Goyal
56193f6902 Handle resizing of animated images with blended frames correctly 2021-02-03 17:51:38 +05:30
Kovid Goyal
2dad179285 ... 2021-02-03 16:00:31 +05:30
Kovid Goyal
19f0e2303d Refactor to store frame deltas instead of fully coalesced frames
Trades CPU usage for cache/memory space
2021-02-03 15:49:33 +05:30
Kovid Goyal
c152624634 Rename state variable to be closer to its actual purpose 2021-02-02 09:00:28 +05:30
Kovid Goyal
212906cf7d gap should be gap to next frame not gap from previous frame
Matches usage in the GIF format and makes the concept of gapless
clearer.
2021-02-01 17:08:59 +05:30
Kovid Goyal
bb5c5a8e4f Allow gapless frames 2021-02-01 16:22:36 +05:30
Kovid Goyal
9cf5348c36 Modify ImageMagick wrapper to handle animated images 2021-02-01 14:12:26 +05:30
Kovid Goyal
edf4e14e4c Work on animation support for icat 2021-01-31 20:58:43 +05:30
Kovid Goyal
8fa737f01c Rescan for animated images on various events 2021-01-31 20:58:43 +05:30
Kovid Goyal
f16e22fbec Forgot to convert gaps to monotonic_t 2021-01-31 20:58:43 +05:30
Kovid Goyal
19e0406459 Wire up animation state tracking 2021-01-31 20:58:43 +05:30
Kovid Goyal
354d7c2740 ... 2021-01-31 20:58:42 +05:30
Kovid Goyal
00edb6058e Start work on implementing frame transitions
Also ensure that the correct OS Window is current when uploading images
to GPU.
2021-01-31 20:58:42 +05:30
Kovid Goyal
597267d1d0 root frame gap should be set to the gap of the first received frame 2021-01-31 20:58:42 +05:30
Kovid Goyal
ad4665e638 Add support for newer keys to GraphicsCommand serializer 2021-01-31 20:58:42 +05:30
Kovid Goyal
b21850dd15 Implement updating of current frame on GPU 2021-01-31 20:58:42 +05:30
Kovid Goyal
4098f2d383 Add quota enforcement testing 2021-01-31 20:58:42 +05:30
Kovid Goyal
5eba754c60 Implement animation control escape codes 2021-01-31 20:58:42 +05:30
Kovid Goyal
b35084062d Remove old data from cache when re-using image objects 2021-01-31 20:58:42 +05:30
Kovid Goyal
1d20472759 Avoid a cache move when deleting frames 2021-01-31 20:58:42 +05:30
Kovid Goyal
c0e336a971 DRYer 2021-01-31 20:58:42 +05:30
Kovid Goyal
d76e757d53 Implement delete for frames 2021-01-31 20:58:42 +05:30
Kovid Goyal
43ea58ef48 Start work on delete for frames 2021-01-31 20:58:42 +05:30
Kovid Goyal
17f485d614 Basic frame loading works 2021-01-31 20:58:41 +05:30
Kovid Goyal
35f3312a1e Use shorter cache keys 2021-01-31 20:58:41 +05:30
Kovid Goyal
ca3c49099f Start work on tests for frame loading 2021-01-31 20:58:41 +05:30
Kovid Goyal
6631bb0eac Make the image dict more complete 2021-01-31 20:58:41 +05:30
Kovid Goyal
0adbbc6d62 Implement loading of frame animation data 2021-01-31 20:58:41 +05:30
Kovid Goyal
cc4f9ddad8 More work an animation handling 2021-01-31 20:58:41 +05:30
Kovid Goyal
5a182d3d13 Store image data in a disk cache 2021-01-31 20:58:41 +05:30
Kovid Goyal
c60d3af60b Add links to locations for discussion to README
Proof of reddit account:
1e2b9113-2d30-48f0-8f2f-f7a2bcbd4895
2021-01-31 20:54:21 +05:30
Kovid Goyal
4e67a92ec4 DRYer 2021-01-31 12:26:54 +05:30
Kovid Goyal
e43c3118d4 ... 2021-01-31 12:14:36 +05:30
Kovid Goyal
ffc0919790 Allow setting colors when creating windows using the launch command. 2021-01-31 12:13:27 +05:30
Kovid Goyal
2af145879e Make color spec parsing re-useable 2021-01-31 12:10:45 +05:30
Kovid Goyal
35517d3e6f Allow using the full launch command in session files
Note this is slightly backward incompatible.
2021-01-31 11:37:00 +05:30
Kovid Goyal
e9e8ef7210 ssh kitten: Allow using python instead of the shell on the server 2021-01-31 09:04:46 +05:30
Kovid Goyal
ee198ca863 Add versionadded notes 2021-01-31 07:42:01 +05:30
Kovid Goyal
0681e6a9b6 ... 2021-01-31 07:35:58 +05:30
Kovid Goyal
965a6dfd30 Add some more kittens to the list 2021-01-31 07:18:27 +05:30
Kovid Goyal
d55fde9eea Use EINTR safe wrappers for open() and shm_open() 2021-01-31 07:02:11 +05:30
Kovid Goyal
231f054bc3 Merge branch 'master' of https://github.com/dlh/kitty 2021-01-31 06:47:01 +05:30
Daniel Lee Harple
43fafd85f8 Allow cancellation of "detach_window ask" 2021-01-30 19:21:11 -05:00
Kovid Goyal
8a5a7b8807 Merge branch 'master' of https://github.com/dlh/kitty 2021-01-30 10:07:16 +05:30
Daniel Lee Harple
2c24cc1341 Allow quoted args to toggle_marker 2021-01-29 17:52:24 -05:00
Kovid Goyal
0fc93118f2 Make the error message when failing to get monitor display name more informative 2021-01-29 12:45:22 +05:30
Kovid Goyal
ac2a33d09f Silence the errors about OSC 7
Up to now this poorly designed and completely unnecessary escape code
was relegated to only GNOME, however, off late Apple has started using
it as well, so silently ignore it, instead of spamming error messages
for it.
2021-01-29 12:43:41 +05:30
Kovid Goyal
68423b3603 Fix compiler warning on newer Xcode
Fixes #3271
2021-01-29 11:29:29 +05:30
Kovid Goyal
6d18223f17 Use an id for keyboard focus tracking as well 2021-01-29 11:22:39 +05:30
Kovid Goyal
0443e5ad7f Wayland: Use window ids rather than pointers to track windows for key repeat
Might fix #3266
2021-01-29 08:43:00 +05:30
Kovid Goyal
4619921780 Add a link to the thread with discussion on using vim as pager 2021-01-29 08:35:15 +05:30
Kovid Goyal
df89266c03 diff kitten: Implement recursive diff over SSH
Fixes #3268
2021-01-28 14:23:56 +05:30
Kovid Goyal
36ca3838a6 Fix #3265 2021-01-27 17:19:06 +05:30
davidak
60ce88cf25 Update Nix package link 2021-01-27 13:43:21 +05:30
Kovid Goyal
5a2f2767ad Fix window icon not working on X11 with 64bits
Apparently on X11 the maximum icon size is 128x128. 256x256 is too
large for the X11 protocol because the X server unserializes the icons
using "unsigned long" which is 64 bits on Linux. So we have to use
64bits per pixel instead of 32, with 32bits padded to 0.

While there I also got rid of the kitty.rgba file replacing it with a
128x128 PNG file.

Fixes #3260
2021-01-25 20:54:19 +05:30
Kovid Goyal
6e73d3fac8 Fix extra space at bottom of OS window when using the fat layout with the tab bar at the top
Fix #3258
2021-01-25 09:30:14 +05:30
Kovid Goyal
d08ae5466d Dont use a function 2021-01-24 12:57:39 +05:30
Kovid Goyal
fc175732e1 Fix CodeQL warning 2021-01-24 12:48:47 +05:30
Kovid Goyal
dfe41217f8 Start work on allowing images to have multiple frames 2021-01-24 12:37:21 +05:30
Kovid Goyal
4870d07cbb Refactor handle_add_command to make it more readable 2021-01-24 12:00:35 +05:30
Kovid Goyal
2dd9fd83a3 Add some text to the control reference 2021-01-23 13:44:10 +05:30
Kovid Goyal
0b93153656 Add the I key to the control data reference 2021-01-23 13:20:32 +05:30
Kovid Goyal
714d64c417 Get type checking working with mypy 0.80
Add workaround for https://github.com/python/typeshed/issues/4964
2021-01-23 09:25:31 +05:30
Kovid Goyal
b823af00ff Get rid of a bunch of noqas 2021-01-22 22:04:53 +05:30
Kovid Goyal
77f456bd9c Fix #3253 2021-01-22 21:06:58 +05:30
Kovid Goyal
874fe2ed72 ... 2021-01-22 20:36:39 +05:30
Kovid Goyal
786f8c7b1f macOS: Ensure font size is correct if the OS moves the newly created window to a different monitor after it is shown 2021-01-22 20:22:09 +05:30
Kovid Goyal
0c784346cc Update blurb 2021-01-21 12:14:44 +05:30
Kovid Goyal
2ab0ff74c6 ... 2021-01-21 11:34:21 +05:30
Kovid Goyal
22cb9b9798 Add a note about kbs = backspace 2021-01-21 11:29:01 +05:30
Kovid Goyal
2ee1a366fd Also assert non-negative params for SET_MODE 2021-01-21 07:21:23 +05:30
Kovid Goyal
f9844ba3b0 Allow negative numbers in CSI codes 2021-01-21 07:06:43 +05:30
Kovid Goyal
7cea233de3 - is not a CSI start modifier 2021-01-21 06:44:18 +05:30
Kovid Goyal
e4d8aac3d5 Make CSI parsing a bit more spec compliant
Now the full list of secondary characters (intermediate bytes) is used from ECMA 48
Also the codes that accept only one parameter now report errors when
multiple parameters are passed.
2021-01-21 06:41:27 +05:30
Kovid Goyal
354d381372 Oops forgot to regen glfw wrapper 2021-01-21 05:37:13 +05:30
Kovid Goyal
60e589f775 Recognize Hyper key
Also use only one implementation for detecting if a key is a modifier
key
2021-01-21 05:33:14 +05:30
Kovid Goyal
f6d4b8e0b0 typo 2021-01-20 18:30:22 +05:30
Kovid Goyal
5fafd70b0f Fix detection of ASCII control chars in key event text 2021-01-20 17:35:24 +05:30
Kovid Goyal
dcfeab8461 Remove un-needed code
Space is now handled as legacy ascii key
2021-01-20 16:08:15 +05:30
Kovid Goyal
2a8e8d4b38 Fix #3252 2021-01-20 16:02:28 +05:30
Kovid Goyal
e6644aebcb Add a test to ensure caps lock does not produce bytes in legacy mode 2021-01-19 09:19:34 +05:30
Kovid Goyal
654cd54363 Add the ISO level 3 and 5 shift keys to functional keys 2021-01-19 09:11:44 +05:30
Kovid Goyal
16005d43e8 Dont send unknown keys that dont generate text
Fixes #3249
2021-01-19 09:01:52 +05:30
Kovid Goyal
b08c93032b ... 2021-01-19 08:58:06 +05:30
Kovid Goyal
dd08896c70 Lock keys should not be sent to applications in legacy mode 2021-01-19 08:55:01 +05:30
Kovid Goyal
f0ae5dfc73 ... 2021-01-18 16:31:09 +05:30
Kovid Goyal
0adc7e4d4b fix typo 2021-01-18 16:30:02 +05:30
Kovid Goyal
5c2056a7cb Fix parsing of + as a shortcut 2021-01-17 19:56:32 +05:30
Kovid Goyal
f0e7d26409 Fix typo 2021-01-17 19:12:12 +05:30
Kovid Goyal
95ebeebb84 Mention alternate screen mode in the quickstart 2021-01-17 11:41:35 +05:30
Kovid Goyal
a88875f98e ... 2021-01-17 11:17:31 +05:30
Kovid Goyal
39da92d8ab Now that glfw reports shifted keys, use it when encoding key events 2021-01-17 11:14:44 +05:30
Kovid Goyal
089d358031 ... 2021-01-17 09:06:03 +05:30
Kovid Goyal
6a4885df17 Add changelog entries for the new keyboard features 2021-01-17 08:52:10 +05:30
Kovid Goyal
d45d553eaf When using a non-US keyboard layout and pressing ctrl+key when the key matches an English key in the default layout, send that to the program running in the terminal automatically
See #2000
2021-01-17 08:25:19 +05:30
Kovid Goyal
2cbbd84987 Clean up some formatting 2021-01-17 07:34:35 +05:30
Kovid Goyal
1016586611 Fix compiler warning 2021-01-17 07:28:22 +05:30
Kovid Goyal
6bbf014152 ... 2021-01-17 07:24:12 +05:30
Kovid Goyal
4fea7bd8ef Fix building on systems with xkbcommon < 1.0 2021-01-17 07:22:21 +05:30
Kovid Goyal
aa63bf71cf macOS: Add menu items to close the OS window and the current tab
Fixes #3246
2021-01-17 06:49:25 +05:30
Kovid Goyal
4c9bd368c6 Implement alternate keys on macOS 2021-01-16 20:52:16 +05:30
Kovid Goyal
b1c1c497e4 More character key name aliases 2021-01-16 20:52:16 +05:30
Kovid Goyal
86ce72e725 Port the Cocoa backend to use unicode key numbers 2021-01-16 20:52:16 +05:30
Kovid Goyal
ae37b4b09b Add more character key aliases 2021-01-16 20:52:15 +05:30
Kovid Goyal
5ffbee1e8c Use shifted keys to match shortcuts as well 2021-01-16 20:52:15 +05:30
Kovid Goyal
19a3635c64 Dont send release events for kitty shortcuts to children 2021-01-16 20:52:15 +05:30
Kovid Goyal
3c648c05ec Report shifted and alternate keys from the XKB backend 2021-01-16 20:52:15 +05:30
Kovid Goyal
5607a3c2ed ... 2021-01-16 20:52:15 +05:30
Kovid Goyal
cf04a5a036 Add tests for encode/decode roundtripping 2021-01-16 20:52:15 +05:30
Kovid Goyal
c12680895e Fix key state tracking regression 2021-01-16 20:52:15 +05:30
Kovid Goyal
0163bf3edb Fix enter/tab/backspace not being reported in all keys mode 2021-01-16 20:52:15 +05:30
Kovid Goyal
af0a24c702 Make key demo output prettier 2021-01-16 20:52:15 +05:30
Kovid Goyal
7ea1deba8f Clean up code tables 2021-01-16 20:52:15 +05:30
Kovid Goyal
b60c84ecdc Add note on detection of support 2021-01-16 20:52:15 +05:30
Kovid Goyal
e09ed038e2 Port key handling in more kittens
Also fix decoding of enter/f3 key events
2021-01-16 20:52:15 +05:30
Kovid Goyal
9c6ba213f9 Fix key handling in diff kitten 2021-01-16 20:52:14 +05:30
Kovid Goyal
66341111e6 keyboard mode change should happen only in alternate screen 2021-01-16 20:52:14 +05:30
Kovid Goyal
abc1e3f289 Remove the function used to init glfw key events
Instead use C99 struct initializers. Much less error prone.
2021-01-16 20:52:14 +05:30
Kovid Goyal
027c5a57f1 Work on porting kittens to use new key infrastructure
Also move type definitions into their own module
2021-01-16 20:52:14 +05:30
Kovid Goyal
0714fd376b Fix handling of ctrl key in legacy mode
Also change the glfw constants used for the modifiers to match those
used in the terminal encoding. Less likely to make mistakes translating
that way.
2021-01-16 20:52:14 +05:30
Kovid Goyal
39f41faf9f Dont send events for modifier keys unless in all key mode 2021-01-16 20:52:14 +05:30
Kovid Goyal
6b2ffc774f Port shortcut and sequence matching code 2021-01-16 20:52:14 +05:30
Kovid Goyal
f94a5f4e5c Add a Quickstart section to the protocol documentation 2021-01-16 20:52:14 +05:30
Kovid Goyal
c421fd56be Ensure typing in shell works in disambiguate mode 2021-01-16 20:52:14 +05:30
Kovid Goyal
11de87d9d9 It's ok that Enter and F3 share a number
Enter has u has trailer, F3 has either ~ or 1R
2021-01-16 20:52:14 +05:30
Kovid Goyal
8f5d42fa11 Python wrapper for key events from window system 2021-01-16 20:52:14 +05:30
Kovid Goyal
e14fcf5590 Clean up docs 2021-01-16 20:52:14 +05:30
Kovid Goyal
f5b81c7ed6 ... 2021-01-16 20:52:13 +05:30
Kovid Goyal
47a901385f Implement reporting of all keys as escape codes with text 2021-01-16 20:52:13 +05:30
Kovid Goyal
819bd5cd70 Tests for alternate key reporting 2021-01-16 20:52:13 +05:30
Kovid Goyal
753ad68ca9 Add tests for event type reporting 2021-01-16 20:52:13 +05:30
Kovid Goyal
5498f4e526 ... 2021-01-16 20:52:13 +05:30
Kovid Goyal
83a01b6bf4 Add tests for the disambiguate flag 2021-01-16 20:52:13 +05:30
Kovid Goyal
c519013b20 Add tests for legacy letter key encodings 2021-01-16 20:52:13 +05:30
Kovid Goyal
78d45eb161 Port another use of the old key API 2021-01-16 20:52:13 +05:30
Kovid Goyal
eeacac227a Add tests for functional KP keys 2021-01-16 20:52:13 +05:30
Kovid Goyal
529e9f83f7 Finish up functional key tests 2021-01-16 20:52:13 +05:30
Kovid Goyal
5297f7474d Remove another use of GLFW_KEY 2021-01-16 20:52:13 +05:30
Kovid Goyal
e06b48a344 Identify SS3 in the docs 2021-01-16 20:52:13 +05:30
Kovid Goyal
7ba57ebf62 esc also needs a low number 2021-01-16 20:52:12 +05:30
Kovid Goyal
1ec9a8b777 Fix parsing of shortcuts to support the new keys 2021-01-16 20:52:12 +05:30
Kovid Goyal
1690718710 More removal of GLFW_KEY_ constants 2021-01-16 20:52:12 +05:30
Kovid Goyal
774a6c8c8b Remove glfw key constants 2021-01-16 20:52:12 +05:30
Kovid Goyal
f06eee8fe1 Define special numbers in one place only 2021-01-16 20:52:12 +05:30
Kovid Goyal
2b12bcc07f Docs for legacy functional encoding 2021-01-16 20:52:12 +05:30
Kovid Goyal
a30ea2b7f8 Implement progressive enhancement of key event reporting 2021-01-16 20:52:12 +05:30
Kovid Goyal
295e8db04c remove unused code 2021-01-16 20:52:12 +05:30
Kovid Goyal
b63ae10a09 Start documenting new keyboard protocol 2021-01-16 20:52:12 +05:30
Kovid Goyal
c8a9336160 Code to encode key events 2021-01-16 20:52:12 +05:30
Kovid Goyal
c0b6078438 Add more keypad keys 2021-01-16 20:52:11 +05:30
Kovid Goyal
ccce8c32a3 Mapping to unicode and back for XKB keys 2021-01-16 20:52:11 +05:30
Kovid Goyal
8f8be9c2b1 Add notice to not edit generated code 2021-01-16 20:52:11 +05:30
Kovid Goyal
eb8e2225e5 Add some more functional keys
Also define aliases for XKB codes
2021-01-16 20:52:11 +05:30
Kovid Goyal
397d7d044b Change key data type in some functions 2021-01-16 20:52:11 +05:30
Kovid Goyal
a681162326 Start work on supporting arbitrary unicode keys 2021-01-16 20:52:11 +05:30
Kovid Goyal
f00ec0ff60 Merge branch 'm1-build-fix' of https://github.com/pjjw/kitty 2021-01-15 10:52:01 +05:30
Peter Woodman
35982a9e58 Make is_arm predicate work on macos 2021-01-15 00:09:24 -05:00
Kovid Goyal
cf0bdf4d59 Add another couple of integrations 2021-01-14 06:36:18 +05:30
Kovid Goyal
8a9d43e84d Changelog item for last PR 2021-01-13 06:58:01 +05:30
Kovid Goyal
578bf963e3 Merge branch 'master' of https://github.com/quentin-fox/kitty 2021-01-13 06:57:25 +05:30
Quentin Fox
292c4ce450 add menu item to close window 2021-01-12 19:55:51 -05:00
Kovid Goyal
8ea589e5a3 Change blurb wording slightly 2021-01-12 20:01:44 +05:30
Kovid Goyal
ad09ccb0f2 Panel kitten: Allow setting WM_CLASS
Fixes #3233
2021-01-12 04:49:45 +05:30
Kovid Goyal
edfc6903ce Remove unused code 2021-01-08 13:32:52 +05:30
Kovid Goyal
b94d2b27f4 Refactor single key config parsing to use a special type 2021-01-07 18:07:17 +05:30
Kovid Goyal
31cb68840a Merge branch 'bugfix-unicode-names-input' of https://github.com/purxiz/kitty
Fixes #3221
2021-01-07 14:18:24 +05:30
purxiz
89c62377da fix type error
I moved the location of the check for an overflowing index to avoid a type error that was revealed by mypy. I also think this is a better place to put it from a code standpoint in general...
2021-01-06 13:24:38 -06:00
purxiz
85afda8832 fixes incorrect hint base
The bases for the hint were being decoded as base 16, despite being displayed as base 36 (0-9, a-z). This fix makes it so typing 'search string .index' returns the unicode char at the expected index, based on what is displayed by the program.

It also slightly changes the behavior. Before, only the selected result would appear. For example, musical note `musical note .18` would only show a single result, since there was only a single result at index 18. Now, searching by index doesn't remove codepoints/results, it simply highlights the result at the correct index for you.
2021-01-06 13:07:41 -06:00
Kovid Goyal
5184e4bde3 Fix #3217 2021-01-06 22:31:09 +05:30
Kovid Goyal
133b580262 Avoid error prints when rendering the space glyph and freetype fails to load it
Also a micro-optimization, since there is no need to actually render the
space glyph
2021-01-05 12:21:06 +05:30
Kovid Goyal
3e76cf87ce Linux: Fix rendering of emoji followed by the graphics variation selector not being colored with some fonts
Harfbuzz, for some reason has started rendering variation selector
glyphs. These fail to load for some fonts. https://github.com/harfbuzz/harfbuzz/issues/2804

Fixes #3211
2021-01-05 09:35:21 +05:30
Kovid Goyal
f72ff73344 Correct return type 2021-01-05 09:17:17 +05:30
Kovid Goyal
9aae346ab5 Better error message when failing to load glyph 2021-01-05 09:10:35 +05:30
Kovid Goyal
ca65ad6fa3 Inline qsort
Cleaner, more local code and faster sorting by virtue of inlining the
comparisons. What's not to like.
2021-01-04 14:14:15 +05:30
Kovid Goyal
0f4156c564 ... 2021-01-04 13:15:29 +05:30
Kovid Goyal
3a0d3dc0b3 Slightly improved command line 2021-01-04 13:14:14 +05:30
Kovid Goyal
d68c338304 Wait for write and check data, fixes test failure 2021-01-04 12:27:26 +05:30
Kovid Goyal
82f8c59bc7 ... 2021-01-04 12:18:42 +05:30
Kovid Goyal
c55f485166 Add an example of using the remote control protocol from a shell script 2021-01-04 12:17:20 +05:30
Kovid Goyal
2762488c81 Remove double increment 2021-01-03 21:10:37 +05:30
Kovid Goyal
ac13ae727f Fix failing test
We cant know what the size of the disk cache file is,
since defragmentation occurs asynchronously
2021-01-03 21:05:08 +05:30
Kovid Goyal
1b59a1c421 Finish tests of disk cache 2021-01-03 17:36:40 +05:30
Kovid Goyal
df00e9545d Add some more ensure_state() 2021-01-03 12:13:08 +05:30
Kovid Goyal
d1496f1eb5 Use O_TMPFILE when available 2021-01-03 07:07:50 +05:30
Kovid Goyal
14d9bcb08a Go back to nanosleep since it is in POSIX 2021-01-03 06:45:53 +05:30
Kovid Goyal
c869774c58 More tests for the disk cache 2021-01-03 06:22:48 +05:30
Kovid Goyal
18679348b2 Use usleep rather than nanosleep 2021-01-03 05:00:40 +05:30
Kovid Goyal
b3ed4c3f40 Simplify implementation of REP
Also make it align more with the standard by using the actual last drawn
graphics character rather than the character before the cursor
2021-01-03 04:38:02 +05:30
Kovid Goyal
8f58140419 Start work on tests for disk cache 2021-01-03 04:28:48 +05:30
Kovid Goyal
bc8a351558 Add repeat character to client.py 2021-01-02 12:49:33 +05:30
Kovid Goyal
9ae198ef8f Double clicking on empty tab bar area now opens a new tab
Fixes #3201
2021-01-02 11:45:18 +05:30
Kovid Goyal
bc86bc91f7 Auto-defrag cache file 2021-01-02 11:32:38 +05:30
Kovid Goyal
a60f347648 Merge branch 'kitten-diff-select-fg-none' of https://github.com/tomaskrizek/kitty 2021-01-02 09:01:25 +05:30
Tomas Krizek
dbe44c9e4b kitten/diff: allow specifying none color for select_fg
Allow diff kitten to not override foreground color for selections.

Related #1358
2021-01-01 23:25:06 +01:00
Tomas Krizek
fb8b9b3933 kitty/config_data: remove duplicate function
selection_foreground() serves the exact same purpose as
to_color_or_none()
2021-01-01 23:23:47 +01:00
Kovid Goyal
56ebc9fa92 Add a link to ctx.graphics 2021-01-01 15:20:47 +05:30
Kovid Goyal
7f73609c77 Update total_size when removing cache items 2021-01-01 14:31:57 +05:30
Kovid Goyal
3ac70042c1 Expose grman disk cache to python 2021-01-01 14:19:10 +05:30
Kovid Goyal
61637a7a74 Simplified API t read from disk cache
Avoids the need to pass a custom allocator by using malloc
2021-01-01 14:16:26 +05:30
Kovid Goyal
49562e96cc Python wrappers for the disk cache methods 2021-01-01 14:08:23 +05:30
Kovid Goyal
58b1868536 When cache is emptied clear disk file to avoid fragmentation 2021-01-01 13:15:21 +05:30
Kovid Goyal
1cad40e977 ... 2021-01-01 12:03:09 +05:30
Kovid Goyal
9fbf23fdcc Implement simple defrag for on-disk cache 2021-01-01 11:54:13 +05:30
Kovid Goyal
55e53db184 ... 2020-12-31 15:38:57 +05:30
Kovid Goyal
f790e8bd47 DRYer 2020-12-31 15:33:04 +05:30
Kovid Goyal
54de2d177e Enforce max key size
Also allocate it dynamically
2020-12-31 15:30:55 +05:30
Kovid Goyal
ec96771e4c track total size and since each cache has its own writer thread store current key per thread 2020-12-31 15:24:25 +05:30
Kovid Goyal
99d2647335 Code to write to cache file 2020-12-31 15:18:30 +05:30
Kovid Goyal
c346cbc252 Use a single file for the disk cache
This has the advantage that on crash it is automatically cleaned
2020-12-31 13:54:33 +05:30
Kovid Goyal
3c77290c2c Code to get random bytes in C, cross-platform 2020-12-31 11:26:22 +05:30
Kovid Goyal
72d193e852 Fix python3.7 fork registration not working 2020-12-31 10:38:26 +05:30
Kovid Goyal
1f7499e841 Detect more types of BSD 2020-12-31 10:26:15 +05:30
Kovid Goyal
c486fbb7c3 Add some aliases for shift key shenanigans 2020-12-30 21:09:03 +05:30
Kovid Goyal
fe1050fc0e More work on disk cache 2020-12-30 14:26:38 +05:30
Kovid Goyal
3162d391cc Start work on disk cache 2020-12-29 19:16:21 +05:30
Kovid Goyal
e2d61ab5be Fix error handling for pthread create 2020-12-29 15:53:40 +05:30
Kovid Goyal
2a026de526 More sophisticated PATH resolution for the launch command 2020-12-29 11:51:17 +05:30
Kovid Goyal
c1b7023e3a Look in ~/.local/bin preferentially 2020-12-29 11:50:11 +05:30
Kovid Goyal
175ff4b955 DRYer 2020-12-29 11:36:30 +05:30
Kovid Goyal
65361d56c4 Use find_exe() for resolving editor as well
Avoids having to exec the shell in most cases
2020-12-29 11:33:42 +05:30
Kovid Goyal
08fae7a0ac Add sbin to default paths 2020-12-29 10:50:31 +05:30
Kovid Goyal
a7e9030c12 Make finding ImageMagick a bit more robust on macOS 2020-12-29 10:48:26 +05:30
Kovid Goyal
aa8282f8f2 Update actual terminfo files from last PR
Also add entry to changelog
2020-12-29 10:03:56 +05:30
Kovid Goyal
7155400eb5 Merge branch 'bawr/terminfo-u6789' of https://github.com/bawr/kitty 2020-12-29 10:02:17 +05:30
Kovid Goyal
6760e38d93 Callback to create tempdir in cache 2020-12-29 10:00:34 +05:30
Bartosz Wróblewski
6bbe995d64 Generate u[6789] with terminfo.py
Should not hurt anything, it's just documenting kitty's existing VT220 compatibility.
2020-12-28 14:05:25 -08:00
Kovid Goyal
85bc8b61df Make wm_class/wm_name available in @ ls output 2020-12-26 10:46:07 +05:30
Kovid Goyal
a235509fa1 Make aliasing ssh kitten more prominent 2020-12-24 13:56:17 +05:30
Kovid Goyal
2e5b595a82 Clarify color table docs 2020-12-24 13:54:09 +05:30
Kovid Goyal
5f8dee8384 Add support for the color settings stack that XTerm copied from us without acknowledgement and decided to use incompatible escape codes for.
Completely in keeping with that project's past behavior.
See https://github.com/kovidgoyal/kitty/issues/879

XTerm announcement:
https://www.mail-archive.com/xorg@lists.x.org/msg06419.html
2020-12-21 21:39:05 +05:30
Kovid Goyal
e97f1a4310 Have the save/restore colors escape codes also save restore the ANSI color table 2020-12-21 19:38:03 +05:30
Kovid Goyal
c3c5a5446f Add window_id and window_title fields to --match-tab 2020-12-20 19:39:09 +05:30
483 changed files with 103154 additions and 74883 deletions

6
.gitattributes vendored
View File

@@ -1,6 +1,5 @@
kitty/wcwidth-std.h linguist-generated=true
kitty/emoji.h linguist-generated=true
kitty/keys.h linguist-generated=true
kitty/charsets.c linguist-generated=true
kitty/key_encoding.py linguist-generated=true
kitty/unicode-data.c linguist-generated=true
@@ -8,6 +7,11 @@ kitty/rgb.py linguist-generated=true
kitty/gl-wrapper.* linguist-generated=true
kitty/glfw-wrapper.* linguist-generated=true
kitty/parse-graphics-command.h linguist-generated=true
kitty/options/types.py linguist-generated=true
kitty/options/parse.py linguist-generated=true
kitty/options/to-c-generated.h linguist-generated=true
kittens/diff/options/types.py linguist-generated=true
kittens/diff/options/parse.py linguist-generated=true
glfw/*.c linguist-vendored=true
glfw/*.h linguist-vendored=true
kittens/unicode_input/names.h linguist-generated=true

1
.github/FUNDING.yml vendored
View File

@@ -1,3 +1,4 @@
github: kovidgoyal
patreon: kovidgoyal
liberapay: kovidgoyal
custom: https://sw.kovidgoyal.net/kitty/support.html

View File

@@ -17,17 +17,15 @@ Steps to reproduce the behavior:
3. ZZZ
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Environment details**
OS: Name and version of operating system(s)
```
Output of kitty --debug-config
Press Ctrl+Shift+F6 (cmd+option+comma on macOS) in kitty, to copy debug output about kitty and its
configuration to the clipboard and paste it here.
On older versions of kitty, run kitty --debug-config instead
```
**Additional context**

View File

@@ -30,37 +30,45 @@ def install_deps():
print('Installing kitty dependencies...')
sys.stdout.flush()
if is_macos:
items = (x.strip() for x in open('Brewfile').readlines() if not x.startswith('#'))
run('brew', 'install', *items)
items = (x.split()[1].strip('"') for x in open('Brewfile').readlines() if x.strip().startswith('brew '))
openssl = 'openssl'
import ssl
if ssl.OPENSSL_VERSION_INFO[0] == 1:
openssl += '@1.1'
run('brew', 'install', 'fish', openssl, *items)
else:
run('sudo apt-get update')
run('sudo apt-get install -y libgl1-mesa-dev libxi-dev libxrandr-dev libxinerama-dev'
' libxcursor-dev libxcb-xkb-dev libdbus-1-dev libxkbcommon-dev libharfbuzz-dev'
' libpng-dev liblcms2-dev libfontconfig-dev libxkbcommon-x11-dev libcanberra-dev')
run('sudo apt-get install -y libgl1-mesa-dev libxi-dev libxrandr-dev libxinerama-dev ca-certificates'
' libxcursor-dev libxcb-xkb-dev libdbus-1-dev libxkbcommon-dev libharfbuzz-dev libx11-xcb-dev zsh'
' libpng-dev liblcms2-dev libfontconfig-dev libxkbcommon-x11-dev libcanberra-dev librsync-dev uuid-dev'
' zsh bash dash')
# for some reason these directories are world writable which causes zsh
# compinit to break
run('sudo chmod -R og-w /usr/share/zsh')
if is_bundle:
install_bundle()
else:
if is_macos:
# needed for zlib for pillow, should not be needed after pillow 8.0
os.environ['PKG_CONFIG_PATH'] = '/usr/local/opt/zlib/lib/pkgconfig'
run('pip3 install Pillow pygments')
cmd = 'python3 -m pip install Pillow pygments'
if sys.version_info[:2] < (3, 7):
cmd += ' importlib-resources dataclasses'
run(cmd)
def build_kitty():
python = shutil.which('python3') if is_bundle else sys.executable
cmd = '{} setup.py build --verbose'.format(python)
cmd = f'{python} setup.py build --verbose'
if os.environ.get('KITTY_SANITIZE') == '1':
cmd += ' --debug --sanitize'
run(cmd)
def test_kitty():
run('./kitty/launcher/kitty +launch test.py')
run('./test.py')
def package_kitty():
py = 'python3' if is_macos else 'python'
run(py + ' setup.py linux-package --update-check-interval=0 --verbose')
python = 'python3' if is_macos else 'python'
run(f'{python} setup.py linux-package --update-check-interval=0 --verbose')
if is_macos:
run('python3 setup.py kitty.app --update-check-interval=0 --verbose')
run('kitty.app/Contents/MacOS/kitty +runpy "from kitty.constants import *; print(kitty_exe())"')
@@ -76,11 +84,11 @@ def replace_in_file(path, src, dest):
def setup_bundle_env():
global SW
os.environ['SW'] = SW = '/Users/Shared/kitty-build/sw/sw' if is_macos else os.path.join(os.environ['GITHUB_WORKSPACE'], 'sw')
os.environ['PKG_CONFIG_PATH'] = SW + '/lib/pkgconfig'
os.environ['PKG_CONFIG_PATH'] = os.path.join(SW, 'lib', 'pkgconfig')
if is_macos:
os.environ['PATH'] = '{}:{}'.format('/usr/local/opt/sphinx-doc/bin', os.environ['PATH'])
else:
os.environ['LD_LIBRARY_PATH'] = SW + '/lib'
os.environ['LD_LIBRARY_PATH'] = os.path.join(SW, 'lib')
os.environ['PYTHONHOME'] = SW
os.environ['PATH'] = '{}:{}'.format(os.path.join(SW, 'bin'), os.environ['PATH'])
@@ -111,7 +119,7 @@ def main():
setup_bundle_env()
else:
if not is_macos and 'pythonLocation' in os.environ:
os.environ['LD_LIBRARY_PATH'] = '{}/lib'.format(os.environ['pythonLocation'])
os.environ['LD_LIBRARY_PATH'] = os.path.join(os.environ['pythonLocation'], 'lib')
action = sys.argv[-1]
if action in ('build', 'package'):
install_deps()
@@ -122,7 +130,7 @@ def main():
elif action == 'test':
test_kitty()
else:
raise SystemExit('Unknown action: ' + action)
raise SystemExit(f'Unknown action: {action}')
if __name__ == '__main__':

View File

@@ -6,6 +6,9 @@ env:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
linux:
name: Linux (python=${{ matrix.pyver }} cc=${{ matrix.cc }} sanitize=${{ matrix.sanitize }})
@@ -20,15 +23,15 @@ jobs:
cc: [gcc, clang]
include:
- python: a
pyver: 3.6
pyver: "3.8"
sanitize: 0
- python: b
pyver: 3.7
pyver: "3.9"
sanitize: 1
- python: c
pyver: 3.8
pyver: "3.10"
sanitize: 1
@@ -42,11 +45,11 @@ jobs:
steps:
- name: Checkout source code
uses: actions/checkout@master
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Set up Python ${{ matrix.pyver }}
uses: actions/setup-python@master
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.pyver }}
@@ -63,20 +66,20 @@ jobs:
CFLAGS: -funsigned-char
steps:
- name: Checkout source code
uses: actions/checkout@master
uses: actions/checkout@v3
with:
fetch-depth: 10
fetch-depth: 0 # needed for :commit: docs role
- name: Test for trailing whitespace
run: if grep -Inr '\s$' kitty kitty_tests kittens docs *.py *.asciidoc *.rst .gitattributes .gitignore; then echo Trailing whitespace found, aborting.; exit 1; fi
- name: Set up Python
uses: actions/setup-python@master
uses: actions/setup-python@v3
with:
python-version: 3.8
python-version: 3.9
- name: Install build-only deps
run: pip install flake8 mypy sphinx
run: pip install -r docs/requirements.txt flake8 mypy types-requests types-docutils
- name: Run pyflakes
run: python -m flake8 --count .
@@ -84,14 +87,17 @@ jobs:
- name: Build kitty package
run: python .github/workflows/ci.py package
- name: Build kitty
run: python setup.py build --debug
- name: Run mypy
run: python test.py mypy
run: ./test.py mypy
- name: Build man page
run: make FAIL_WARN=-W man
run: make FAIL_WARN=1 man
- name: Build HTML docs
run: make FAIL_WARN=-W html
run: make FAIL_WARN=1 html
bundle:
name: Bundle test (${{ matrix.os }})
@@ -120,7 +126,7 @@ jobs:
- name: Checkout source code
uses: actions/checkout@master
with:
fetch-depth: 10
fetch-depth: 0 # needed for :commit: docs role
- name: Build kitty
run: python3 .github/workflows/ci.py build
@@ -128,5 +134,11 @@ jobs:
- name: Test kitty
run: python3 .github/workflows/ci.py test
- name: Install deps for docs
run: python3 -m pip install -r docs/requirements.txt
- name: Builds docs
run: make FAIL_WARN=1 docs
- name: Build kitty package
run: python3 .github/workflows/ci.py package

View File

@@ -9,30 +9,32 @@ on:
schedule:
- cron: '0 22 * * 5'
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
CodeQL-Build:
permissions:
contents: read # to fetch code (actions/checkout)
security-events: write # to upload SARIF results (github/codeql-action/analyze)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
with:
languages: python, c
setup-python-dependencies: false
- name: Build kitty
run: python3 .github/workflows/ci.py build

5
.gitignore vendored
View File

@@ -2,6 +2,8 @@
*.pyc
*.pyo
*_stub.pyi
*_generated.go
*_generated.h
/.dmypy.json
/tags
/build/
@@ -10,7 +12,7 @@
/compile_commands.json
/link_commands.json
/glad/out/
/kitty/launcher/
/kitty/launcher/kitty*
/*.dSYM/
__pycache__/
/glfw/wayland-*-client-protocol.[ch]
@@ -19,3 +21,4 @@ __pycache__/
/.mypy_cache
.DS_Store
bypy/b
bypy/virtual-machines.conf

View File

@@ -1,6 +1,7 @@
pkg-config
zlib
python
imagemagick
harfbuzz
sphinx-doc
brew "pkg-config"
brew "zlib"
brew "librsync"
brew "python"
brew "imagemagick"
brew "harfbuzz"
brew "sphinx-doc"

View File

@@ -1 +1 @@
See https://sw.kovidgoyal.net/kitty/changelog.html
See https://sw.kovidgoyal.net/kitty/changelog/

View File

@@ -10,9 +10,9 @@ config to reproduce the issue with).
### Contributing code
Install [the dependencies](https://sw.kovidgoyal.net/kitty/build.html#dependencies)
Install [the dependencies](https://sw.kovidgoyal.net/kitty/build/#dependencies)
using your favorite package manager. Build and run kitty [from
source](https://sw.kovidgoyal.net/kitty/build.html#install-and-run-from-source).
source](https://sw.kovidgoyal.net/kitty/build/#install-and-run-from-source).
Make a fork, submit your Pull Request. If it's a large/controversial change, open an issue
beforehand to discuss it, so that you don't waste your time making a pull

View File

@@ -1,3 +1,3 @@
To build from source: <https://sw.kovidgoyal.net/kitty/build.html>
[To build from source](https://sw.kovidgoyal.net/kitty/build/)
Pre-built binaries: <https://sw.kovidgoyal.net/kitty/binary.html>
[Pre-built binaries](https://sw.kovidgoyal.net/kitty/binary/)

View File

@@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@@ -5,6 +5,10 @@ ifdef VERBOSE
VVAL=--verbose
endif
ifdef FAIL_WARN
export FAIL_WARN
endif
all:
python3 setup.py $(VVAL)
@@ -31,13 +35,29 @@ profile:
app:
python3 setup.py kitty.app $(VVAL)
linux-package: FORCE
rm -rf linux-package
python3 setup.py linux-package
FORCE:
man:
$(MAKE) FAIL_WARN=$(FAIL_WARN) -C docs man
$(MAKE) -C docs man
html:
$(MAKE) FAIL_WARN=$(FAIL_WARN) -C docs html
$(MAKE) -C docs html
dirhtml:
$(MAKE) -C docs dirhtml
linkcheck:
$(MAKE) FAIL_WARN=$(FAIL_WARN) -C docs linkcheck
$(MAKE) -C docs linkcheck
website:
./publish.py --only website
docs: man html
develop-docs:
$(MAKE) -C docs develop-docs

View File

@@ -1,5 +1,14 @@
= kitty - the fast, featureful, GPU based, terminal emulator
= kitty - the fast, feature-rich, cross-platform, GPU based terminal
See https://sw.kovidgoyal.net/kitty/
See https://sw.kovidgoyal.net/kitty/[the kitty website].
image:https://github.com/kovidgoyal/kitty/workflows/CI/badge.svg["Build status", link="https://github.com/kovidgoyal/kitty/actions?query=workflow%3ACI"]
https://sw.kovidgoyal.net/kitty/faq/[Frequently Asked Questions]
To ask other questions about kitty usage, use either the https://github.com/kovidgoyal/kitty/discussions/[discussions on GitHub] or the
https://www.reddit.com/r/KittyTerminal[Reddit community]
Packaging status in various repositories:
image:https://repology.org/badge/vertical-allrepos/kitty.svg["Packaging status", link="https://repology.org/project/kitty/versions"]

12
SECURITY.md Normal file
View File

@@ -0,0 +1,12 @@
# Security Policy
## Supported Versions
There are no security specific releases of kitty. Security bugs are fixed
and released just like all other bugs.
## Reporting a vulnerability
Preferably send an email to kovid at kovidgoyal.net or open an issue in the
GitHub repository, though the latter means you are disclosing the vulnerability
publicly before it can be fixed.

View File

@@ -1,127 +1,7 @@
#!/usr/bin/env python3
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
import sys
import os
from typing import List
def icat(args: List[str]) -> None:
from kittens.runner import run_kitten as rk
sys.argv = args
rk('icat')
def list_fonts(args: List[str]) -> None:
from kitty.fonts.list import main as list_main
list_main(args)
def remote_control(args: List[str]) -> None:
from kitty.remote_control import main as rc_main
rc_main(args)
def runpy(args: List[str]) -> None:
sys.argv = ['kitty'] + args[2:]
exec(args[1])
def hold(args: List[str]) -> None:
import subprocess
ret = subprocess.Popen(args[1:]).wait()
sys.stdin.read()
raise SystemExit(ret)
def complete(args: List[str]) -> None:
from kitty.complete import main as complete_main
complete_main(args[1:], entry_points, namespaced_entry_points)
def launch(args: List[str]) -> None:
import runpy
sys.argv = args[1:]
exe = args[1]
if exe.startswith(':'):
import shutil
q = shutil.which(exe[1:])
if not q:
raise SystemExit('{} not found in PATH'.format(args[1][1:]))
exe = q
runpy.run_path(exe, run_name='__main__')
def run_kitten(args: List[str]) -> None:
try:
kitten = args[1]
except IndexError:
from kittens.runner import list_kittens
list_kittens()
raise SystemExit(1)
sys.argv = args[1:]
from kittens.runner import run_kitten as rk
rk(kitten)
def edit_config_file(args: List[str]) -> None:
from kitty.utils import edit_config_file as f
f()
def namespaced(args: List[str]) -> None:
func = namespaced_entry_points[args[1]]
func(args[1:])
entry_points = {
# These two are here for backwards compat
'icat': icat,
'list-fonts': list_fonts,
'runpy': runpy,
'launch': launch,
'kitten': run_kitten,
'edit-config': edit_config_file,
'@': remote_control,
'+': namespaced,
}
namespaced_entry_points = {k: v for k, v in entry_points.items() if k[0] not in '+@'}
namespaced_entry_points['hold'] = hold
namespaced_entry_points['complete'] = complete
def setup_openssl_environment() -> None:
# Workaround for Linux distros that have still failed to get their heads
# out of their asses and implement a common location for SSL certificates.
# It's not that hard people, there exists a wonderful tool called the symlink
# See https://www.mobileread.com/forums/showthread.php?t=256095
if 'SSL_CERT_FILE' not in os.environ and 'SSL_CERT_DIR' not in os.environ:
if os.access('/etc/pki/tls/certs/ca-bundle.crt', os.R_OK):
os.environ['SSL_CERT_FILE'] = '/etc/pki/tls/certs/ca-bundle.crt'
setattr(sys, 'kitty_ssl_env_var', 'SSL_CERT_FILE')
elif os.path.isdir('/etc/ssl/certs'):
os.environ['SSL_CERT_DIR'] = '/etc/ssl/certs'
setattr(sys, 'kitty_ssl_env_var', 'SSL_CERT_DIR')
def main() -> None:
if getattr(sys, 'frozen', False) and 'darwin' not in sys.platform.lower():
setup_openssl_environment()
first_arg = '' if len(sys.argv) < 2 else sys.argv[1]
func = entry_points.get(first_arg)
if func is None:
if first_arg.startswith('@'):
remote_control(['@', first_arg[1:]] + sys.argv[2:])
elif first_arg.startswith('+'):
namespaced(['+', first_arg[1:]] + sys.argv[2:])
else:
from kitty.main import main as kitty_main
kitty_main()
else:
func(sys.argv[1:])
if __name__ == '__main__':
from kitty.entry_points import main
main()

View File

@@ -4,7 +4,6 @@
import glob
import os
import re
import shutil
import subprocess
import sys
@@ -13,11 +12,10 @@ import tempfile
def compile_terminfo(base):
with tempfile.TemporaryDirectory() as tdir:
proc = subprocess.run(['tic', '-x', '-o' + tdir, 'terminfo/kitty.terminfo'], check=True, stderr=subprocess.PIPE)
regex = '^"terminfo/kitty.terminfo", line [0-9]+, col [0-9]+, terminal \'xterm-kitty\': older tic versions may treat the description field as an alias$'
for error in proc.stderr.decode('utf-8').splitlines():
if not re.match(regex, error):
print(error, file=sys.stderr)
proc = subprocess.run(['tic', '-x', f'-o{tdir}', 'terminfo/kitty.terminfo'], capture_output=True)
if proc.returncode != 0:
sys.stderr.buffer.write(proc.stderr)
raise SystemExit(proc.returncode)
tfiles = glob.glob(os.path.join(tdir, '*', 'xterm-kitty'))
if not tfiles:
raise SystemExit('tic failed to output the compiled kitty terminfo file')
@@ -40,6 +38,13 @@ def generate_terminfo():
with open('terminfo/kitty.terminfo', 'w') as f:
f.write(generate_terminfo())
proc = subprocess.run(['tic', '-CrT0', 'terminfo/kitty.terminfo'], capture_output=True)
if proc.returncode != 0:
sys.stderr.buffer.write(proc.stderr)
raise SystemExit(proc.returncode)
tcap = proc.stdout.decode('utf-8').splitlines()[-1]
with open('terminfo/kitty.termcap', 'w') as f:
f.write(tcap)
compile_terminfo(os.path.join(base, 'terminfo'))

View File

@@ -4,15 +4,17 @@
import os
import re
import shlex
import shutil
import subprocess
import sys
import tempfile
from contextlib import suppress
from bypy.constants import (
LIBDIR, PREFIX, PYTHON, SRC as KITTY_DIR, ismacos, worker_env
)
from bypy.utils import run_shell
from bypy.utils import run_shell, walk
def read_src_file(name):
@@ -24,10 +26,11 @@ def initialize_constants():
kitty_constants = {}
src = read_src_file('constants.py')
nv = re.search(r'Version\((\d+), (\d+), (\d+)\)', src)
kitty_constants['version'] = '%s.%s.%s' % (nv.group(1), nv.group(2), nv.group(3))
kitty_constants['version'] = f'{nv.group(1)}.{nv.group(2)}.{nv.group(3)}'
kitty_constants['appname'] = re.search(
r'appname: str\s+=\s+(u{0,1})[\'"]([^\'"]+)[\'"]', src
).group(2)
kitty_constants['cacerts_url'] = 'https://curl.haxx.se/ca/cacert.pem'
return kitty_constants
@@ -40,52 +43,69 @@ def run(*args, **extra_env):
if ismacos:
env['PKGCONFIG_EXE'] = os.path.join(PREFIX, 'bin', 'pkg-config')
cwd = env.pop('cwd', KITTY_DIR)
print(' '.join(map(shlex.quote, args)), flush=True)
return subprocess.call(list(args), env=env, cwd=cwd)
SETUP_CMD = [PYTHON, 'setup.py', '--build-universal-binary']
def build_frozen_launcher(extra_include_dirs):
inc_dirs = [f'--extra-include-dirs={x}' for x in extra_include_dirs]
cmd = SETUP_CMD + ['--prefix', build_frozen_launcher.prefix] + inc_dirs + ['build-frozen-launcher']
if run(*cmd, cwd=build_frozen_launcher.writeable_src_dir) != 0:
print('Building of frozen kitty launcher failed', file=sys.stderr)
os.chdir(KITTY_DIR)
run_shell()
raise SystemExit('Building of kitty launcher failed')
return build_frozen_launcher.writeable_src_dir
def run_tests(kitty_exe):
with tempfile.TemporaryDirectory() as tdir:
env = {
'KITTY_CONFIG_DIRECTORY': os.path.join(tdir, 'conf'),
'KITTY_CACHE_DIRECTORY': os.path.join(tdir, 'cache')
}
[os.mkdir(x) for x in env.values()]
cmd = [kitty_exe, '+runpy', 'from kitty_tests.main import run_tests; run_tests()']
print(*map(shlex.quote, cmd), flush=True)
if subprocess.call(cmd, env=env) != 0:
print('Checking of kitty build failed', file=sys.stderr)
os.chdir(os.path.dirname(kitty_exe))
run_shell()
raise SystemExit('Checking of kitty build failed')
def sanitize_source_folder(path: str) -> None:
for q in walk(path):
if os.path.splitext(q)[1] not in ('.py', '.glsl', '.ttf', '.otf'):
os.unlink(q)
def build_c_extensions(ext_dir, args):
writeable_src_dir = os.path.join(ext_dir, 'src')
build_frozen_launcher.writeable_src_dir = writeable_src_dir
shutil.copytree(
KITTY_DIR, writeable_src_dir, symlinks=True,
ignore=shutil.ignore_patterns('b', 'build', 'dist', '*_commands.json', '*.o'))
ignore=shutil.ignore_patterns('b', 'build', 'dist', '*_commands.json', '*.o', '*.so', '*.dylib', '*.pyd'))
# Build the launcher as it is needed for the spawn test
with suppress(FileNotFoundError):
os.remove(os.path.join(writeable_src_dir, 'kitty', 'launcher', 'kitty'))
if run(PYTHON, 'setup.py', 'build-launcher', cwd=writeable_src_dir) != 0:
print('Building of kitty launcher failed', file=sys.stderr)
os.chdir(KITTY_DIR)
run_shell()
raise SystemExit('Building of kitty launcher failed')
os.unlink(os.path.join(writeable_src_dir, 'kitty', 'launcher', 'kitty'))
cmd = [PYTHON, 'setup.py']
bundle = 'macos-freeze' if ismacos else 'linux-freeze'
cmd.append(bundle)
cmd = SETUP_CMD + ['macos-freeze' if ismacos else 'linux-freeze']
if args.dont_strip:
cmd.append('--debug')
dest = kitty_constants['appname'] + ('.app' if ismacos else '')
dest = os.path.join(ext_dir, dest)
cmd += ['--prefix', dest]
dest = build_frozen_launcher.prefix = os.path.join(ext_dir, dest)
cmd += ['--prefix', dest, '--full']
if run(*cmd, cwd=writeable_src_dir) != 0:
print('Building of kitty package failed', file=sys.stderr)
os.chdir(KITTY_DIR)
os.chdir(writeable_src_dir)
run_shell()
raise SystemExit('Building of kitty package failed')
return ext_dir
def run_tests(path_to_kitty, cwd_on_failure):
kw = {'cwd': cwd_on_failure}
if not ismacos:
# this is needed for the spawn test which starts an interpreter
# using the kitty launcher.
kw['PYTHONHOME'] = PREFIX
ret = run(PYTHON, 'test.py', **kw)
if ret != 0:
os.chdir(cwd_on_failure)
print(
'running kitty tests failed with return code:', ret, file=sys.stderr)
run_shell()
raise SystemExit('running kitty tests failed')
if __name__ == 'program':
kitty_constants = initialize_constants()

View File

@@ -1,3 +1,3 @@
image 'https://partner-images.canonical.com/core/xenial/current/ubuntu-xenial-core-cloudimg-{}-root.tar.gz'
image 'https://cloud-images.ubuntu.com/releases/bionic/release/ubuntu-18.04-server-cloudimg-{}.img'
deps 'bison flex libxcursor-dev libxrandr-dev libxi-dev libxinerama-dev libgl1-mesa-dev libxcb-xkb-dev libfontconfig1-dev libdbus-1-dev'

View File

@@ -13,12 +13,18 @@ import time
from bypy.constants import (
OUTPUT_DIR, PREFIX, is64bit, python_major_minor_version
)
from bypy.utils import get_dll_path, py_compile, walk
from bypy.freeze import (
extract_extension_modules, freeze_python, path_to_freeze_dir
)
from bypy.utils import get_dll_path, mkdtemp, py_compile, walk
j = os.path.join
machine = (os.uname()[4] or '').lower()
if machine.startswith('arm64') or machine.startswith('aarch64'):
arch = 'arm64'
else:
arch = 'x86_64' if is64bit else 'i686'
self_dir = os.path.dirname(os.path.abspath(__file__))
arch = 'x86_64' if is64bit else 'i686'
py_ver = '.'.join(map(str, python_major_minor_version()))
iv = globals()['init_env']
kitty_constants = iv['kitty_constants']
@@ -26,17 +32,17 @@ kitty_constants = iv['kitty_constants']
def binary_includes():
return tuple(map(get_dll_path, (
'expat', 'sqlite3', 'ffi', 'z', 'lzma', 'png16', 'lcms2',
# dont include freetype because fontconfig is closely coupled to it
# and also distros often patch freetype
# 'iconv.so.2', 'pcre.so.1', 'graphite2.so.3', 'glib-2.0.so.0', 'freetype.so.6',
'expat', 'sqlite3', 'ffi', 'z', 'lzma', 'png16', 'lcms2', 'crypt',
'iconv', 'pcre', 'graphite2', 'glib-2.0', 'freetype', 'rsync',
'harfbuzz', 'xkbcommon', 'xkbcommon-x11',
'ncursesw', 'readline',
# fontconfig is not bundled because in typical brain dead Linux
# distro fashion, different distros use different default config
# paths for fontconfig.
'ncursesw', 'readline', 'brotlicommon', 'brotlienc', 'brotlidec',
'wayland-client', 'wayland-cursor',
))) + (
get_dll_path('bz2', 2), get_dll_path('ssl', 2), get_dll_path('crypto', 2),
get_dll_path('python' + py_ver, 2),
get_dll_path(f'python{py_ver}', 2),
)
@@ -45,9 +51,10 @@ class Env:
def __init__(self, package_dir):
self.base = package_dir
self.lib_dir = j(self.base, 'lib')
self.py_dir = j(self.lib_dir, 'python' + py_ver)
self.py_dir = j(self.lib_dir, f'python{py_ver}')
os.makedirs(self.py_dir)
self.bin_dir = j(self.base, 'bin')
self.obj_dir = mkdtemp('launchers-')
def ignore_in_lib(base, items, ignored_dirs=None):
@@ -75,7 +82,7 @@ def import_site_packages(srcdir, dest):
if ext in ('py', 'so'):
shutil.copy2(f, dest)
elif ext == 'pth' and x != 'setuptools.pth':
for line in open(f, 'rb').read().splitlines():
for line in open(f):
src = os.path.abspath(j(srcdir, line))
if os.path.exists(src) and os.path.isdir(src):
import_site_packages(src, dest)
@@ -89,11 +96,22 @@ def copy_libs(env):
for x in binary_includes():
dest = env.bin_dir if '/bin/' in x else env.lib_dir
shutil.copy2(x, dest)
dest = os.path.join(dest, os.path.basename(x))
subprocess.check_call(['chrpath', '-d', dest])
def add_ca_certs(env):
print('Downloading CA certs...')
from urllib.request import urlopen
cdata = urlopen(kitty_constants['cacerts_url']).read()
dest = os.path.join(env.lib_dir, 'cacert.pem')
with open(dest, 'wb') as f:
f.write(cdata)
def copy_python(env):
print('Copying python...')
srcdir = j(PREFIX, 'lib/python' + py_ver)
srcdir = j(PREFIX, f'lib/python{py_ver}')
for x in os.listdir(srcdir):
y = j(srcdir, x)
@@ -105,10 +123,31 @@ def copy_python(env):
shutil.copy2(y, env.py_dir)
srcdir = j(srcdir, 'site-packages')
dest = j(env.py_dir, 'site-packages')
import_site_packages(srcdir, dest)
import_site_packages(srcdir, env.py_dir)
pdir = os.path.join(env.lib_dir, 'kitty-extensions')
os.makedirs(pdir, exist_ok=True)
kitty_dir = os.path.join(env.lib_dir, 'kitty')
bases = ('kitty', 'kittens', 'kitty_tests')
for x in bases:
dest = os.path.join(env.py_dir, x)
os.rename(os.path.join(kitty_dir, x), dest)
if x == 'kitty':
shutil.rmtree(os.path.join(dest, 'launcher'))
os.rename(os.path.join(kitty_dir, '__main__.py'), os.path.join(env.py_dir, 'kitty_main.py'))
shutil.rmtree(os.path.join(kitty_dir, '__pycache__'))
print('Extracting extension modules from', env.py_dir, 'to', pdir)
ext_map = extract_extension_modules(env.py_dir, pdir)
shutil.copy(os.path.join(os.path.dirname(self_dir), 'site.py'), os.path.join(env.py_dir, 'site.py'))
for x in bases:
iv['sanitize_source_folder'](os.path.join(env.py_dir, x))
py_compile(env.py_dir)
py_compile(os.path.join(env.base, 'lib', 'kitty'))
freeze_python(env.py_dir, pdir, env.obj_dir, ext_map, develop_mode_env_var='KITTY_DEVELOP_FROM', remove_pyc_files=True)
shutil.rmtree(env.py_dir)
def build_launcher(env):
iv['build_frozen_launcher']([path_to_freeze_dir(), env.obj_dir])
def is_elf(path):
@@ -153,11 +192,11 @@ def strip_files(files, argv_max=(256 * 1024)):
def strip_binaries(files):
print('Stripping %d files...' % len(files))
print(f'Stripping {len(files)} files...')
before = sum(os.path.getsize(x) for x in files)
strip_files(files)
after = sum(os.path.getsize(x) for x in files)
print('Stripped %.1f MB' % ((before - after) / (1024 * 1024.)))
print('Stripped {:.1f} MB'.format((before - after) / (1024 * 1024.)))
def create_tarfile(env, compression_level='9'):
@@ -169,7 +208,7 @@ def create_tarfile(env, compression_level='9'):
if err.errno != errno.ENOENT:
raise
os.mkdir(base)
dist = os.path.join(base, '%s-%s-%s.tar' % (kitty_constants['appname'], kitty_constants['version'], arch))
dist = os.path.join(base, f'{kitty_constants["appname"]}-{kitty_constants["version"]}-{arch}.tar')
with tarfile.open(dist, mode='w', format=tarfile.PAX_FORMAT) as tf:
cwd = os.getcwd()
os.chdir(env.base)
@@ -179,29 +218,30 @@ def create_tarfile(env, compression_level='9'):
finally:
os.chdir(cwd)
print('Compressing archive...')
ans = dist.rpartition('.')[0] + '.txz'
ans = f'{dist.rpartition(".")[0]}.txz'
start_time = time.time()
subprocess.check_call(['xz', '--threads=0', '-f', '-' + compression_level, dist])
subprocess.check_call(['xz', '--threads=0', '-f', f'-{compression_level}', dist])
secs = time.time() - start_time
print('Compressed in %d minutes %d seconds' % (secs // 60, secs % 60))
os.rename(dist + '.xz', ans)
print('Archive %s created: %.2f MB' % (
print('Compressed in {} minutes {} seconds'.format(secs // 60, secs % 60))
os.rename(f'{dist}.xz', ans)
print('Archive {} created: {:.2f} MB'.format(
os.path.basename(ans), os.stat(ans).st_size / (1024.**2)))
def main():
args = globals()['args']
ext_dir = globals()['ext_dir']
if not args.skip_tests:
run_tests = iv['run_tests']
run_tests(None, os.path.join(ext_dir, 'src'))
env = Env(os.path.join(ext_dir, kitty_constants['appname']))
copy_libs(env)
copy_python(env)
build_launcher(env)
files = find_binaries(env)
fix_permissions(files)
add_ca_certs(env)
if not args.dont_strip:
strip_binaries(files)
if not args.skip_tests:
iv['run_tests'](os.path.join(env.base, 'bin', 'kitty'))
create_tarfile(env, args.compression_level)

View File

@@ -1,6 +1,8 @@
# Requires installation of XCode 10.3 and Python 3 and
# python3 -m pip install certifi
vm_name 'macos-kitty-build'
vm_name 'macos-kitty'
root '/Users/Shared/kitty-build'
python '/usr/local/bin/python3'
universal 'true'
deploy_target '10.14'

View File

@@ -13,16 +13,23 @@ import tempfile
import zipfile
from bypy.constants import PREFIX, PYTHON, SW, python_major_minor_version
from bypy.freeze import (
extract_extension_modules, freeze_python, path_to_freeze_dir
)
from bypy.macos_sign import (
codesign, create_entitlements_file, make_certificate_useable, notarize_app,
verify_signature
)
from bypy.utils import current_dir, py_compile, run_shell, timeit, walk
from bypy.utils import (
current_dir, mkdtemp, py_compile, run_shell, timeit, walk
)
iv = globals()['init_env']
kitty_constants = iv['kitty_constants']
self_dir = os.path.dirname(os.path.abspath(__file__))
join = os.path.join
basename = os.path.basename
dirname = os.path.dirname
abspath = os.path.abspath
APPNAME = kitty_constants['appname']
VERSION = kitty_constants['version']
@@ -83,7 +90,7 @@ def strip_files(files, argv_max=(256 * 1024)):
def files_in(folder):
for record in os.walk(folder):
for f in record[-1]:
yield os.path.join(record[0], f)
yield join(record[0], f)
def expand_dirs(items, exclude=lambda x: x.endswith('.so')):
@@ -96,7 +103,7 @@ def expand_dirs(items, exclude=lambda x: x.endswith('.so')):
def do_sign(app_dir):
with current_dir(os.path.join(app_dir, 'Contents')):
with current_dir(join(app_dir, 'Contents')):
# Sign all .so files
so_files = {x for x in files_in('.') if x.endswith('.so')}
codesign(so_files)
@@ -134,8 +141,9 @@ class Freeze(object):
FID = '@executable_path/../Frameworks'
def __init__(self, build_dir, dont_strip=False, sign_installers=False, notarize=False):
def __init__(self, build_dir, dont_strip=False, sign_installers=False, notarize=False, skip_tests=False):
self.build_dir = build_dir
self.skip_tests = skip_tests
self.sign_installers = sign_installers
self.notarize = notarize
self.dont_strip = dont_strip
@@ -145,8 +153,9 @@ class Freeze(object):
self.to_strip = []
self.warnings = []
self.py_ver = py_ver
self.python_stdlib = join(self.resources_dir, 'Python', 'lib', 'python' + self.py_ver)
self.python_stdlib = join(self.resources_dir, 'Python', 'lib', f'python{self.py_ver}')
self.site_packages = self.python_stdlib # hack to avoid needing to add site-packages to path
self.obj_dir = mkdtemp('launchers-')
self.run()
@@ -160,21 +169,45 @@ class Freeze(object):
self.add_site_packages()
self.add_stdlib()
self.add_misc_libraries()
self.compile_py_modules()
self.fix_dependencies_in_kitty()
self.freeze_python()
self.add_ca_certs()
if not self.dont_strip:
self.strip_files()
if not self.skip_tests:
self.run_tests()
# self.run_shell()
ret = self.makedmg(self.build_dir, APPNAME + '-' + VERSION)
ret = self.makedmg(self.build_dir, f'{APPNAME}-{VERSION}')
return ret
@flush
def add_ca_certs(self):
print('\nDownloading CA certs...')
from urllib.request import urlopen
cdata = None
for i in range(5):
try:
cdata = urlopen(kitty_constants['cacerts_url']).read()
break
except Exception as e:
print(f'Downloading CA certs failed with error: {e}, retrying...')
if cdata is None:
raise SystemExit('Downloading C certs failed, giving up')
dest = join(self.contents_dir, 'Resources', 'cacert.pem')
with open(dest, 'wb') as f:
f.write(cdata)
@flush
def strip_files(self):
print('\nStripping files...')
strip_files(self.to_strip)
@flush
def run_tests(self):
iv['run_tests'](join(self.contents_dir, 'MacOS', 'kitty'))
@flush
def set_id(self, path_to_lib, new_id):
old_mode = flipwritable(path_to_lib)
@@ -198,10 +231,10 @@ class Freeze(object):
@flush
def get_local_dependencies(self, path_to_lib):
for x, is_id in self.get_dependencies(path_to_lib):
for y in (PREFIX + '/lib/', PREFIX + '/python/Python.framework/'):
for y in (f'{PREFIX}/lib/', f'{PREFIX}/python/Python.framework/', '@rpath/'):
if x.startswith(y):
if y == PREFIX + '/python/Python.framework/':
y = PREFIX + '/python/'
if y == f'{PREFIX}/python/Python.framework/':
y = f'{PREFIX}/python/'
yield x, x[len(y):], is_id
break
@@ -215,7 +248,7 @@ class Freeze(object):
self.to_strip.append(path_to_lib)
old_mode = flipwritable(path_to_lib)
for dep, bname, is_id in self.get_local_dependencies(path_to_lib):
ndep = self.FID + '/' + bname
ndep = f'{self.FID}/{bname}'
self.change_dep(dep, ndep, is_id, path_to_lib)
ldeps = list(self.get_local_dependencies(path_to_lib))
if ldeps:
@@ -228,7 +261,7 @@ class Freeze(object):
@flush
def add_python_framework(self):
print('\nAdding Python framework')
src = join(PREFIX + '/python', 'Python.framework')
src = join(f'{PREFIX}/python', 'Python.framework')
x = join(self.frameworks_dir, 'Python.framework')
curr = os.path.realpath(join(src, 'Versions', 'Current'))
currd = join(x, 'Versions', basename(curr))
@@ -238,13 +271,12 @@ class Freeze(object):
shutil.copy2(join(curr, 'Python'), currd)
self.set_id(
join(currd, 'Python'),
self.FID + '/Python.framework/Versions/%s/Python' % basename(curr))
self.fix_dependencies_in_lib(join(self.contents_dir, 'MacOS', 'kitty'))
f'{self.FID}/Python.framework/Versions/{basename(curr)}/Python')
# The following is needed for codesign
with current_dir(x):
os.symlink(basename(curr), 'Versions/Current')
for y in ('Python', 'Resources'):
os.symlink('Versions/Current/%s' % y, y)
os.symlink(f'Versions/Current/{y}', y)
@flush
def install_dylib(self, path, set_id=True):
@@ -252,7 +284,7 @@ class Freeze(object):
if set_id:
self.set_id(
join(self.frameworks_dir, basename(path)),
self.FID + '/' + basename(path))
f'{self.FID}/{basename(path)}')
self.fix_dependencies_in_lib(join(self.frameworks_dir, basename(path)))
@flush
@@ -265,19 +297,15 @@ class Freeze(object):
'lcms2.2',
'crypto.1.1',
'ssl.1.1',
'rsync.2',
):
print('\nAdding', x)
x = 'lib%s.dylib' % x
x = f'lib{x}.dylib'
src = join(PREFIX, 'lib', x)
shutil.copy2(src, self.frameworks_dir)
dest = join(self.frameworks_dir, x)
self.set_id(dest, self.FID + '/' + x)
self.set_id(dest, f'{self.FID}/{x}')
self.fix_dependencies_in_lib(dest)
base = join(self.frameworks_dir, 'kitty')
for lib in walk(base):
if lib.endswith('.so'):
self.set_id(lib, self.FID + '/' + os.path.relpath(lib, self.frameworks_dir))
self.fix_dependencies_in_lib(lib)
@flush
def add_package_dir(self, x, dest=None):
@@ -295,25 +323,14 @@ class Freeze(object):
dest = self.site_packages
dest = join(dest, basename(x))
shutil.copytree(x, dest, symlinks=True, ignore=ignore)
self.postprocess_package(x, dest)
for f in walk(dest):
if f.endswith('.so'):
self.fix_dependencies_in_lib(f)
@flush
def fix_dependencies_in_kitty(self):
for f in walk(join(self.resources_dir, 'kitty')):
if f.endswith('.so'):
self.fix_dependencies_in_lib(f)
@flush
def postprocess_package(self, src_path, dest_path):
pass
@flush
def add_stdlib(self):
print('\nAdding python stdlib')
src = PREFIX + '/python/Python.framework/Versions/Current/lib/python' + self.py_ver
src = f'{PREFIX}/python/Python.framework/Versions/Current/lib/python{self.py_ver}'
dest = self.python_stdlib
if not os.path.exists(dest):
os.makedirs(dest)
@@ -331,6 +348,36 @@ class Freeze(object):
if dest2.endswith('.so'):
self.fix_dependencies_in_lib(dest2)
@flush
def freeze_python(self):
print('\nFreezing python')
kitty_dir = join(self.resources_dir, 'kitty')
bases = ('kitty', 'kittens', 'kitty_tests')
for x in bases:
dest = join(self.python_stdlib, x)
os.rename(join(kitty_dir, x), dest)
if x == 'kitty':
shutil.rmtree(join(dest, 'launcher'))
os.rename(join(kitty_dir, '__main__.py'), join(self.python_stdlib, 'kitty_main.py'))
shutil.rmtree(join(kitty_dir, '__pycache__'))
pdir = join(dirname(self.python_stdlib), 'kitty-extensions')
os.mkdir(pdir)
print('Extracting extension modules from', self.python_stdlib, 'to', pdir)
ext_map = extract_extension_modules(self.python_stdlib, pdir)
shutil.copy(join(os.path.dirname(self_dir), 'site.py'), join(self.python_stdlib, 'site.py'))
for x in bases:
iv['sanitize_source_folder'](join(self.python_stdlib, x))
self.compile_py_modules()
freeze_python(self.python_stdlib, pdir, self.obj_dir, ext_map, develop_mode_env_var='KITTY_DEVELOP_FROM', remove_pyc_files=True)
shutil.rmtree(self.python_stdlib)
iv['build_frozen_launcher']([path_to_freeze_dir(), self.obj_dir])
os.rename(join(dirname(self.contents_dir), 'bin', 'kitty'), join(self.contents_dir, 'MacOS', 'kitty'))
shutil.rmtree(join(dirname(self.contents_dir), 'bin'))
self.fix_dependencies_in_lib(join(self.contents_dir, 'MacOS', 'kitty'))
for f in walk(pdir):
if f.endswith('.so') or f.endswith('.dylib'):
self.fix_dependencies_in_lib(f)
@flush
def add_site_packages(self):
print('\nAdding site-packages')
@@ -389,34 +436,31 @@ class Freeze(object):
@flush
def compile_py_modules(self):
print('\nCompiling Python modules')
self.remove_bytecode(join(self.resources_dir, 'Python'))
py_compile(join(self.resources_dir, 'Python'))
self.remove_bytecode(join(self.resources_dir, 'kitty'))
py_compile(join(self.resources_dir, 'kitty'))
@flush
def makedmg(self, d, volname, internet_enable=True, format='ULFO'):
def makedmg(self, d, volname, format='ULFO'):
''' Copy a directory d into a dmg named volname '''
print('\nMaking dmg...')
sys.stdout.flush()
destdir = os.path.join(SW, 'dist')
destdir = join(SW, 'dist')
try:
shutil.rmtree(destdir)
except FileNotFoundError:
pass
os.mkdir(destdir)
dmg = os.path.join(destdir, volname + '.dmg')
dmg = join(destdir, f'{volname}.dmg')
if os.path.exists(dmg):
os.unlink(dmg)
tdir = tempfile.mkdtemp()
appdir = os.path.join(tdir, os.path.basename(d))
appdir = join(tdir, os.path.basename(d))
shutil.copytree(d, appdir, symlinks=True)
if self.sign_installers:
with timeit() as times:
sign_app(appdir, self.notarize)
print('Signing completed in %d minutes %d seconds' % tuple(times))
os.symlink('/Applications', os.path.join(tdir, 'Applications'))
print('Signing completed in {} minutes {} seconds'.format(*times))
os.symlink('/Applications', join(tdir, 'Applications'))
size_in_mb = int(
subprocess.check_output(['du', '-s', '-k', tdir]).decode('utf-8')
.split()[0]) / 1024.
@@ -432,27 +476,22 @@ class Freeze(object):
print('\nCreating dmg...')
with timeit() as times:
subprocess.check_call(cmd + [dmg])
if internet_enable:
subprocess.check_call(
['/usr/bin/hdiutil', 'internet-enable', '-yes', dmg])
print('dmg created in %d minutes and %d seconds' % tuple(times))
print('dmg created in {} minutes and {} seconds'.format(*times))
shutil.rmtree(tdir)
size = os.stat(dmg).st_size / (1024 * 1024.)
print('\nInstaller size: %.2fMB\n' % size)
print(f'\nInstaller size: {size:.2f}MB\n')
return dmg
def main():
args = globals()['args']
ext_dir = globals()['ext_dir']
if not args.skip_tests:
run_tests = iv['run_tests']
run_tests(None, os.path.join(ext_dir, 'src'))
Freeze(
os.path.join(ext_dir, kitty_constants['appname'] + '.app'),
join(ext_dir, f'{kitty_constants["appname"]}.app'),
dont_strip=args.dont_strip,
sign_installers=args.sign_installers,
notarize=args.notarize
notarize=args.notarize,
skip_tests=args.skip_tests
)

31
bypy/site.py Normal file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>
import builtins
import sys
import _sitebuiltins
def set_quit():
eof = 'Ctrl-D (i.e. EOF)'
builtins.quit = _sitebuiltins.Quitter('quit', eof)
builtins.exit = _sitebuiltins.Quitter('exit', eof)
def set_helper():
builtins.help = _sitebuiltins._Helper()
def main():
sys.argv[0] = sys.calibre_basename
set_helper()
set_quit()
mod = __import__(sys.calibre_module, fromlist=[1])
func = getattr(mod, sys.calibre_function)
return func()
if __name__ == '__main__':
main()

View File

@@ -28,52 +28,71 @@
}
},
{
"name": "openssl",
"unix": {
"filename": "openssl-1.1.1i.tar.gz",
"hash": "sha256:e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242",
"urls": ["https://www.openssl.org/source/{filename}"]
}
},
{
"name": "expat",
"name": "cmake",
"os": "macos",
"unix": {
"filename": "expat-2.2.6.tar.bz2",
"hash": "sha256:17b43c2716d521369f82fc2dc70f359860e90fa440bea65b3b85f0b246ea81f2",
"urls": ["https://github.com/libexpat/libexpat/releases/download/R_2_2_6/{filename}"]
"filename": "cmake-3.19.4.tar.gz",
"hash": "sha256:7d0232b9f1c57e8de81f38071ef8203e6820fe7eec8ae46a1df125d88dbcc2e1",
"urls": ["https://cmake.org/files/v3.19/{filename}"]
}
},
{
"name": "expat",
"unix": {
"filename": "expat-2.2.10.tar.bz2",
"hash": "sha256:b2c160f1b60e92da69de8e12333096aeb0c3bf692d41c60794de278af72135a5",
"urls": ["https://github.com/libexpat/libexpat/releases/download/R_2_2_10/{filename}"]
}
},
{
"name": "libxml2",
"unix": {
"filename": "libxml2-2.9.12.tar.gz",
"hash": "sha256:c8d6681e38c56f172892c85ddc0852e1fd4b53b4209e7f4ebf17f7e2eae71d92",
"urls": ["ftp://xmlsoft.org/libxml2/{filename}"]
}
},
{
"name": "xkbcommon",
"os": "linux",
"unix": {
"filename": "libxkbcommon-0.10.0.tar.xz",
"hash": "sha256:57c3630cdc38fb4734cd57fa349e92244f5ae3862813e533cedbd86721a0b6f2",
"urls": ["http://xkbcommon.org/download/{filename}"]
"filename": "libxkbcommon-1.0.3.tar.xz",
"hash": "sha256:a2202f851e072b84e64a395212cbd976ee18a8ee602008b0bad02a13247dbc52",
"urls": ["https://xkbcommon.org/download/{filename}"]
}
},
{
"name": "sqlite",
"unix": {
"filename": "sqlite-autoconf-3310100.tar.gz",
"hash": "sha1:0c30f5b22152a8166aa3bebb0f4bc1f3e9cc508b",
"urls": ["https://www.sqlite.org/2020/{filename}"]
"filename": "sqlite-autoconf-3340100.tar.gz",
"hash": "sha256:2a3bca581117b3b88e5361d0ef3803ba6d8da604b1c1a47d902ef785c1b53e89",
"urls": ["https://www.sqlite.org/2021/{filename}"]
}
},
{
"name": "libffi",
"os": "linux",
"unix": {
"filename": "libffi-3.2.1.tar.gz",
"hash": "sha1:280c265b789e041c02e5c97815793dfc283fb1e6",
"urls": ["ftp://sourceware.org/pub/libffi/{filename}"]
}
},
{
"name": "openssl",
"unix": {
"filename": "openssl-1.1.1g.tar.gz",
"hash": "sha256:ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46",
"urls": ["https://www.openssl.org/source/{filename}"]
"filename": "libffi-3.3.0.tar.gz",
"hash": "sha256:72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056",
"urls": ["https://github.com/libffi/libffi/releases/download/v3.3/libffi-3.3.tar.gz"]
}
},
@@ -91,15 +110,14 @@
"name": "readline",
"os": "linux",
"unix": {
"filename": "readline-8.0.tar.gz",
"hash": "sha256:e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461",
"urls": ["http://ftp.gnu.org/gnu/readline/{filename}"]
"filename": "readline-8.1.tar.gz",
"hash": "sha256:f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02",
"urls": ["https://ftp.gnu.org/gnu/readline/{filename}"]
}
},
{
"name": "xz",
"os": "macos,linux",
"unix": {
"filename": "xz-5.2.5.tar.gz",
"hash": "sha256:f6f4910fd033078738bd82bfba4f49219d03b17eb0794eb91efbae419f4aba10",
@@ -107,20 +125,40 @@
}
},
{
"name": "librsync",
"unix": {
"filename": "librsync-2.3.2.tar.gz",
"hash": "sha256:ef8ce23df38d5076d25510baa2cabedffbe0af460d887d86c2413a1c2b0c676f",
"urls": ["https://github.com/librsync/librsync/releases/download/v2.3.2/{filename}"]
}
},
{
"name": "xcrypt",
"os": "linux",
"unix": {
"filename": "xcrypt-4.4.17.tar.gz",
"hash": "sha256:7665168d0409574a03f7b484682e68334764c29c21ca5df438955a381384ca07",
"urls": ["https://github.com/besser82/libxcrypt/archive/v4.4.17.tar.gz"]
}
},
{
"name": "python",
"unix": {
"filename": "Python-3.8.3.tar.xz",
"hash": "sha256:dfab5ec723c218082fe3d5d7ae17ecbdebffa9a1aea4d64aa3a2ecdd2e795864",
"urls": ["https://www.python.org/ftp/python/3.8.3/{filename}"]
"filename": "Python-3.9.4.tar.xz",
"hash": "sha256:4b0e6644a76f8df864ae24ac500a51bbf68bd098f6a173e27d3b61cdca9aa134",
"urls": ["https://www.python.org/ftp/python/3.9.4/{filename}"]
}
},
{
"name": "setuptools",
"unix": {
"filename": "setuptools-41.0.1.zip",
"hash": "sha256:a222d126f5471598053c9a77f4b5d4f26eaa1f150ad6e01dcf1a42e185d05613",
"filename": "setuptools-53.0.0.tar.gz",
"hash": "sha256:1b18ef17d74ba97ac9c0e4b4265f123f07a8ae85d9cd093949fa056d3eeeead5",
"urls": ["pypi"]
}
},
@@ -128,37 +166,27 @@
{
"name": "pygments",
"unix": {
"filename": "Pygments-2.6.1.tar.gz",
"hash": "sha256:647344a061c249a3b74e230c739f434d7ea4d8b1d5f3721bc0f3558049b38f44",
"filename": "Pygments-2.11.2.tar.gz",
"hash": "sha256:4e426f72023d88d03b2fa258de560726ce890ff3b630f88c21cbb8b2503b8c6a",
"urls": ["pypi"]
}
},
{
"name": "cmake",
"os": "macos",
"unix": {
"filename": "cmake-3.6.0.tar.gz",
"hash": "sha1:6b0d2d7d93c2e74f8890c4b8b824deb3b36d24b6",
"urls": ["https://cmake.org/files/v3.6/{filename}"]
}
},
{
"name": "libpng",
"unix": {
"filename": "libpng-1.6.37.tar.xz",
"hash": "sha256:505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca",
"urls": ["http://downloads.sourceforge.net/sourceforge/libpng/{filename}"]
"urls": ["https://downloads.sourceforge.net/sourceforge/libpng/{filename}"]
}
},
{
"name": "lcms2",
"unix": {
"filename": "lcms2-2.11.tar.gz",
"hash": "sha256:478c9c3938d7a91b1171de4616f8b04308a8676d73eadc19505b7ace41327f28",
"urls": ["https://github.com/mm2/Little-CMS/archive/2.11/{filename}"]
"filename": "lcms2-2.12.tar.gz",
"hash": "sha256:e501f1482fc424550ef3abbf86bf1c66090e1661249e89552d39ed5bf935df66",
"urls": ["https://github.com/mm2/Little-CMS/archive/2.12/{filename}"]
}
},
@@ -166,9 +194,9 @@
"name": "graphite",
"os": "linux",
"unix": {
"filename": "graphite2-1.3.5.tgz",
"hash": "md5:5b8d22a8bbf031838e31432868c0109c",
"urls": ["http://downloads.sourceforge.net/silgraphite/{filename}"]
"filename": "graphite2-1.3.14.tgz",
"hash": "sha256:f99d1c13aa5fa296898a181dff9b82fb25f6cc0933dbaa7a475d8109bd54209d",
"urls": ["https://downloads.sourceforge.net/silgraphite/{filename}"]
}
},
@@ -176,8 +204,8 @@
"name": "pcre",
"os": "linux",
"unix": {
"filename": "pcre-8.42.tar.bz2",
"hash": "md5:085b6aa253e0f91cae70b3cdbe8c1ac2",
"filename": "pcre-8.44.tar.bz2",
"hash": "sha256:19108658b23b3ec5058edc9f66ac545ea19f9537234be1ec62b714c84399366d",
"urls": ["https://ftp.pcre.org/pub/pcre/{filename}"]
}
},
@@ -196,9 +224,19 @@
"name": "glib",
"os": "linux",
"unix": {
"filename": "glib-2.65.1.tar.xz",
"hash": "sha256:bc63bf6c32713e0ee1dddc28e03f23b4a20c78bcb9a2c5b0f4eea41e46fb9cee",
"urls": ["https://ftp.gnome.org/pub/GNOME/sources/glib/2.65/{filename}"]
"filename": "glib-2.66.6.tar.xz",
"hash": "sha256:80fff9c63d2725834328071c42003c311f77f91caf2285195c587c62f5638329",
"urls": ["https://ftp.gnome.org/pub/GNOME/sources/glib/2.66/{filename}"]
}
},
{
"name": "brotli",
"os": "linux",
"unix": {
"filename": "brotli-1.0.9.tar.gz",
"hash": "sha256:f9e8d81d0405ba66d181529af42a3354f838c939095ff99930da6aa9cdf6fe46",
"urls": ["https://github.com/google/brotli/archive/v1.0.9/{filename}"]
}
},
@@ -206,8 +244,8 @@
"name": "freetype",
"os": "linux",
"unix": {
"filename": "freetype-2.9.1.tar.bz2",
"hash": "md5:60ef7d8160cd4bf8cb118ee9d65367ca",
"filename": "freetype-2.10.4.tar.xz",
"hash": "sha256:86a854d8905b19698bbc8f23b860bc104246ce4854dcea8e3b0fb21284f75784",
"urls": ["https://download.savannah.gnu.org/releases/freetype/{filename}"]
}
},
@@ -216,28 +254,18 @@
"name": "fontconfig",
"os": "linux",
"unix": {
"filename": "fontconfig-2.12.0.tar.bz2",
"hash": "sha256:b433e4efff1f68fdd8aac221ed1df3ff1e580ffedbada020a703fe64017d8224",
"urls": ["http://www.fontconfig.org/release/{filename}"]
"filename": "fontconfig-2.13.1.tar.bz2",
"hash": "sha256:f655dd2a986d7aa97e052261b36aa67b0a64989496361eca8d604e6414006741",
"urls": ["https://www.fontconfig.org/release/{filename}"]
}
},
{
"name": "harfbuzz",
"unix": {
"filename": "harfbuzz-1.7.2.tar.bz2",
"hash": "sha256:a790585e35c1a87f0dcc23580c84b7cc2324e6f67a2946178d278c2a36c790cb",
"urls": ["https://www.freedesktop.org/software/harfbuzz/release/{filename}"]
}
},
{
"name": "libxml2",
"os": "linux",
"unix": {
"filename": "libxml2-2.9.4.tar.gz",
"hash": "sha1:958ae70baf186263a4bd801a81dd5d682aedd1db",
"urls": ["ftp://xmlsoft.org/libxml2/{filename}"]
"filename": "harfbuzz-2.7.4.tar.xz",
"hash": "sha256:6ad11d653347bd25d8317589df4e431a2de372c0cf9be3543368e07ec23bb8e7",
"urls": ["https://github.com/harfbuzz/harfbuzz/releases/download/2.7.4/{filename}"]
}
},
@@ -245,8 +273,8 @@
"name": "wayland",
"os": "linux",
"unix": {
"filename": "wayland-1.18.0.tar.xz",
"hash": "sha256:4675a79f091020817a98fd0484e7208c8762242266967f55a67776936c2e294d",
"filename": "wayland-1.20.0.tar.xz",
"hash": "sha256:b8a034154c7059772e0fdbd27dbfcda6c732df29cae56a82274f6ec5d7cd8725",
"urls": ["https://wayland.freedesktop.org/releases/{filename}"]
}
},
@@ -255,8 +283,8 @@
"name": "wayland-protocols",
"os": "linux",
"unix": {
"filename": "wayland-protocols-1.20.tar.xz",
"hash": "sha256:9782b7a1a863d82d7c92478497d13c758f52e7da4f197aa16443f73de77e4de7",
"filename": "wayland-protocols-1.25.tar.xz",
"hash": "sha256:f1ff0f7199d0a0da337217dd8c99979967808dc37731a1e759e822b75b571460",
"urls": ["https://wayland.freedesktop.org/releases/{filename}"]
}
}

View File

@@ -4,8 +4,6 @@ import subprocess
files_to_exclude = '''\
kitty/wcwidth-std.h
kitty/glfw.c
kitty/keys.h
kitty/charsets.c
kitty/unicode-data.c
kitty/key_encoding.py
@@ -18,6 +16,11 @@ kitty/glfw-wrapper.c
kitty/emoji.h
kittens/unicode_input/names.h
kitty/parse-graphics-command.h
kitty/options/types.py
kitty/options/parse.py
kitty/options/to-c-generated.h
kittens/diff/options/types.py
kittens/diff/options/parse.py
'''
p = subprocess.Popen([

View File

@@ -1,8 +1,12 @@
# Minimal makefile for Sphinx documentation
#
ifdef FAIL_WARN
override FAIL_WARN=-W
endif
# You can set these variables from the command line.
SPHINXOPTS = -j auto -T $(FAIL_WARN)
SPHINXOPTS = -n -q -j auto -T $(FAIL_WARN) $(OPTS)
SPHINXBUILD = sphinx-build
SPHINXPROJ = kitty
SOURCEDIR = .
@@ -18,3 +22,7 @@ help:
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
develop-docs:
sphinx-autobuild --ignore "$(abspath $(SOURCEDIR))/generated/*" --watch ../kitty --watch ../kittens -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)

View File

@@ -5,122 +5,32 @@
* Distributed under terms of the MIT license.
*/
.float-left-img {
float: left;
margin-right: 1em;
margin-bottom: 1em;
}
.float-right-img { float: right; margin-left: 1em; margin-bottom: 1em }
.half-with-img { max-width: 50% }
.fit-img { max-width: 95% }
div.body p, div.body dd, div.body li, div.body blockquote {
text-align: justify;
}
div.body {
min-width: 200px;
}
pre {
white-space: pre-wrap;
}
pre.pre {
white-space: pre;
}
a[href], input[type="submit"] { cursor: pointer; }
img[style] {
/* Used for :scale: images to have them render properly but still popup when clicked */
width: auto !important;
height: auto !important;
}
a {
text-decoration: none !important;
border-bottom: none !important;
}
body div.document {
margin-top: 1ex;
}
.major-features li {
margin-top: 0.75ex;
margin-bottom: 0.75ex;
}
.support-form input[type=submit] {
border-radius: 6px;
box-shadow: rgb(255, 246, 175) 0px 1px 0px 0px;
background: linear-gradient(rgb(255, 236, 100) 5%, rgb(255, 171, 35) 100%) rgb(255, 236, 100);
border: 1px solid rgb(255, 170, 34);
display: inline-block;
color: rgb(51, 51, 51);
font-family: Arial;
font-size: 15px;
font-weight: bold;
padding: 6px 24px;
text-decoration: none;
text-shadow: rgb(255, 238, 102) 0px 1px 0px;
}
.support-form input[type=submit]:hover {
background: linear-gradient(rgb(255, 171, 35) 5%, rgb(255, 236, 100) 100%) rgb(255, 171, 35);
}
.support-form input[type=submit]:focus {
outline: 0;
}
div.sphinxsidebar {
font-size: inherit;
line-height: inherit;
max-height: 100%;
overflow-y: auto;
}
#sidebartoc li {
margin-top: 0.75ex;
margin-bottom: 0.75ex;
}
#sidebartoc ul {
list-style: none !important;
}
#sidebartoc a[href]:hover {
color: red;
}
.green {
color: green;
}
.cyan {
color: blue;
}
.env {
font-style: italic;
}
.italic {
font-style: italic;
}
.bold {
font-weight: bold;
.sidebar-logo {
height: 128px;
}
.title {
font-size: larger;
font-weight: bold
.major-features li {
margin-bottom: 0.75ex;
margin-top: 0.75ex;
}
.sidebar-tree a.current {
font-style: italic;
}
details > summary {
color: var(--color-link);
cursor: pointer;
text-decoration-color: var(--color-link-underline);
text-decoration-line: underline;
}
/* pygments adds an underline to some white-space, this is particularly visible in
* dark mode. Remove it. */
.highlight .w {
text-decoration: none
}

57
docs/_static/custom.js vendored Normal file
View File

@@ -0,0 +1,57 @@
/* vim:fileencoding=utf-8
*
* Copyright (C) 2021 Kovid Goyal <kovid at kovidgoyal.net>
*
* Distributed under terms of the GPLv3 license
*/
(function() {
"use strict";
function get_sidebar_tree() {
return document.querySelector('.sidebar-tree');
}
function scroll_sidebar_node_into_view(a) {
var ss = get_sidebar_tree().closest('.sidebar-scroll');
if (!ss || !a) return;
ss.style.position = 'relative';
var pos = 0;
while (true) {
pos += a.offsetTop;
a = a.offsetParent;
if (!a || a == ss) break;
}
ss.scrollTo({top: pos, behavior: 'instant'});
}
function mark_current_link(sidebar_tree, a, onload) {
var li = a.closest('li.has-children');
while (li) {
li.querySelector('input[type=checkbox]').setAttribute('checked', 'checked');
li = li.parentNode.closest('li.has-children');
}
sidebar_tree.querySelectorAll('.current').forEach(function (elem) {
elem.classList.remove('current');
});
if (onload) scroll_sidebar_node_into_view(a);
a.classList.add('current');
}
function show_hash_in_sidebar(onload) {
var sidebar_tree = document.querySelector('.sidebar-tree');
if (document.location.hash.length > 1) {
var a = sidebar_tree.querySelector('a[href="' + document.location.hash + '"]');
if (a) mark_current_link(sidebar_tree, a, onload);
} else {
if (onload) scroll_sidebar_node_into_view(sidebar_tree.querySelector('.current-page a'));
}
}
document.addEventListener("DOMContentLoaded", function() {
show_hash_in_sidebar(true);
window.addEventListener('hashchange', show_hash_in_sidebar.bind(null, false));
});
}());

BIN
docs/_static/poster.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

18
docs/_templates/base.html vendored Normal file
View File

@@ -0,0 +1,18 @@
{% extends "!base.html" %}
{% block extrahead %}
{{ super() }}
{%- if analytics_id %}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ analytics_id }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ analytics_id }}');
</script>
{% endif -%}
{% endblock %}

View File

@@ -1,6 +0,0 @@
{% extends "!layout.html" %}
{%- block extrahead %}
<!-- kitty analytics placeholder -->
{{ super() }}
{% endblock %}

View File

@@ -1,6 +0,0 @@
{%- if display_toc %}
<div>&nbsp;</div>
<div id="sidebartoc">
{{ toc }}
</div>
{%- endif %}

View File

@@ -1,22 +0,0 @@
{#
basic/searchbox.html
~~~~~~~~~~~~~~~~~~~~
Sphinx sidebar template: quick search box.
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
#}
{%- if pagename != "search" and builder != "singlehtml" %}
<div id="searchbox" style="display: none" role="search">
<div class="searchformwrapper">
<form class="search" action="{{ pathto('search') }}" method="get">
<input type="text" name="q" placeholder="{{ _('Search') }}" />
<input type="submit" value="{{ _('Go') }}" style="cursor: pointer" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
{%- endif %}

View File

@@ -1,7 +0,0 @@
{% if pagename != "support" %}
<div id="support" style="text-align: center">
<form class="support-form" action="{{ pathto('support') }}" title="{{ _('Donate to support kitty development') }}">
<input type="submit" value="{{ _('Support kitty') }}">
</form>
</div>
{% endif %}

10
docs/actions.rst Normal file
View File

@@ -0,0 +1,10 @@
Mappable actions
-----------------------
.. highlight:: conf
The actions described below can be mapped to any key press or mouse action
using the ``map`` and ``mouse_map`` directives in :file:`kitty.conf`. For
configuration examples, see the default shortcut links for each action.
.. include:: /generated/actions.rst

147
docs/basic.rst Normal file
View File

@@ -0,0 +1,147 @@
Tabs and Windows
-------------------
|kitty| is capable of running multiple programs organized into tabs and windows.
The top level of organization is the :term:`OS window <os_window>`. Each OS
window consists of one or more :term:`tabs <tab>`. Each tab consists of one or more
:term:`kitty windows <window>`. The kitty windows can be arranged in multiple
different :term:`layouts <layout>`, like windows are organized in a tiling
window manager. The keyboard controls (which are :ref:`all customizable
<conf-kitty-shortcuts>`) for tabs and windows are:
Scrolling
~~~~~~~~~~~~~~
========================= =======================
Action Shortcut
========================= =======================
Line up :sc:`scroll_line_up` (also :kbd:`⌥+⌘+⇞` and :kbd:`⌘+↑` on macOS)
Line down :sc:`scroll_line_down` (also :kbd:`⌥+⌘+⇟` and :kbd:`⌘+↓` on macOS)
Page up :sc:`scroll_page_up` (also :kbd:`⌘+⇞` on macOS)
Page down :sc:`scroll_page_down` (also :kbd:`⌘+⇟` on macOS)
Top :sc:`scroll_home` (also :kbd:`⌘+↖` on macOS)
Bottom :sc:`scroll_end` (also :kbd:`⌘+↘` on macOS)
Previous shell prompt :sc:`scroll_to_previous_prompt` (see :ref:`shell_integration`)
Next shell prompt :sc:`scroll_to_next_prompt` (see :ref:`shell_integration`)
Browse scrollback in less :sc:`show_scrollback`
Browse last cmd output :sc:`show_last_command_output` (see :ref:`shell_integration`)
========================= =======================
Tabs
~~~~~~~~~~~
======================== =======================
Action Shortcut
======================== =======================
New tab :sc:`new_tab` (also :kbd:`⌘+t` on macOS)
Close tab :sc:`close_tab` (also :kbd:`⌘+w` on macOS)
Next tab :sc:`next_tab` (also :kbd:`⌃+⇥` and :kbd:`⇧+⌘+]` on macOS)
Previous tab :sc:`previous_tab` (also :kbd:`⇧+⌃+⇥` and :kbd:`⇧+⌘+[` on macOS)
Next layout :sc:`next_layout`
Move tab forward :sc:`move_tab_forward`
Move tab backward :sc:`move_tab_backward`
Set tab title :sc:`set_tab_title` (also :kbd:`⇧+⌘+i` on macOS)
======================== =======================
Windows
~~~~~~~~~~~~~~~~~~
======================== =======================
Action Shortcut
======================== =======================
New window :sc:`new_window` (also :kbd:`⌘+↩` on macOS)
New OS window :sc:`new_os_window` (also :kbd:`⌘+n` on macOS)
Close window :sc:`close_window` (also :kbd:`⇧+⌘+d` on macOS)
Next window :sc:`next_window`
Previous window :sc:`previous_window`
Move window forward :sc:`move_window_forward`
Move window backward :sc:`move_window_backward`
Move window to top :sc:`move_window_to_top`
Visually focus window :sc:`focus_visible_window`
Visually swap window :sc:`swap_with_window`
Focus specific window :sc:`first_window`, :sc:`second_window` ... :sc:`tenth_window`
(also :kbd:`⌘+1`, :kbd:`⌘+2` ... :kbd:`⌘+9` on macOS)
(clockwise from the top-left)
======================== =======================
Additionally, you can define shortcuts in :file:`kitty.conf` to focus
neighboring windows and move windows around (similar to window movement in
:program:`vim`)::
map ctrl+left neighboring_window left
map shift+left move_window right
map ctrl+down neighboring_window down
map shift+down move_window up
...
You can also define a shortcut to switch to the previously active window::
map ctrl+p nth_window -1
:ac:`nth_window` will focus the nth window for positive numbers (starting from
zero) and the previously active windows for negative numbers.
To switch to the nth OS window, you can define :ac:`nth_os_window`. Only
positive numbers are accepted, starting from one.
.. _detach_window:
You can define shortcuts to detach the current window and move it to another tab
or another OS window::
# moves the window into a new OS window
map ctrl+f2 detach_window
# moves the window into a new tab
map ctrl+f3 detach_window new-tab
# moves the window into the previously active tab
map ctrl+f3 detach_window tab-prev
# moves the window into the tab at the left of the active tab
map ctrl+f3 detach_window tab-left
# asks which tab to move the window into
map ctrl+f4 detach_window ask
Similarly, you can detach the current tab, with::
# moves the tab into a new OS window
map ctrl+f2 detach_tab
# asks which OS Window to move the tab into
map ctrl+f4 detach_tab ask
Finally, you can define a shortcut to close all windows in a tab other than the
currently active window::
map f9 close_other_windows_in_tab
Other keyboard shortcuts
----------------------------------
The full list of actions that can be mapped to key presses is available
:doc:`here </actions>`.
================================== =======================
Action Shortcut
================================== =======================
Show this help :sc:`show_kitty_doc`
Copy to clipboard :sc:`copy_to_clipboard` (also :kbd:`⌘+c` on macOS)
Paste from clipboard :sc:`paste_from_clipboard` (also :kbd:`⌘+v` on macOS)
Paste from selection :sc:`paste_from_selection`
Pass selection to program :sc:`pass_selection_to_program`
Increase font size :sc:`increase_font_size` (also :kbd:`⌘++` on macOS)
Decrease font size :sc:`decrease_font_size` (also :kbd:`⌘+-` on macOS)
Restore font size :sc:`reset_font_size` (also :kbd:`⌘+0` on macOS)
Toggle fullscreen :sc:`toggle_fullscreen` (also :kbd:`⌃+⌘+f` on macOS)
Toggle maximized :sc:`toggle_maximized`
Input Unicode character :sc:`input_unicode_character` (also :kbd:`⌃+⌘+space` on macOS)
Open URL in web browser :sc:`open_url`
Reset the terminal :sc:`reset_terminal` (also :kbd:`⌥+⌘+r` on macOS)
Edit :file:`kitty.conf` :sc:`edit_config_file` (also :kbd:`⌘+,` on macOS)
Reload :file:`kitty.conf` :sc:`reload_config_file` (also :kbd:`⌃+⌘+,` on macOS)
Debug :file:`kitty.conf` :sc:`debug_config` (also :kbd:`⌥+⌘+,` on macOS)
Open a |kitty| shell :sc:`kitty_shell`
Increase background opacity :sc:`increase_background_opacity`
Decrease background opacity :sc:`decrease_background_opacity`
Full background opacity :sc:`full_background_opacity`
Reset background opacity :sc:`reset_background_opacity`
================================== =======================

View File

@@ -1,17 +1,17 @@
kitty - Binary install
Install kitty
========================
.. |ins| replace:: curl -L :literal:`https://sw.kovidgoyal.net/kitty/installer.sh` | sh /dev/stdin
Binary install
----------------
.. highlight:: sh
You can install pre-built binaries of |kitty| if you are on macOS or Linux using
the following simple command:
.. parsed-literal::
:class: pre
.. code-block:: sh
|ins|
_kitty_install_cmd
The binaries will be installed in the standard location for your OS,
@@ -19,17 +19,23 @@ The binaries will be installed in the standard location for your OS,
Linux. The installer only touches files in that directory. To update kitty,
simply re-run the command.
.. warning::
**Do not** copy the kitty binary out of the installation folder. If you want
to add it to your :envvar:`PATH`, create a symlink in :file:`~/.local/bin` or
:file:`/usr/bin` or wherever.
Manually installing
---------------------
If something goes wrong or you simply do not want to run the installer, you can
manually download and install |kitty| from the `GitHub releases page
<https://github.com/kovidgoyal/kitty/releases>`_. If you are on macOS, download
the :file:`.dmg` and install as normal. If you are on Linux, download the tarball
and extract it into a directory. The |kitty| executable will be in the
<https://github.com/kovidgoyal/kitty/releases>`__. If you are on macOS, download
the :file:`.dmg` and install as normal. If you are on Linux, download the
tarball and extract it into a directory. The |kitty| executable will be in the
:file:`bin` sub-directory.
Desktop integration on Linux
--------------------------------
@@ -41,43 +47,78 @@ particular desktop, but it should work for most major desktop environments.
.. code-block:: sh
# Create a symbolic link to add kitty to PATH (assuming ~/.local/bin is in
# your PATH)
# your system-wide PATH)
ln -s ~/.local/kitty.app/bin/kitty ~/.local/bin/
# Place the kitty.desktop file somewhere it can be found by the OS
cp ~/.local/kitty.app/share/applications/kitty.desktop ~/.local/share/applications
# Update the path to the kitty icon in the kitty.desktop file
sed -i "s|Icon=kitty|Icon=/home/$USER/.local/kitty.app/share/icons/hicolor/256x256/apps/kitty.png|g" ~/.local/share/applications/kitty.desktop
cp ~/.local/kitty.app/share/applications/kitty.desktop ~/.local/share/applications/
# If you want to open text files and images in kitty via your file manager also add the kitty-open.desktop file
cp ~/.local/kitty.app/share/applications/kitty-open.desktop ~/.local/share/applications/
# Update the paths to the kitty and its icon in the kitty.desktop file(s)
sed -i "s|Icon=kitty|Icon=/home/$USER/.local/kitty.app/share/icons/hicolor/256x256/apps/kitty.png|g" ~/.local/share/applications/kitty*.desktop
sed -i "s|Exec=kitty|Exec=/home/$USER/.local/kitty.app/bin/kitty|g" ~/.local/share/applications/kitty*.desktop
.. note::
In :file:`kitty-open.desktop`, kitty is registered to handle some supported
MIME types. This will cause kitty to take precedence on some systems where
the default apps are not explicitly set. For example, you expect to use
other GUI file managers to open dir paths when using commands such as
:program:`xdg-open`, you should configure the default opener for the MIME
type ``inode/directory``::
xdg-mime default org.kde.dolphin.desktop inode/directory
.. note::
If you use the venerable `stow <https://www.gnu.org/software/stow/>`__
command to manage your manual installations, the following takes care of the
above for you (use with :code:`dest=~/.local/stow`)::
cd ~/.local/stow
stow -v kitty.app
Customizing the installation
--------------------------------
.. _nightly:
* You can install the latest nightly kitty build with ``installer``:
.. code-block:: sh
_kitty_install_cmd \
installer=nightly
If you want to install it in parallel to the released kitty specify a
different install locations with ``dest``:
.. code-block:: sh
_kitty_install_cmd \
installer=nightly dest=/some/other/location
* You can specify a different install location, with ``dest``:
.. parsed-literal::
:class: pre
.. code-block:: sh
|ins| \\
_kitty_install_cmd \
dest=/some/other/location
* You can tell the installer not to launch |kitty| after installing it with
``launch=n``:
.. parsed-literal::
:class: pre
.. code-block:: sh
|ins| \\
_kitty_install_cmd \
launch=n
* You can use a previously downloaded dmg/tarball, with ``installer``:
.. parsed-literal::
:class: pre
.. code-block:: sh
|ins| \\
_kitty_install_cmd \
installer=/path/to/dmg or tarball
Uninstalling
----------------

View File

@@ -1,37 +1,69 @@
Building kitty from source
==============================
Build from source
==================
.. image:: https://github.com/kovidgoyal/kitty/workflows/CI/badge.svg
:alt: Build status
:target: https://github.com/kovidgoyal/kitty/actions?query=workflow%3ACI
.. highlight:: sh
|kitty| is designed to run from source, for easy hack-ability. Make sure the
following dependencies are installed first.
.. note::
If you just want to test the latest changes to kitty, you don't need to build
from source. Instead install the :ref:`latest nightly build <nightly>`.
.. note::
If you are making small changes only to the Python parts of kitty, there is
no need to build kitty at all, instead, assuming you have installed the
official kitty binaries, you can simply set the :envvar:`KITTY_DEVELOP_FROM`
enviroment variable to point to the directory into which you have checked out
the kitty source code. kitty will then load its Python code from there. You
should use a version of the source that matches the binary version as closely
as possible, since the two are tightly coupled.
|kitty| is designed to run from source, for easy hackability. Make sure
the following dependencies are installed first.
Dependencies
----------------
Run-time dependencies:
* python >= 3.5
* harfbuzz >= 1.5.0
* zlib
* libpng
* liblcms2
* freetype (not needed on macOS)
* fontconfig (not needed on macOS)
* libcanberra (not needed on macOS)
* ImageMagick (optional, needed to use the ``kitty icat`` tool to display images in the terminal)
* pygments (optional, need for syntax highlighting in ``kitty +kitten diff``)
* ``python`` >= 3.8
* ``harfbuzz`` >= 2.2.0
* ``zlib``
* ``libpng``
* ``liblcms2``
* ``librsync``
* ``openssl``
* ``freetype`` (not needed on macOS)
* ``fontconfig`` (not needed on macOS)
* ``libcanberra`` (not needed on macOS)
* ``ImageMagick`` (optional, needed to use the ``kitty +kitten icat`` tool to display images in the terminal)
* ``pygments`` (optional, needed for syntax highlighting in ``kitty +kitten diff``)
Build-time dependencies:
* gcc or clang
* pkg-config
* For building on Linux in addition to the above dependencies you might also need to install the ``-dev`` packages for:
``libdbus-1-dev``, ``libxcursor-dev``, ``libxrandr-dev``, ``libxi-dev``, ``libxinerama-dev``, ``libgl1-mesa-dev``, ``libxkbcommon-x11-dev``, ``libfontconfig-dev``, and ``libpython3-dev``,
if they are not already installed by your distro.
* ``gcc`` or ``clang``
* ``pkg-config``
* For building on Linux in addition to the above dependencies you might also
need to install the following packages, if they are not already installed by
your distro:
- ``libdbus-1-dev``
- ``libxcursor-dev``
- ``libxrandr-dev``
- ``libxi-dev``
- ``libxinerama-dev``
- ``libgl1-mesa-dev``
- ``libxkbcommon-x11-dev``
- ``libfontconfig-dev``
- ``libx11-xcb-dev``
- ``liblcms2-dev``
- ``libpython3-dev``
- ``librsync-dev``
Install and run from source
------------------------------
@@ -48,9 +80,12 @@ You can run |kitty|, as::
./kitty/launcher/kitty
If that works, you can create a symlink to the launcher in :file:`~/bin` or
some other directory on your PATH so that you can run |kitty| using
just ``kitty``.
If that works, you can create a symlink to the launcher in :file:`~/bin` or some
other directory on your PATH so that you can run |kitty| using just ``kitty``.
To have the kitty documentation available locally, run::
python3 -m pip install -r docs/requirements.txt && make docs
Building kitty.app on macOS from source
@@ -58,78 +93,109 @@ Building kitty.app on macOS from source
Run::
python3 -m pip install -r docs/requirements.txt && make docs
make app
Building the docs needs to be done only once.
This :file:`kitty.app` unlike the released one does not include its own copy of
python and the other dependencies. So if you ever un-install/upgrade those dependencies
you might have to rebuild the app.
Python and the other dependencies. So if you ever un-install/upgrade those
dependencies you might have to rebuild the app.
.. note::
The released :file:`kitty.dmg` includes all dependencies, unlike the
:file:`kitty.app` built above and is built automatically by using the
:file:`kitty` branch of `build-calibre
<https://github.com/kovidgoyal/build-calibre>`_ however, that is designed to
run on Linux and is not for the faint of heart.
`bypy framework <https://github.com/kovidgoyal/bypy>`__ however, that is
designed to run on Linux and is not for the faint of heart.
.. note::
Apple disallows certain functionality, such as notifications for unsigned applications.
If you need this functionality, you can try signing the built kitty.app with
a self signed certificate, see for example, `here
<https://stackoverflow.com/questions/27474751/how-can-i-codesign-an-app-without-being-in-the-mac-developer-program/27474942>`_.
Apple disallows certain functionality, such as notifications for unsigned
applications. If you need this functionality, you can try signing the built
:file:`kitty.app` with a self signed certificate, see for example, `here
<https://stackoverflow.com/questions/27474751/how-can-i-codesign-an-app-without-being-in-the-mac-developer-program/27474942>`__.
.. note::
If you are facing issues with ``linker`` while building, try with a ``brew``
installed Python instead, see :iss:`289` for more discussion.
Build and run from source with Nix
-------------------------------------------
On NixOS or any other Linux or macOS system with the Nix package manager
installed, execute `nix-shell
<https://nixos.org/guides/nix-pills/developing-with-nix-shell.html>`_ to create
<https://nixos.org/guides/nix-pills/developing-with-nix-shell.html>`__ to create
the correct environment to build kitty or use ``nix-shell --pure`` instead to
eliminate most of the influence of the outside system, e.g. globally installed
packages. ``nix-shell`` will automatically fetch all required dependencies and
make them available in the newly spawned shell.
Then proceed with ``make`` or ``make app`` according to the platform specific instructions above.
Then proceed with ``make`` or ``make app`` according to the platform specific
instructions above.
Note for Linux/macOS packagers
Debug builds
--------------
A basic debug build can be done with::
make debug
This includes debug info in the binary for better traces. To build with address
sanitizer, use::
make asan
Which will result in a debug binary that uses the address sanitizer as well.
.. _packagers:
Notes for Linux/macOS packagers
----------------------------------
The released |kitty| source code is available as a `tarball`_ from
`the GitHub releases page <https://github.com/kovidgoyal/kitty/releases>`_.
`the GitHub releases page <https://github.com/kovidgoyal/kitty/releases>`__.
While |kitty| does use python, it is not a traditional python package, so please
While |kitty| does use Python, it is not a traditional Python package, so please
do not install it in site-packages.
Instead run::
python3 setup.py linux-package
make linux-package
This will install |kitty| into the directory :file:`linux-package`. You can run |kitty|
with :file:`linux-package/bin/kitty`. All the files needed to run kitty will be in
:file:`linux-package/lib/kitty`. The terminfo file will be installed into
:file:`linux-package/share/terminfo`. Simply copy these files into :file:`/usr` to install
|kitty|. In other words, :file:`linux-package` is the staging area into which |kitty| is
installed. You can choose a different staging area, by passing the ``--prefix``
argument to :file:`setup.py`.
This will install |kitty| into the directory :file:`linux-package`. You can run
|kitty| with :file:`linux-package/bin/kitty`. All the files needed to run kitty
will be in :file:`linux-package/lib/kitty`. The terminfo file will be installed
into :file:`linux-package/share/terminfo`. Simply copy these files into
:file:`/usr` to install |kitty|. In other words, :file:`linux-package` is the
staging area into which |kitty| is installed. You can choose a different staging
area, by passing the ``--prefix`` argument to :file:`setup.py`.
You should probably split |kitty| into two packages, :file:`kitty-terminfo` that
installs the terminfo file and :file:`kitty` that installs the main program.
This allows users to install the terminfo file on servers into which they ssh,
without needing to install all of |kitty|.
You should probably split |kitty| into three packages:
:code:`kitty-terminfo`
Installs the terminfo file
:code:`kitty-shell-integration`
Installs the shell integration scripts (the contents of the
shell-integration directory in the kitty source code), probably to
:file:`/usr/share/kitty/shell-integration`
:code:`kitty`
Installs the main program
This allows users to install the terminfo and shell integration files on
servers into which they ssh, without needing to install all of |kitty|. The
shell integration files **must** still be present in
:file:`lib/kitty/shell-integration` when installing the kitty main package as
the kitty program expects to find them there.
.. note::
You need a couple of extra dependencies to build linux-package.
:file:`tic` to compile terminfo files, usually found in the
development package of :file:`ncurses`. Also, if you are building from
a git checkout instead of the released source code tarball, you will
need :file:`sphinx-build` from the `Sphinx documentation generator
<https://www.sphinx-doc.org/>`_.
You need a couple of extra dependencies to build linux-package. :file:`tic`
to compile terminfo files, usually found in the development package of
:file:`ncurses`. Also, if you are building from a git checkout instead of the
released source code tarball, you will need to install the dependencies from
:file:`docs/requirements.txt` to build the kitty documentation. They can be
installed most easily with ``python -m pip -r docs/requirements.txt``.
This applies to creating packages for |kitty| for macOS package managers such as
brew or MacPorts as well.
.. note::
|kitty| has its own update check mechanism, if you would like to turn
it off for your package, use
``python3 setup.py linux-package --update-check-interval=0``
Homebrew or MacPorts as well.

File diff suppressed because it is too large Load Diff

26
docs/color-stack.rst Normal file
View File

@@ -0,0 +1,26 @@
Saving and restoring colors
==============================
It is often useful for a full screen application with its own color themes to
set the default foreground, background, selection and cursor colors and the ANSI
color table. This allows for various performance optimizations when drawing the
screen. The problem is that if the user previously used the escape codes to
change these colors themselves, then running the full screen application will
lose those changes even after it exits. To avoid this, kitty introduces a new
pair of *OSC* escape codes to push and pop the current color values from a
stack::
<ESC>]30001<ESC>\ # push onto stack
<ESC>]30101<ESC>\ # pop from stack
These escape codes save/restore the colors, default background, default
foreground, selection background, selection foreground and cursor color and the
256 colors of the ANSI color table.
.. note:: In July 2020, after several years, xterm copied this protocol
extension, without acknowledgement, and using incompatible escape codes
(XTPUSHCOLORS, XTPOPCOLORS, XTREPORTCOLORS). And they decided to save not
just the dynamic colors but the entire ANSI color table. In the interests of
promoting interoperability, kitty added support for xterm's escape codes as
well, and changed this extension to also save/restore the entire ANSI color
table.

View File

@@ -13,10 +13,7 @@ import subprocess
import sys
import time
from functools import partial
from typing import (
Any, Callable, Dict, Iterable, List, Match, Optional, Sequence, Tuple,
Union
)
from typing import Any, Callable, Dict, Iterable, List, Tuple
from docutils import nodes
from docutils.parsers.rst.roles import set_classes
@@ -24,17 +21,15 @@ from pygments.lexer import RegexLexer, bygroups # type: ignore
from pygments.token import ( # type: ignore
Comment, Keyword, Literal, Name, Number, String, Whitespace
)
from sphinx import addnodes, version_info # type: ignore
from sphinx.environment.adapters.toctree import TocTree # type: ignore
from sphinx.util.logging import getLogger # type: ignore
from sphinx import addnodes, version_info
from sphinx.util.logging import getLogger
kitty_src = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if kitty_src not in sys.path:
sys.path.insert(0, kitty_src)
from kitty.conf.definition import Option, Shortcut # noqa
from kitty.constants import str_version # noqa
from kitty.conf.types import Definition, expand_opt_references # noqa
from kitty.constants import str_version, website_url # noqa
# config {{{
# -- Project information -----------------------------------------------------
@@ -64,8 +59,15 @@ extensions = [
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinx.ext.extlinks',
'sphinx_copybutton',
'sphinx_inline_tabs',
"sphinxext.opengraph",
]
# URL for OpenGraph tags
ogp_site_url = website_url()
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -83,31 +85,28 @@ master_doc = 'index'
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language: Optional[str] = None
language: str = 'en'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = [
'_build', 'Thumbs.db', '.DS_Store',
'generated/cli-*.rst', 'generated/conf-*.rst'
'_build', 'Thumbs.db', '.DS_Store', 'basic.rst',
'generated/cli-*.rst', 'generated/conf-*.rst', 'generated/actions.rst'
]
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
rst_prolog = '''
.. |kitty| replace:: *kitty*
.. |version| replace:: VERSION
.. _tarball: https://github.com/kovidgoyal/kitty/releases/download/vVERSION/kitty-VERSION.tar.xz
.. role:: green
.. role:: italic
.. role:: bold
.. role:: cyan
.. role:: title
.. role:: env
'''.replace('VERSION', str_version)
smartquotes_action = 'qe' # educate quotes and ellipses but not dashes
string_replacements = {
'_kitty_install_cmd': 'curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin',
}
# -- Options for HTML output -------------------------------------------------
@@ -115,35 +114,39 @@ rst_prolog = '''
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme = 'furo'
html_title = 'kitty'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {
'logo': 'kitty.png',
'show_powered_by': False,
'fixed_sidebar': True,
'sidebar_collapse': True,
'github_button': False,
'github_banner': True,
'github_user': 'kovidgoyal',
'github_repo': 'kitty',
# increase contrast of link color with text color
'link': '#00587d',
'link_hover': 'green',
github_icon_path = 'M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z' # noqa
html_theme_options: Dict[str, Any] = {
'sidebar_hide_name': True,
'navigation_with_keys': True,
'footer_icons': [
{
"name": "GitHub",
"url": "https://github.com/kovidgoyal/kitty",
"html": f"""
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="{github_icon_path}"></path>
</svg>
""",
"class": "",
},
],
}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static', '../logo/kitty.png']
html_context = {
'css_files': ['_static/custom.css']
}
html_favicon = '../logo/kitty.png'
html_static_path = ['_static']
html_favicon = html_logo = '../logo/kitty.svg'
html_css_files = ['custom.css']
html_js_files = ['custom.js']
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
@@ -153,25 +156,17 @@ html_favicon = '../logo/kitty.png'
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
html_sidebars = {
'**': [
'about.html',
'support.html',
'searchbox.html',
'localtoc.html',
'relations.html',
]
}
html_show_sourcelink = False
html_show_sphinx = False
manpages_url = 'https://man7.org/linux/man-pages/man{section}/{page}.{section}.html'
# -- Options for manual page output ------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('invocation', 'kitty', 'kitty Documentation',
[author], 1)
('invocation', 'kitty', 'kitty Documentation', [author], 1),
('conf', 'kitty.conf', 'kitty.conf Documentation', [author], 5)
]
@@ -182,7 +177,7 @@ man_pages = [
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'kitty', 'kitty Documentation',
author, 'kitty', 'A cross-platform, fast, feature full, GPU based terminal emulator',
author, 'kitty', 'Cross-platform, fast, feature-rich, GPU based terminal',
'Miscellaneous'),
]
# }}}
@@ -190,25 +185,16 @@ texinfo_documents = [
# GitHub linking inline roles {{{
def num_role(which: str, name: str, rawtext: str, text: str, lineno: int, inliner: Any, options: Any = {}, content: Any = []) -> Tuple[List, List]:
' Link to a github issue '
try:
issue_num = int(text)
if issue_num <= 0:
raise ValueError
except ValueError:
msg = inliner.reporter.error(
'GitHub issue number must be a number greater than or equal to 1; '
'"%s" is invalid.' % text, line=lineno)
prb = inliner.problematic(rawtext, rawtext, msg)
return [prb], [msg]
url = f'https://github.com/kovidgoyal/kitty/{which}/{issue_num}'
set_classes(options)
node = nodes.reference(rawtext, f'#{issue_num}', refuri=url, **options)
return [node], []
extlinks = {
'iss': ('https://github.com/kovidgoyal/kitty/issues/%s', '#%s'),
'pull': ('https://github.com/kovidgoyal/kitty/pull/%s', '#%s'),
'disc': ('https://github.com/kovidgoyal/kitty/discussions/%s', '#%s'),
}
def commit_role(name: str, rawtext: str, text: str, lineno: int, inliner: Any, options: Any = {}, content: Any = []) -> Tuple[List, List]:
def commit_role(
name: str, rawtext: str, text: str, lineno: int, inliner: Any, options: Any = {}, content: Any = []
) -> Tuple[List[nodes.reference], List[nodes.problematic]]:
' Link to a github commit '
try:
commit_id = subprocess.check_output(
@@ -227,32 +213,17 @@ def commit_role(name: str, rawtext: str, text: str, lineno: int, inliner: Any, o
# }}}
# Sidebar ToC {{{
def create_toc(app: Any, pagename: str) -> Optional[Any]:
tt = TocTree(app.env)
toctree = tt.get_toc_for(pagename, app.builder)
if toctree is not None:
subtree = toctree[toctree.first_child_matching_class(nodes.list_item)]
bl = subtree.first_child_matching_class(nodes.bullet_list)
if bl is None:
return None # Empty ToC
subtree = subtree[bl]
# for li in subtree.traverse(nodes.list_item):
# modify_li(li)
# subtree['ids'] = [ID]
return app.builder.render_partial(subtree)['fragment']
def add_html_context(app: Any, pagename: str, templatename: str, context: Any, *args: Any) -> None:
if 'toc' in context:
context['toc'] = create_toc(app, pagename) or context['toc']
# }}}
# CLI docs {{{
def write_cli_docs(all_kitten_names: Iterable[str]) -> None:
from kitty.launch import options_spec as launch_options_spec
from kitty.cli import option_spec_as_rst
from kitty.launch import options_spec as launch_options_spec
from kittens.ssh.copy import option_text
from kittens.ssh.options.definition import copy_message
with open('generated/ssh-copy.rst', 'w') as f:
f.write(option_spec_as_rst(
appname='copy', ospec=option_text, heading_char='^',
usage='file-or-dir-to-copy ...', message=copy_message
))
with open('generated/launch.rst', 'w') as f:
f.write(option_spec_as_rst(
appname='launch', ospec=launch_options_spec, heading_char='_',
@@ -267,18 +238,20 @@ if you specify a program-to-run you can use the special placeholder
'kitty --to', 'kitty @ --to'))
as_rst = partial(option_spec_as_rst, heading_char='_')
from kitty.rc.base import all_command_names, command_for_name
from kitty.remote_control import global_options_spec, cli_msg
from kitty.remote_control import cli_msg, global_options_spec
with open('generated/cli-kitty-at.rst', 'w') as f:
p = partial(print, file=f)
p('kitty @\n' + '-' * 80)
p('kitty @')
p('-' * 80)
p('.. program::', 'kitty @')
p('\n\n' + as_rst(
global_options_spec, message=cli_msg, usage='command ...', appname='kitty @'))
from kitty.rc.base import cli_params_for
for cmd_name in sorted(all_command_names()):
func = command_for_name(cmd_name)
p(f'.. _at_{func.name}:\n')
p('kitty @', func.name + '\n' + '-' * 120)
p(f'.. _at-{func.name}:\n')
p('kitty @', func.name)
p('-' * 120)
p('.. program::', 'kitty @', func.name)
p('\n\n' + as_rst(*cli_params_for(func)))
from kittens.runner import get_kitten_cli_docs
@@ -287,7 +260,12 @@ if you specify a program-to-run you can use the special placeholder
if data:
with open(f'generated/cli-kitten-{kitten}.rst', 'w') as f:
p = partial(print, file=f)
p('.. program::', f'kitty +kitten {kitten}')
p('.. program::', 'kitty +kitten', kitten)
p('\nSource code for', kitten)
p('-' * 72)
p(f'\nThe source code for this kitten is `available on GitHub <https://github.com/kovidgoyal/kitty/tree/master/kittens/{kitten}>`_.')
p('\nCommand Line Interface')
p('-' * 72)
p('\n\n' + option_spec_as_rst(
data['options'], message=data['help_text'], usage=data['usage'], appname=f'kitty +kitten {kitten}',
heading_char='^'))
@@ -296,10 +274,12 @@ if you specify a program-to-run you can use the special placeholder
def write_remote_control_protocol_docs() -> None: # {{{
from kitty.rc.base import all_command_names, command_for_name, RemoteCommand
field_pat = re.compile(r'\s*([a-zA-Z0-9_+]+)\s*:\s*(.+)')
from kitty.rc.base import (
RemoteCommand, all_command_names, command_for_name
)
field_pat = re.compile(r'\s*([a-zA-Z0-9_+/]+)\s*:\s*(.+)')
def format_cmd(p: Callable, name: str, cmd: RemoteCommand) -> None:
def format_cmd(p: Callable[..., None], name: str, cmd: RemoteCommand) -> None:
p(name)
p('-' * 80)
lines = (cmd.__doc__ or '').strip().splitlines()
@@ -309,7 +289,7 @@ def write_remote_control_protocol_docs() -> None: # {{{
if m is None:
p(line)
else:
fields.append((m.group(1), m.group(2)))
fields.append((m.group(1).split('/')[0], m.group(2)))
if fields:
p('\nFields are:\n')
for (name, desc) in fields:
@@ -337,9 +317,17 @@ def write_remote_control_protocol_docs() -> None: # {{{
# }}}
def replace_string(app: Any, docname: str, source: List[str]) -> None: # {{{
src = source[0]
for k, v in app.config.string_replacements.items():
src = src.replace(k, v)
source[0] = src
# }}}
# config file docs {{{
class ConfLexer(RegexLexer):
class ConfLexer(RegexLexer): # type: ignore
name = 'Conf'
aliases = ['conf']
filenames = ['*.conf']
@@ -352,6 +340,8 @@ class ConfLexer(RegexLexer):
(r'(include)(\s+)(.+?)$', bygroups(Comment.Preproc, Whitespace, Name.Namespace)),
(r'(map)(\s+)(\S+)(\s+)', bygroups(
Keyword.Declaration, Whitespace, String, Whitespace), 'action'),
(r'(mouse_map)(\s+)(\S+)(\s+)(\S+)(\s+)(\S+)(\s+)', bygroups(
Keyword.Declaration, Whitespace, String, Whitespace, Name.Variable, Whitespace, String, Whitespace), 'action'),
(r'(symbol_map)(\s+)(\S+)(\s+)(.+?)$', bygroups(
Keyword.Declaration, Whitespace, String, Whitespace, Literal)),
(r'([a-zA-Z_0-9]+)(\s+)', bygroups(
@@ -376,7 +366,7 @@ class ConfLexer(RegexLexer):
}
class SessionLexer(RegexLexer):
class SessionLexer(RegexLexer): # type: ignore
name = 'Session'
aliases = ['session']
filenames = ['*.session']
@@ -392,31 +382,22 @@ class SessionLexer(RegexLexer):
}
def link_role(name: str, rawtext: str, text: str, lineno: int, inliner: Any, options: Any = {}, content: Any = []) -> Tuple[List, List]:
def link_role(
name: str, rawtext: str, text: str, lineno: int, inliner: Any, options: Any = {}, content: Any = []
) -> Tuple[List[nodes.reference], List[nodes.problematic]]:
text = text.replace('\n', ' ')
m = re.match(r'(.+)\s+<(.+?)>', text)
if m is None:
msg = inliner.reporter.error(f'link "{text}" not recognized', line=lineno)
prb = inliner.problematic(rawtext, rawtext, msg)
return [prb], [msg]
text, url = m.group(1, 2)
url = url.replace(' ', '')
set_classes(options)
node = nodes.reference(rawtext, text, refuri=url, **options)
return [node], []
def expand_opt_references(conf_name: str, text: str) -> str:
conf_name += '.'
def expand(m: Match) -> str:
ref = m.group(1)
if '<' not in ref and '.' not in ref:
full_ref = conf_name + ref
return ':opt:`{} <{}>`'.format(ref, full_ref)
return str(m.group())
return re.sub(r':opt:`(.+?)`', expand, text)
opt_aliases: Dict[str, str] = {}
shortcut_slugs: Dict[str, Tuple[str, str]] = {}
@@ -439,7 +420,7 @@ def parse_opt_node(env: Any, sig: str, signode: Any) -> str:
opt_aliases[optname] = firstname
count += 1
if not firstname:
raise ValueError('{} is not a valid opt'.format(sig))
raise ValueError(f'{sig} is not a valid opt')
return firstname
@@ -450,104 +431,33 @@ def parse_shortcut_node(env: Any, sig: str, signode: Any) -> str:
return sig
def render_conf(conf_name: str, all_options: Iterable[Union['Option', Sequence['Shortcut']]]) -> str:
from kitty.conf.definition import merged_opts, Option, Group
ans = ['.. default-domain:: conf', '']
a = ans.append
current_group: Optional[Group] = None
all_options_ = list(all_options)
kitty_mod = 'kitty_mod'
def render_group(group: Group) -> None:
a('')
a(f'.. _conf-{conf_name}-{group.name}:')
a('')
a(group.short_text)
heading_level = '+' if '.' in group.name else '^'
a(heading_level * (len(group.short_text) + 20))
a('')
if group.start_text:
a(group.start_text)
a('')
def handle_group_end(group: Group) -> None:
if group.end_text:
assert current_group is not None
a(''), a(current_group.end_text)
def handle_group(new_group: Group, new_group_is_shortcut: bool = False) -> None:
nonlocal current_group
if new_group is not current_group:
if current_group:
handle_group_end(current_group)
current_group = new_group
render_group(current_group)
def handle_option(i: int, opt: Option) -> None:
nonlocal kitty_mod
if not opt.long_text or not opt.add_to_docs:
return
handle_group(opt.group)
if opt.name == 'kitty_mod':
kitty_mod = opt.defval_as_string
mopts = list(merged_opts(all_options_, opt, i))
a('.. opt:: ' + ', '.join(conf_name + '.' + mo.name for mo in mopts))
a('.. code-block:: conf')
a('')
sz = max(len(x.name) for x in mopts)
for mo in mopts:
a((' {:%ds} {}' % sz).format(mo.name, mo.defval_as_string))
a('')
if opt.long_text:
a(expand_opt_references(conf_name, opt.long_text))
a('')
def handle_shortcuts(shortcuts: Sequence[Shortcut]) -> None:
sc = shortcuts[0]
handle_group(sc.group, True)
sc_text = f'{conf_name}.{sc.short_text}'
a('.. shortcut:: ' + sc_text)
shortcuts = [s for s in shortcuts if s.add_to_default]
shortcut_slugs[f'{conf_name}.{sc.name}'] = (sc_text, sc.key.replace('kitty_mod', kitty_mod))
if shortcuts:
a('.. code-block:: conf')
a('')
for x in shortcuts:
if x.add_to_default:
a(' map {} {}'.format(x.key.replace('kitty_mod', kitty_mod), x.action_def))
a('')
if sc.long_text:
a(expand_opt_references(conf_name, sc.long_text))
a('')
for i, opt in enumerate(all_options_):
if isinstance(opt, Option):
handle_option(i, opt)
else:
handle_shortcuts(opt)
if current_group:
handle_group_end(current_group)
return '\n'.join(ans)
def parse_action_node(env: Any, sig: str, signode: Any) -> str:
"""Transform an action description into RST nodes."""
signode += addnodes.desc_name(sig, sig)
return sig
def process_opt_link(env: Any, refnode: Any, has_explicit_title: bool, title: str, target: str) -> Tuple[str, str]:
conf_name, opt = target.partition('.')[::2]
if not opt:
conf_name, opt = 'kitty', conf_name
full_name = conf_name + '.' + opt
full_name = f'{conf_name}.{opt}'
return title, opt_aliases.get(full_name, full_name)
def process_action_link(env: Any, refnode: Any, has_explicit_title: bool, title: str, target: str) -> Tuple[str, str]:
return title, target
def process_shortcut_link(env: Any, refnode: Any, has_explicit_title: bool, title: str, target: str) -> Tuple[str, str]:
conf_name, slug = target.partition('.')[::2]
if not slug:
conf_name, slug = 'kitty', conf_name
full_name = conf_name + '.' + slug
full_name = f'{conf_name}.{slug}'
try:
target, stitle = shortcut_slugs[full_name]
except KeyError:
logger.warning('Unknown shortcut: {}'.format(target), location=refnode)
logger.warning(f'Unknown shortcut: {target}', location=refnode)
else:
if not has_explicit_title:
title = stitle
@@ -574,29 +484,56 @@ def write_conf_docs(app: Any, all_kitten_names: Iterable[str]) -> None:
sc_role = app.registry.domain_roles['std']['sc']
sc_role.warn_dangling = True
sc_role.process_link = process_shortcut_link
shortcut_slugs.clear()
def generate_default_config(all_options: Dict[str, Union[Option, Sequence[Shortcut]]], name: str) -> None:
from kitty.conf.definition import as_conf_file
app.add_object_type(
'action', 'ac',
indextemplate="pair: %s; Action",
parse_node=parse_action_node,
)
ac_role = app.registry.domain_roles['std']['ac']
ac_role.warn_dangling = True
ac_role.process_link = process_action_link
def generate_default_config(definition: Definition, name: str) -> None:
with open(f'generated/conf-{name}.rst', 'w', encoding='utf-8') as f:
print('.. highlight:: conf\n', file=f)
f.write(render_conf(name, all_options.values()))
f.write('\n'.join(definition.as_rst(name, shortcut_slugs)))
conf_name = re.sub(r'^kitten-', '', name) + '.conf'
with open(f'generated/conf/{conf_name}', 'w', encoding='utf-8') as f:
text = '\n'.join(as_conf_file(all_options.values()))
text = '\n'.join(definition.as_conf())
print(text, file=f)
from kitty.config_data import all_options
generate_default_config(all_options, 'kitty')
from kitty.options.definition import definition
generate_default_config(definition, 'kitty')
from kittens.runner import get_kitten_conf_docs
for kitten in all_kitten_names:
all_options = get_kitten_conf_docs(kitten)
if all_options:
generate_default_config(all_options, f'kitten-{kitten}')
definition = get_kitten_conf_docs(kitten)
if definition:
generate_default_config(definition, f'kitten-{kitten}')
from kitty.actions import as_rst
with open('generated/actions.rst', 'w', encoding='utf-8') as f:
f.write(as_rst())
# }}}
def add_html_context(app: Any, pagename: str, templatename: str, context: Any, doctree: Any, *args: Any) -> None:
context['analytics_id'] = app.config.analytics_id
if 'toctree' in context:
# this is needed with furo to use all titles from pages
# in the sidebar (global) toc
original_toctee_function = context['toctree']
def include_sub_headings(**kwargs: Any) -> Any:
kwargs['titles_only'] = False
return original_toctee_function(**kwargs)
context['toctree'] = include_sub_headings
def setup(app: Any) -> None:
os.makedirs('generated/conf', exist_ok=True)
from kittens.runner import all_kitten_names
@@ -604,9 +541,14 @@ def setup(app: Any) -> None:
write_cli_docs(kn)
write_remote_control_protocol_docs()
write_conf_docs(app, kn)
app.add_config_value('string_replacements', {}, True)
app.connect('source-read', replace_string)
app.add_config_value('analytics_id', '', 'env')
app.connect('html-page-context', add_html_context)
app.add_lexer('session', SessionLexer() if version_info[0] < 3 else SessionLexer)
app.add_role('link', link_role)
app.add_role('iss', partial(num_role, 'issues'))
app.add_role('pull', partial(num_role, 'pull'))
app.add_role('commit', commit_role)
app.connect('html-page-context', add_html_context)
# monkey patch sphinx_inline_tabs to avoid a warning about parallel reads
# see https://github.com/pradyunsg/sphinx-inline-tabs/issues/26
inline_tabs = app.extensions['sphinx_inline_tabs']
inline_tabs.parallel_read_safe = inline_tabs.parallel_write_safe = True

View File

@@ -1,44 +1,78 @@
:tocdepth: 2
Configuring kitty
===============================
kitty.conf
-----------------------
.. highlight:: conf
|kitty| is highly customizable, everything from keyboard shortcuts, to painting
frames-per-second. See below for an overview of all customization
possibilities.
|kitty| is highly customizable, everything from keyboard shortcuts, to rendering
frames-per-second. See below for an overview of all customization possibilities.
You can open the config file within kitty by pressing :sc:`edit_config_file`.
You can also display the current configuration by running ``kitty
--debug-config``.
You can open the config file within kitty by pressing :sc:`edit_config_file`
(:kbd:`⌘+,` on macOS). A :file:`kitty.conf` with commented default
configurations and descriptions will be created if the file does not exist.
You can reload the config file within kitty by pressing :sc:`reload_config_file`
(:kbd:`⌃+⌘+,` on macOS) or sending kitty the ``SIGUSR1`` signal.
You can also display the current configuration by pressing :sc:`debug_config`
(:kbd:`⌥+⌘+,` on macOS).
.. _confloc:
|kitty| looks for a config file in the OS config directories (usually
:file:`~/.config/kitty/kitty.conf`) but you can pass a specific path via the
:option:`kitty --config` option or use the ``KITTY_CONFIG_DIRECTORY``
environment variable. See the :option:`kitty --config` option for full details.
:option:`kitty --config` option or use the :envvar:`KITTY_CONFIG_DIRECTORY`
environment variable. See :option:`kitty --config` for full details.
Comments can be added to the config file as lines starting with the ``#``
character. This works only if the ``#`` character is the first character
in the line.
character. This works only if the ``#`` character is the first character in the
line.
.. _include:
You can include secondary config files via the :code:`include` directive. If
you use a relative path for include, it is resolved with respect to the
you use a relative path for :code:`include`, it is resolved with respect to the
location of the current config file. Note that environment variables are
expanded, so :code:`${USER}.conf` becomes :file:`name.conf` if
:code:`USER=name`. For example::
:code:`USER=name`. Also, you can use :code:`globinclude` to include files
matching a shell glob pattern and :code:`envinclude` to include configuration
from environment variables. For example::
include other.conf
# Include *.conf files from all subdirs of kitty.d inside the kitty config dir
globinclude kitty.d/**/*.conf
# Include the *contents* of all env vars starting with KITTY_CONF_
envinclude KITTY_CONF_*
.. note:: Syntax highlighting for :file:`kitty.conf` in vim is available via
`vim-kitty <https://github.com/fladson/vim-kitty>`__.
.. include:: /generated/conf-kitty.rst
Sample kitty.conf
^^^^^^^^^^^^^^^^^^^^^
--------------------
You can download a sample :file:`kitty.conf` file with all default settings and
comments describing each setting by clicking: :download:`sample kitty.conf
</generated/conf/kitty.conf>`.
.. only:: html
You can download a sample :file:`kitty.conf` file with all default settings
and comments describing each setting by clicking: :download:`sample
kitty.conf </generated/conf/kitty.conf>`.
.. only:: man
You can edit a fully commented sample kitty.conf by pressing the
:sc:`edit_config_file` shortcut in kitty. This will generate a config file
with full documentation and all settings commented out. If you have a
pre-existing :file:`kitty.conf`, then that will be used instead, delete it to
see the sample file.
All mappable actions
------------------------
See the :doc:`list of all the things you can make kitty can do </actions>`.
.. toctree::
:hidden:
actions

20
docs/deccara.rst Normal file
View File

@@ -0,0 +1,20 @@
Setting text styles/colors in arbitrary regions of the screen
------------------------------------------------------------------
There already exists an escape code to set *some* text attributes in arbitrary
regions of the screen, `DECCARA
<https://vt100.net/docs/vt510-rm/DECCARA.html>`__. However, it is limited to
only a few attributes. |kitty| extends this to work with *all* SGR attributes.
So, for example, this can be used to set the background color in an arbitrary
region of the screen.
The motivation for this extension is the various problems with the existing
solution for erasing to background color, namely the *background color erase
(bce)* capability. See :iss:`this discussion <160#issuecomment-346470545>`
and `this FAQ <https://invisible-island.net/ncurses/ncurses.faq.html#bce_mismatches>`__
for a summary of problems with *bce*.
For example, to set the background color to blue in a rectangular region of the
screen from (3, 4) to (10, 11), you use::
<ESC>[2*x<ESC>[4;3;11;10;44$r<ESC>[*x

View File

@@ -0,0 +1,121 @@
.. _desktop_notifications:
Desktop notifications
=======================
|kitty| implements an extensible escape code (OSC 99) to show desktop
notifications. It is easy to use from shell scripts and fully extensible to show
title and body. Clicking on the notification can optionally focus the window it
came from, and/or send an escape code back to the application running in that
window.
The design of the escape code is partially based on the discussion in the
defunct `terminal-wg <https://gitlab.freedesktop.org/terminal-wg/specifications/-/issues/13>`__
The escape code has the form::
<OSC> 99 ; metadata ; payload <terminator>
Here ``<OSC>`` is :code:`<ESC>]` and ``<terminator>`` is
:code:`<ESC><backslash>`. The ``metadata`` is a section of colon separated
:code:`key=value` pairs. Every key must be a single character from the set
:code:`a-zA-Z` and every value must be a word consisting of characters from
the set :code:`a-zA-Z0-9-_/\+.,(){}[]*&^%$#@!`~`. The payload must be
interpreted based on the metadata section. The two semi-colons *must* always be
present even when no metadata is present.
Before going into details, lets see how one can display a simple, single line
notification from a shell script::
printf '\x1b]99;;Hello world\x1b\\'
To show a message with a title and a body::
printf '\x1b]99;i=1:d=0;Hello world\x1b\\'
printf '\x1b]99;i=1:d=1:p=body;This is cool\x1b\\'
The most important key in the metadata is the ``p`` key, it controls how the
payload is interpreted. A value of ``title`` means the payload is setting the
title for the notification. A value of ``body`` means it is setting the body,
and so on, see the table below for full details.
The design of the escape code is fundamentally chunked, this is because
different terminal emulators have different limits on how large a single escape
code can be. Chunking is accomplished by the ``i`` and ``d`` keys. The ``i``
key is the *notification id* which can be any string containing the characters
``[a-zA-Z0-9_-+.]``. The ``d`` key stands for *done* and can only take the
values ``0`` and ``1``. A value of ``0`` means the notification is not yet done
and the terminal emulator should hold off displaying it. A value of ``1`` means
the notification is done, and should be displayed. You can specify the title or
body multiple times and the terminal emulator will concatenate them, thereby
allowing arbitrarily long text (terminal emulators are free to impose a sensible
limit to avoid Denial-of-Service attacks).
Both the ``title`` and ``body`` payloads must be either UTF-8 encoded plain
text with no embedded escape codes, or UTF-8 text that is Base64 encoded, in
which case there must be an ``e=1`` key in the metadata to indicate the payload
is Base64 encoded.
When the user clicks the notification, a couple of things can happen, the
terminal emulator can focus the window from which the notification came, and/or
it can send back an escape code to the application indicating the notification
was activated. This is controlled by the ``a`` key which takes a comma separated
set of values, ``report`` and ``focus``. The value ``focus`` means focus the
window from which the notification was issued and is the default. ``report``
means send an escape code back to the application. The format of the returned
escape code is::
<OSC> 99 ; i=identifier ; <terminator>
The value of ``identifier`` comes from the ``i`` key in the escape code sent by
the application. If the application sends no identifier, then the terminal
*must* use ``i=0``. Actions can be preceded by a negative sign to turn them
off, so for example if you do not want any action, turn off the default
``focus`` action with::
a=-focus
Complete specification of all the metadata keys is in the table below. If a
terminal emulator encounters a key in the metadata it does not understand,
the key *must* be ignored, to allow for future extensibility of this escape
code. Similarly if values for known keys are unknown, the terminal emulator
*should* either ignore the entire escape code or perform a best guess effort
to display it based on what it does understand.
.. note::
It is possible to extend this escape code to allow specifying an icon for
the notification, however, given that some platforms, such as legacy versions
of macOS, don't allow displaying custom images on a notification, it was
decided to leave it out of the spec for the time being.
Similarly, features such as scheduled notifications could be added in future
revisions.
======= ==================== ========= =================
Key Value Default Description
======= ==================== ========= =================
``a`` Comma separated list ``focus`` What action to perform when the
of ``report``, notification is clicked
``focus``, with
optional leading
``-``
``d`` ``0`` or ``1`` ``1`` Indicates if the notification is
complete or not.
``e`` ``0`` or ``1`` ``0`` If set to ``1`` means the payload is Base64 encoded UTF-8,
otherwise it is plain UTF-8 text with no C0 control codes in it
``i`` ``[a-zA-Z0-9-_+.]`` ``0`` Identifier for the notification
``p`` One of ``title`` or ``title`` Whether the payload is the notification title or body. If a
``body``. notification has no title, the body will be used as title.
======= ==================== ========= =================
.. note::
|kitty| also supports the `legacy OSC 9 protocol developed by iTerm2
<https://iterm2.com/documentation-escape-codes.html>`__ for desktop
notifications.

54
docs/extract-rst-targets.py Executable file
View File

@@ -0,0 +1,54 @@
#!/usr/bin/env python
# License: GPLv3 Copyright: 2022, Kovid Goyal <kovid at kovidgoyal.net>
import os
import re
from typing import Dict, Iterator
tgt_pat = re.compile(r'^.. _(\S+?):$', re.MULTILINE)
title_pat = re.compile('^(.+)\n[-=^#*]{5,}$', re.MULTILINE)
def find_explicit_targets(text: str) -> Iterator[str]:
for m in tgt_pat.finditer(text):
yield m.group(1)
def find_page_title(text: str) -> str:
for m in title_pat.finditer(text):
return m.group(1)
return ''
def main() -> Dict[str, Dict[str, str]]:
refs = {}
docs = {}
base = os.path.dirname(os.path.abspath(__file__))
for dirpath, dirnames, filenames in os.walk(base):
if 'generated' in dirnames:
dirnames.remove('generated')
for f in filenames:
if f.endswith('.rst'):
with open(os.path.join(dirpath, f)) as stream:
raw = stream.read()
href = os.path.relpath(stream.name, base).replace(os.sep, '/')
href = href.rpartition('.')[0] + '/'
docs[href.rstrip('/')] = find_page_title(raw)
first_line = raw.lstrip('\n').partition('\n')[0]
first_target_added = False
for explicit_target in find_explicit_targets(raw):
# Shorten the reference link to the top of the page.
# Note that anchor links should still be used in HTML docs
# to allow jumping within the same page.
if not first_target_added:
first_target_added = True
if first_line.startswith(f'.. _{explicit_target}:'):
refs[explicit_target] = href
continue
refs[explicit_target] = href + f'#{explicit_target.replace("_", "-")}'
return {'ref': refs, 'doc': docs}
if __name__ == '__main__':
import json
print(json.dumps(main(), indent=2))

View File

@@ -3,39 +3,39 @@ Frequently Asked Questions
.. highlight:: sh
.. contents::
Some special symbols are rendered small/truncated in kitty?
-----------------------------------------------------------
The number of cells a unicode character takes up are controlled by the unicode
standard. All characters are rendered in a single cell unless the unicode
The number of cells a Unicode character takes up are controlled by the Unicode
standard. All characters are rendered in a single cell unless the Unicode
standard says they should be rendered in two cells. When a symbol does not fit,
it will either be rescaled to be smaller or truncated (depending on how much
extra space it needs). This is often different from other terminals which just
let the character overflow into neighboring cells, which is fine if the
neighboring cell is empty, but looks terrible if it is not.
Some programs, like powerline, vim with fancy gutter symbols/status-bar, etc.
misuse unicode characters from the private use area to represent symbols. Often
these symbols are square and should be rendered in two cells. However, since
private use area symbols all have their width set to one in the unicode
Some programs, like Powerline, vim with fancy gutter symbols/status-bar, etc.
use Unicode characters from the private use area to represent symbols. Often
these symbols are wide and should be rendered in two cells. However, since
private use area symbols all have their width set to one in the Unicode
standard, |kitty| renders them either smaller or truncated. The exception is if
these characters are followed by a space or empty cell in which case kitty
makes use of the extra cell to render them in two cells.
makes use of the extra cell to render them in two cells. This behavior can be
turned off for specific symbols using :opt:`narrow_symbols`.
Using a color theme with a background color does not work well in vim?
-----------------------------------------------------------------------
First make sure you have not changed the TERM environment variable, it should
be ``xterm-kitty``. vim uses *background color erase* even if the terminfo file
does not contain the ``bce`` capability. This is a bug in vim. You can work around
it by adding the following to your vimrc::
First make sure you have not changed the :envvar:`TERM` environment variable, it
should be ``xterm-kitty``. vim uses *background color erase* even if the
terminfo file does not contain the ``bce`` capability. This is a bug in vim. You
can work around it by adding the following to your vimrc::
let &t_ut=''
See :ref:`here <ext_styles>` for why |kitty| does not support background color erase.
See :doc:`here <deccara>` for why |kitty| does not support background color
erase.
I get errors about the terminal being unknown or opening the terminal failing when SSHing into a different computer?
@@ -47,31 +47,33 @@ terminfo files to the server::
kitty +kitten ssh myserver
This ssh kitten takes all the same command line arguments
as ssh, you can alias it to ssh in your shell's rc files to avoid having to
type it each time.
This :doc:`ssh kitten <kittens/ssh>` takes all the same command line arguments
as :program:`ssh`, you can alias it to something small in your shell's rc files
to avoid having to type it each time::
If for some reason that does not work (typically because the server is using a
non POSIX compliant shell), you can use the following one-liner instead (it
is slower as it needs to ssh into the server twice, but will work with most
servers)::
alias s="kitty +kitten ssh"
infocmp xterm-kitty | ssh myserver tic -x -o \~/.terminfo /dev/stdin
If the ssh kitten fails, use the following one-liner instead (it is slower as it
needs to ssh into the server twice, but will work with most servers)::
If you are behind a proxy (like Balabit) that prevents this, you must redirect the
1st command to a file, copy that to the server and run ``tic`` manually. If you
connect to a server, embedded or Android system that doesn't have ``tic``, copy over
your local file terminfo to the other system as :file:`~/.terminfo/x/xterm-kitty`.
infocmp -a xterm-kitty | ssh myserver tic -x -o \~/.terminfo /dev/stdin
If you are behind a proxy (like Balabit) that prevents this, or :program:`tic`
comes with macOS that does not support reading from STDIN, you must redirect the
first command to a file, copy that to the server and run :program:`tic`
manually. If you connect to a server, embedded or Android system that doesn't
have :program:`tic`, copy over your local file terminfo to the other system as
:file:`~/.terminfo/x/xterm-kitty`.
Really, the correct solution for this is to convince the OpenSSH maintainers to
have ssh do this automatically, if possible, when connecting to a server, so that
all terminals work transparently.
have :program:`ssh` do this automatically, if possible, when connecting to a
server, so that all terminals work transparently.
If the server is running FreeBSD, or another system that relies on termcap
rather than terminfo, you will need to convert the terminfo file on your local
machine by running (on local machine with |kitty|)::
infocmp -C xterm-kitty
infocmp -CrT0 xterm-kitty
The output of this command is the termcap description, which should be appended
to :file:`/usr/share/misc/termcap` on the remote server. Then run the following
@@ -83,22 +85,29 @@ command to apply your change (on the server)::
Keys such as arrow keys, backspace, delete, home/end, etc. do not work when using su or sudo?
-------------------------------------------------------------------------------------------------
Make sure the TERM environment variable, is ``xterm-kitty``. And either the
TERMINFO environment variable points to a directory containing :file:`x/xterm-kitty`
or that file is under :file:`~/.terminfo/x/`.
Make sure the :envvar:`TERM` environment variable, is ``xterm-kitty``. And
either the :envvar:`TERMINFO` environment variable points to a directory
containing :file:`x/xterm-kitty` or that file is under :file:`~/.terminfo/x/`.
Note that ``sudo`` might remove TERMINFO. Then setting it at the shell prompt can
be too late, because command line editing may not be reinitialized. In that case
you can either ask ``sudo`` to set it or if that is not supported, insert an ``env``
command before starting the shell, or, if not possible, after sudo start another
Shell providing the right terminfo path::
For macOS, you may also need to put that file under :file:`~/.terminfo/78/`::
mkdir -p ~/.terminfo/{78,x}
ln -snf ../x/xterm-kitty ~/.terminfo/78/xterm-kitty
tic -x -o ~/.terminfo "$KITTY_INSTALLATION_DIR/terminfo/kitty.terminfo"
Note that :program:`sudo` might remove :envvar:`TERMINFO`. Then setting it at
the shell prompt can be too late, because command line editing may not be
reinitialized. In that case you can either ask :program:`sudo` to set it or if
that is not supported, insert an :program:`env` command before starting the
shell, or, if not possible, after sudo start another shell providing the right
terminfo path::
sudo … TERMINFO=$HOME/.terminfo bash -i
sudo … env TERMINFO=$HOME/.terminfo bash -i
TERMINFO=/home/ORIGINALUSER/.terminfo exec bash -i
You can configure sudo to preserve TERMINFO by running ``sudo
visudo`` and adding the following line::
You can configure :program:`sudo` to preserve :envvar:`TERMINFO` by running
``sudo visudo`` and adding the following line::
Defaults env_keep += "TERM TERMINFO"
@@ -111,20 +120,27 @@ explicitly set a UTF-8 locale, like::
How do I change the colors in a running kitty instance?
------------------------------------------------------------
You can either use the
`OSC terminal escape codes <https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands>`_
to set colors or you can define keyboard shortcuts to set colors, for example::
The easiest way to do it is to use the :doc:`themes kitten </kittens/themes>`,
to choose a new color theme. Simply run::
kitty +kitten themes
And choose your theme from the list.
You can also define keyboard shortcuts to set colors, for example::
map f1 set_colors --configured /path/to/some/config/file/colors.conf
Or you can enable :doc:`remote control <remote-control>` for |kitty| and use :ref:`at_set-colors`.
The shortcut mapping technique has the same syntax as the remote control
command, for details, see :ref:`at_set-colors`.
Or you can enable :doc:`remote control <remote-control>` for |kitty| and use
:ref:`at-set-colors`. The shortcut mapping technique has the same syntax as the
remote control command, for details, see :ref:`at-set-colors`.
A list of pre-made color themes for kitty is available at:
`kitty-themes <https://github.com/dexpota/kitty-themes>`_
To change colors when SSHing into a remote host, use the :opt:`color_scheme
<kitten-ssh.color_scheme>` setting for the :doc:`ssh kitten <kittens/ssh>`.
Examples of using OSC escape codes to set colors::
Additionally, You can use the
`OSC terminal escape codes <https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands>`__
to set colors. Examples of using OSC escape codes to set colors::
Change the default foreground color:
printf '\x1b]10;#ff0000\x1b\\'
@@ -140,7 +156,7 @@ Examples of using OSC escape codes to set colors::
printf '\x1b]4;n;green\x1b\\'
You can use various syntaxes/names for color specifications in the above
examples. See `XParseColor <https://linux.die.net/man/3/xparsecolor>`_
examples. See `XParseColor <https://linux.die.net/man/3/xparsecolor>`__
for full details.
If a ``?`` is given rather than a color specification, kitty will respond
@@ -153,33 +169,63 @@ How do I specify command line options for kitty on macOS?
Apple does not want you to use command line options with GUI applications. To
workaround that limitation, |kitty| will read command line options from the file
:file:`<kitty config dir>/macos-launch-services-cmdline` when it is launched
from the GUI, i.e. by clicking the |kitty| application icon or using ``open -a kitty``.
Note that this file is *only read* when running via the GUI.
from the GUI, i.e. by clicking the |kitty| application icon or using
``open -a kitty``. Note that this file is *only read* when running via the GUI.
You can, of course, also run |kitty| from a terminal with command line options, using:
:file:`/Applications/kitty.app/Contents/MacOS/kitty`.
You can, of course, also run |kitty| from a terminal with command line options,
using: :file:`/Applications/kitty.app/Contents/MacOS/kitty`.
And within |kitty| itself, you can always run |kitty| using just `kitty` as it
cleverly adds itself to the ``PATH``.
And within |kitty| itself, you can always run |kitty| using just ``kitty`` as it
cleverly adds itself to the :envvar:`PATH`.
I catted a binary file and now kitty is hung?
-----------------------------------------------
**Never** output unknown binary data directly into a terminal.
Terminals have a single channel for both data and control. Certain bytes
are control codes. Some of these control codes are of arbitrary length, so if
the binary data you output into the terminal happens to contain the starting
sequence for one of these control codes, the terminal will hang waiting for the
closing sequence. Press :sc:`reset_terminal` to reset the terminal.
If you do want to cat unknown data, use ``cat -v``.
kitty is not able to use my favorite font?
---------------------------------------------
|kitty| achieves its stellar performance by caching alpha masks of each rendered
character on the GPU, so that every character needs to be rendered only once.
This means it is a strictly character cell based display. As such it can use
only monospace fonts, since every cell in the grid has to be the same size.
Furthermore, it needs fonts to be freely resizable, so it does not support
bitmapped fonts.
character on the GPU, and rendering them all in parallel. This means it is a
strictly character cell based display. As such it can use only monospace fonts,
since every cell in the grid has to be the same size. Furthermore, it needs
fonts to be freely resizable, so it does not support bitmapped fonts.
If your font is not listed in ``kitty list-fonts`` it means that it is not
monospace or is a bitmapped font. On Linux you can list all monospace fonts with::
.. note::
If you are trying to use a font patched with `Nerd Fonts
<https://nerdfonts.com/>`__ symbols, don't do that as patching destroys
fonts. There is no need, simply install the standalone ``Symbols Nerd Font Mono``
(the file :file:`NerdFontsSymbolsOnly.zip` from the `Nerd Fonts releases page
<https://github.com/ryanoasis/nerd-fonts/releases>`__). kitty should pick up
symbols from it automatically, and you can tell it to do so explicitly in
case it doesn't with the :opt:`symbol_map` directive::
# Nerd Fonts v2.2.2
symbol_map U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0-U+E0C8,U+E0CA,U+E0CC-U+E0D2,U+E0D4,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E634,U+E700-U+E7C5,U+EA60-U+EBEB,U+F000-U+F2E0,U+F300-U+F32F,U+F400-U+F4A9,U+F500-U+F8FF Symbols Nerd Font Mono
Those Unicode symbols beyond the ``E000-F8FF`` Unicode private use area are
not included.
If your font is not listed in ``kitty +list-fonts`` it means that it is not
monospace or is a bitmapped font. On Linux you can list all monospace fonts
with::
fc-list : family spacing outline scalable | grep -e spacing=100 -e spacing=90 | grep -e outline=True | grep -e scalable=True
Note that the spacing property is calculated by fontconfig based on actual
glyph widths in the font. If for some reason fontconfig concludes your favorite
Note that the spacing property is calculated by fontconfig based on actual glyph
widths in the font. If for some reason fontconfig concludes your favorite
monospace font does not have ``spacing=100`` you can override it by using the
following :file:`~/.config/fontconfig/fonts.conf`::
@@ -201,7 +247,7 @@ command to rebuild your fontconfig cache::
fc-cache -r
Then, the font will be available in ``kitty list-fonts``.
Then, the font will be available in ``kitty +list-fonts``.
How can I assign a single global shortcut to bring up the kitty terminal?
@@ -210,7 +256,69 @@ How can I assign a single global shortcut to bring up the kitty terminal?
Bringing up applications on a single key press is the job of the window
manager/desktop environment. For ways to do it with kitty (or indeed any
terminal) in different environments,
see `here <https://github.com/kovidgoyal/kitty/issues/45>`_.
see :iss:`here <45>`.
I do not like the kitty icon!
-------------------------------
There are many alternate icons available, click on an icon to visit its
homepage:
.. image:: https://github.com/k0nserv/kitty-icon/raw/main/icon_512x512.png
:target: https://github.com/k0nserv/kitty-icon
:width: 256
.. image:: https://github.com/DinkDonk/kitty-icon/raw/main/kitty-dark.png
:target: https://github.com/DinkDonk/kitty-icon
:width: 256
.. image:: https://github.com/DinkDonk/kitty-icon/raw/main/kitty-light.png
:target: https://github.com/DinkDonk/kitty-icon
:width: 256
.. image:: https://github.com/hristost/kitty-alternative-icon/raw/main/kitty_icon.png
:target: https://github.com/hristost/kitty-alternative-icon
:width: 256
.. image:: https://github.com/igrmk/whiskers/raw/main/whiskers.svg
:target: https://github.com/igrmk/whiskers
:width: 256
.. image:: https://github.com/samholmes/whiskers/raw/main/whiskers.png
:target: https://github.com/samholmes/whiskers
:width: 256
On macOS you can put :file:`kitty.app.icns` or :file:`kitty.app.png` in the
:ref:`kitty configuration directory <confloc>`, and this icon will be applied
automatically at startup. Unfortunately, Apple's Dock does not change its
cached icon so the custom icon will revert when kitty is quit. Run the
following to force the Dock to update its cached icons:
.. code-block:: sh
rm /var/folders/*/*/*/com.apple.dock.iconcache; killall Dock
If you prefer not to keep a custom icon in the kitty config folder, you can
also set it with the following command:
.. code-block:: sh
# Set kitty.icns as the icon for currently running kitty
kitty +runpy 'from kitty.fast_data_types import cocoa_set_app_icon; import sys; cocoa_set_app_icon(*sys.argv[1:]); print("OK")' kitty.icns
# Set the icon for app bundle specified by the path
kitty +runpy 'from kitty.fast_data_types import cocoa_set_app_icon; import sys; cocoa_set_app_icon(*sys.argv[1:]); print("OK")' /path/to/icon.png /Applications/kitty.app
You can also change the icon manually by following the steps:
#. Find :file:`kitty.app` in the Applications folder, select it and press :kbd:`⌘+I`
#. Drag :file:`kitty.icns` onto the application icon in the kitty info pane
#. Delete the icon cache and restart Dock:
.. code-block:: sh
rm /var/folders/*/*/*/com.apple.dock.iconcache; killall Dock
How do I map key presses in kitty to different keys in the terminal program?
@@ -219,26 +327,21 @@ How do I map key presses in kitty to different keys in the terminal program?
This is accomplished by using ``map`` with :sc:`send_text <send_text>` in :file:`kitty.conf`.
For example::
map alt+s send_text all \x13
map alt+s send_text normal,application \x13
This maps :kbd:`alt+s` to :kbd:`ctrl+s`. To figure out what bytes to use for
the :sc:`send_text <send_text>` you can use the ``showkey`` utility. Run::
the :sc:`send_text <send_text>` you can use the ``show_key`` kitten. Run::
showkey -a
kitty +kitten show_key
Then press the key you want to emulate. On macOS, this utility is currently not
available. The manual way to figure it out is:
Then press the key you want to emulate. Note that this kitten will only show
keys that actually reach the terminal program, in particular, keys mapped to
actions in kitty will not be shown. To check those first map them to
:ac:`no_op`. You can also start a kitty instance without any shortcuts to
interfere::
1. Look up your key's decimal value in the table at the bottom of `this
page <http://ascii-table.com/ansi-escape-sequences.php>`_ or any
ANSI escape sequence table. There are different modifiers for :kbd:`ctrl`,
:kbd:`alt`, etc. For e.g., for :kbd:`ctrl+s`, find the ``S`` row and look at
the third column value, ``19``.
kitty -o clear_all_shortcuts=yes kitty +kitten show_key
2. Convert the decimal value to hex with ``kitty +runpy "print(hex(19))"``.
This shows the hex value, ``13`` in this case.
3. Use ``\x(hexval)`` in your ``send_text`` command in kitty. So in this example, ``\x13``
How do I open a new window or tab with the same working directory as the current window?
--------------------------------------------------------------------------------------------
@@ -246,35 +349,125 @@ How do I open a new window or tab with the same working directory as the current
In :file:`kitty.conf` add the following::
map f1 launch --cwd=current
map f2 launch --cwd=current --type=tab
map f2 launch --cwd=current --type=tab
Pressing :kbd:`F1` will open a new kitty window with the same working directory
as the current window. The :doc:`launch command <launch>` is very powerful,
explore :doc:`its documentation <launch>`.
Things behave differently when running kitty from system launcher vs. from another terminal?
-----------------------------------------------------------------------------------------------
This will be because of environment variables. When you run kitty from the
system launcher, it gets a default set of system environment variables. When
you run kitty from another terminal, you are actually running it from a shell,
and the shell's rc files will have setup a whole different set of environment
variables which kitty will now inherit.
You need to make sure that the environment variables you define in your shell's
rc files are either also defined system wide or via the :opt:`env` directive in
:file:`kitty.conf`. Common environment variables that cause issues are those
related to localization, such as :envvar:`LANG`, ``LC_*`` and loading of
configuration files such as ``XDG_*``, :envvar:`KITTY_CONFIG_DIRECTORY`.
To see the environment variables that kitty sees, you can add the following
mapping to :file:`kitty.conf`::
map f1 show_kitty_env_vars
then pressing :kbd:`F1` will show you the environment variables kitty sees.
This problem is most common on macOS, as Apple makes it exceedingly difficult to
setup environment variables system-wide, so people end up putting them in all
sorts of places where they may or may not work.
I am using tmux and have a problem
--------------------------------------
First, terminal multiplexers are `a bad idea
<https://github.com/kovidgoyal/kitty/issues/391#issuecomment-638320745>`_, do
not use them, if at all possible. kitty contains features that do all of what
First, terminal multiplexers are :iss:`a bad idea <391#issuecomment-638320745>`,
do not use them, if at all possible. kitty contains features that do all of what
tmux does, but better, with the exception of remote persistence (:iss:`391`).
If you still want to use tmux, read on.
Image display will not work, see `tmux issue
<https://github.com/tmux/tmux/issues/1391>`_.
<https://github.com/tmux/tmux/issues/1391>`__.
If you are using tmux with multiple terminals or you start it under one
terminal and then switch to another and these terminals have different TERM
variables, tmux will break. You will need to restart it as tmux does not
support multiple terminfo definitions.
Using ancient versions of tmux such as 1.8 will cause gibberish on screen when
pressing keys (:iss:`3541`).
Copying to clipboard via OSC 52 will not work, because tmux does not support
the extended version of that protocol, you will need to add ``no-append`` to
:opt:`clipboard_control` in kitty.conf.
If you are using tmux with multiple terminals or you start it under one terminal
and then switch to another and these terminals have different :envvar:`TERM`
variables, tmux will break. You will need to restart it as tmux does not support
multiple terminfo definitions.
If you use any of the advanced features that kitty has innovated, such as
styled underlines, desktop notifications, extended keyboard support, etc.
they may or may not work, depending on the whims of tmux's maintainer, your
version of tmux, etc.
:doc:`styled underlines </underlines>`, :doc:`desktop notifications
</desktop-notifications>`, :doc:`extended keyboard support
</keyboard-protocol>`, etc. they may or may not work, depending on the whims of
tmux's maintainer, your version of tmux, etc.
I opened and closed a lot of windows/tabs and top shows kitty's memory usage is very high?
-------------------------------------------------------------------------------------------
:program:`top` is not a good way to measure process memory usage. That is
because on modern systems, when allocating memory to a process, the C library
functions will typically allocate memory in large blocks, and give the process
chunks of these blocks. When the process frees a chunk, the C library will not
necessarily release the underlying block back to the OS. So even though the
application has released the memory, :program:`top` will still claim the process
is using it.
To check for memory leaks, instead use a tool like `Valgrind
<https://valgrind.org/>`__. Run::
PYTHONMALLOC=malloc valgrind --tool=massif kitty
Now open lots of tabs/windows, generate lots of output using tools like find/yes
etc. Then close all but one window. Do some random work for a few seconds in
that window, maybe run yes or find again. Then quit kitty and run::
massif-visualizer massif.out.*
You will see the allocations graph goes up when you opened the windows, then
goes back down when you closed them, indicating there were no memory leaks.
For those interested, you can get a similar profile out of :program:`valgrind`
as you get with :program:`top` by adding ``--pages-as-heap=yes`` then you will
see that memory allocated in malloc is not freed in free. This can be further
refined if you use ``glibc`` as your C library by setting the environment
variable ``MALLOC_MMAP_THRESHOLD_=64``. This will cause free to actually free
memory allocated in sizes of more than 64 bytes. With this set, memory usage
will climb high, then fall when closing windows, but not fall all the way back.
The remaining used memory can be investigated using valgrind again, and it will
come from arenas in the GPU drivers and the per thread arenas glibc's malloc
maintains. These too allocate memory in large blocks and don't release it back
to the OS immediately.
Why does kitty sometimes start slowly on my Linux system?
-------------------------------------------------------------------------------------------
|kitty| takes no longer (within 100ms) to start than other similar GPU terminal
emulators, (and may be faster than some). If |kitty| occasionally takes a long
time to start, it could be a power management issue with the graphics card. On
a multi-GPU system (which many modern laptops are, having a power efficient GPU
that's built into the processor and a power hungry dedicated one that's usually
off), even if the answer of the GPU will only be "don't use me".
For example, if you have a system with an AMD CPU and an NVIDIA GPU, and you
know that you want to use the lower powered card to save battery life and
because kitty does not require a powerful GPU to function, you can choose not
to wake up the dedicated card, which has been reported on at least one system
(:iss:`4292`) to take ≈2 seconds, by running |kitty| as::
MESA_LOADER_DRIVER_OVERRIDE=radeonsi __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json kitty
The correct command will depend on your situation and hardware.
``__EGL_VENDOR_LIBRARY_FILENAMES`` instructs the GL dispatch library to use
:file:`libEGL_mesa.so` and ignore :file:`libEGL_nvidia.so` also available on the
system, which will wake the NVIDIA card during device enumeration.
``MESA_LOADER_DRIVER_OVERRIDE`` also assures that Mesa won't offer any NVIDIA
card during enumeration, and will instead just use :file:`radeonsi_dri.so`.

View File

@@ -0,0 +1,535 @@
File transfer over the TTY
===============================
There are sometimes situations where the TTY is the only convenient pipe
between two connected systems, for example, nested SSH sessions, a serial
line, etc. In such scenarios, it is useful to be able to transfer files
over the TTY.
This protocol provides the ability to transfer regular files, directories and
links (both symbolic and hard) preserving most of their metadata. It can
optionally use compression and transmit only binary diffs to speed up
transfers. However, since all data is base64 encoded for transmission over the
TTY, this protocol will never be competitive with more direct file transfer
mechanisms.
Overall design
----------------
The basic design of this protocol is around transfer "sessions". Since
untrusted software should not be able to read/write to another machines
filesystem, a session must be approved by the user in the terminal emulator
before any actual data is transmitted, unless a :ref:`pre-shared password is
provided <bypass_auth>`.
There can be either send or receive sessions. In send sessions files are sent
from remote client to the terminal emulator and vice versa for receive sessions.
Every session basically consists of sending metadata for the files first and
then sending the actual data. The session is a series of commands, every command
carrying the session id (which should be a random unique-ish identifier, to
avoid conflicts). The session is bi-directional with commands going both to and
from the terminal emulator. Every command in a session also carries an
``action`` field that specifies what the command does. The remaining fields in
the command are dependent on the nature of the command.
Let's look at some simple examples of sessions to get a feel for the protocol.
Sending files to the computer running the terminal emulator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The client starts by sending a start send command::
→ action=send id=someid
It then waits for a status message from the terminal either
allowing the transfer or refusing it. Until this message is received
the client is not allowed to send any more commands for the session.
The terminal emulator should drop a session if it receives any commands
before sending an ``OK`` response. If the user accepts the transfer,
the terminal will send::
← action=status id=someid status=OK
Or if the transfer is refused::
← action=status id=someid status=EPERM:User refused the transfer
The client then sends one or more ``file`` commands with the metadata of the file it wants
to transfer::
→ action=file id=someid file_id=f1 name=/path/to/destination
→ action=file id=someid file_id=f2 name=/path/to/destination2 ftype=directory
The terminal responds with either ``OK`` for directories or ``STARTED`` for
files::
← action=status id=someid file_id=f1 status=STARTED
← action=status id=someid file_id=f2 status=OK
If there was an error with the file, for example, if the terminal does not have
permission to write to the specified location, it will instead respond with an
error, such as::
← action=status id=someid file_id=f1 status=EPERM:No permission
The client sends data for files using ``data`` commands. It does not need to
wait for the ``STARTED`` from the terminal for this, the terminal must discard data
for files that are not ``STARTED``. Data for a file is sent in individual
chunks of no larger than ``4096`` bytes. For example::
→ action=data id=someid file_id=f1 data=chunk of bytes
→ action=data id=someid file_id=f1 data=chunk of bytes
...
→ action=end_data id=someid file_id=f1 data=chunk of bytes
The sequence of data transmission for a file is ended with an ``end_data``
command. After each data packet is received the terminal replies with
an acknowledgement of the form::
← action=status id=someid file_id=f1 status=PROGRESS size=bytes written
After ``end_data`` the terminal replies with::
← action=status id=someid file_id=f1 status=OK size=bytes written
If an error occurs while writing the data, the terminal replies with an error
code and ignores further commands about that file, for example::
← action=status id=someid file_id=f1 status=EIO:Failed to write to file
Once the client has finished sending as many files as it wants to, it ends
the session with::
→ action=finish id=someid
At this point the terminal commits the session, applying file metadata,
creating links, etc. If any errors occur it responds with an error message,
such as::
← action=status id=someid status=Some error occurred
Receiving files from the computer running terminal emulator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The client starts by sending a start receive command::
→ action=receive id=someid size=num_of_paths
It then sends a list of ``num_of_paths`` paths it is interested in
receiving::
→ action=file id=someid file_id=f1 name=/some/path
→ action=file id=someid file_id=f2 name=/some/path2
...
The client must then wait for responses from the terminal emulator. It
is an error to send anymore commands to to the terminal until an ``OK``
response is received from the terminal. The terminal wait for the user to accept
the request. If accepted, it sends::
← action=status id=someid status=OK
If permission is denied it sends::
← action=status id=someid status=EPERM:User refused the transfer
The terminal then sends the metadata for all requested files. If any of them
are directories, it traverses the directories recursively, listing all files.
Note that symlinks must not be followed, but sent as symlinks::
← action=file id=someid file_id=f1 mtime=XXX permissions=XXX name=/absolute/path status=file_id1 size=size_in_bytes file_type=type parent=file_id of parent
← action=file id=someid file_id=f1 mtime=XXX permissions=XXX name=/absolute/path2 status=file_id2 size=size_in_bytes file_type=type parent=file_id of parent
...
Here the ``file_id`` field is set to the ``file_id`` value sent from the client
and the ``status`` field is set to the actual file id for each file. This is
because a file query sent from the client can result in multiple actual files if
it is a directory. The ``parent`` field is the actual ``file_id`` of the directory
containing this file and is set for entries that are generated from client
requests that match directories. This allows the client to build an unambiguous picture
of the file tree.
Once all the files are listed, the terminal sends an ``OK`` response that also
specifies the absolute path to the home directory for the user account running
the terminal::
← action=status id=someid status=OK name=/path/to/home
If an error occurs while listing any of the files asked for by the client,
the terminal will send an error response like::
← action=status id=someid file_id=f1 status=ENOENT: Does not exist
Here, ``file_id`` is the same as was sent by the client in its initial query.
Now, the client can send requests for file data using the paths sent by the
terminal emulator::
→ action=file id=someid file_id=f1 name=/some/path
...
The terminal emulator replies with the data for the files, as a sequence of
``data`` commands each with a chunk of data no larger than ``4096`` bytes,
for each file (the terminal emulator should send the data for
one file at a time)::
← action=data id=someid file_id=f1 data=chunk of bytes
...
← action=end_data id=someid file_id=f1 data=chunk of bytes
If any errors occur reading file data, the terminal emulator sends an error
message for the file, for example::
← action=status id=someid file_id=f1 status=EIO:Could not read
Once the client is done reading data for all the files it expects, it
terminates the session with::
→ action=finished id=someid
Canceling a session
----------------------
A client can decide to cancel a session at any time (for example if the user
presses :kbd:`ctrl+c`). To cancel a session it sends a ``cancel`` action to the
terminal emulator::
→ action=cancel id=someid
The terminal emulator drops the session and sends a cancel acknowledgement::
← action=status id=someid status=CANCELED
The client **must** wait for the canceled response from the emulator discarding
any other responses till the cancel is received. If it does not wait, after
it quits the responses might end up being printed to screen.
Quieting responses from the terminal
-------------------------------------
The above protocol includes lots of messages from the terminal acknowledging
receipt of data, granting permission etc., acknowledging cancel requests, etc.
For extremely simple clients like shell scripts, it might be useful to suppress
these responses, which can be done by adding the ``quiet`` key to the start
session command::
→ action=send id=someid quiet=1
The key can take the values ``1`` - meaning suppress acknowledgement responses
or ``2`` - meaning suppress all responses including errors. Only actual data
responses are sent. Note that in particular this means acknowledgement of
permission for the transfer to go ahead is suppressed, so this is typically
useful only with :ref:`bypass_auth`.
.. _file_metadata:
File metadata
-----------------
File metadata includes file paths, permissions and modification times. They are
somewhat tricky as different operating systems support different kinds of
metadata. This specification defines a common minimum set which should work
across most operating systems.
File paths
File paths must be valid UTF-8 encoded POSIX paths (i.e. using the forward slash
``/`` as a separator). Linux systems allow non UTF-8 file paths, these
are not supported. A leading ``~/`` means a path is relative to the
``HOME`` directory. All path must be either absolute (i.e. with a leading
``/``) or relative to the HOME directory. Individual components of the
path must be no longer than 255 UTF-8 bytes. Total path length must be no
more than 4096 bytes. Paths from Windows systems must use the forward slash
as the separator, the first path component must be the drive letter with a
colon. For example: :file:`C:\some\file.txt` is represented as
:file:`/C:/some/file.txt`. For maximum portability, the following
characters *should* be omitted from paths (however implementations are free
to try to support them returning errors for non-representable paths)::
\ * : < > ? | /
File modification times
Must be represented as the number of nanoseconds since the UNIX epoch. An
individual file system may not store file metadata with this level of
accuracy in which case it should use the closest possible approximation.
File permissions
Represented as a number with the usual UNIX read, write and execute bits.
In addition, the sticky, set-group-id and set-user-id bits may be present.
Implementations should make a best effort to preserve as many bits as
possible. On Windows, there is only a read-only bit. When reading file
metadata all the ``WRITE`` bits should be set if the read only bit is clear
and cleared if it is set. When writing files, the read-only bit should be
set if the bit indicating write permission for the user is clear. The other
UNIX bits must be ignored when writing. When reading, all the ``READ`` bits
should always be set and all the ``EXECUTE`` bits should be set if the file is
directly executable by the Windows Operating system. There is no attempt to
map Window's ACLs to permission bits.
Symbolic and hard links
---------------------------
Symbolic and hard links can be preserved by this protocol.
.. note::
In the following when target paths of symlinks are sent as actual paths, they must be
encoded in the same way as discussed in :ref:`file_metadata`. It is up to
the receiving side to translate them into appropriate paths for the local
operating system. This may not always be possible, in which case either the
symlink should not be created or a broken symlink should be created.
Sending links to the terminal emulator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
When sending files to the terminal emulator, the file command has the form::
→ action=file id=someid file_id=f1 name=/path/to/link file_type=link
→ action=file id=someid file_id=f2 name=/path/to/symlink file_type=symlink
Then, when the client is sending data for the files, for hardlinks, the data
will be the ``file_id`` of the target file (assuming the target file is also
being transmitted, otherwise the hard link should be transmitted as a plain
file)::
→ action=end_data id=someid file_id=f1 data=target_file_id_encoded_as_utf8
For symbolic links, the data is a little more complex. If the symbolic link is
to a destination being transmitted, the data has the form::
→ action=end_data id=someid file_id=f1 data=fid:target_file_id_encoded_as_utf8
→ action=end_data id=someid file_id=f1 data=fid_abs:target_file_id_encoded_as_utf8
The ``fid_abs`` form is used if the symlink uses an absolute path, ``fid`` if
it uses a relative path. If the symlink is to a destination that is not being
transmitted, then the prefix ``path:`` and the actual path in the symlink is
transmitted.
Receiving links from the terminal emulator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
When receiving files from the terminal emulator, link data is transmitted in
two parts. First when the emulator sends the initial file listing to the
client, the ``file_type`` is set to the link type and the ``data`` field is set
to file_id of the target file if the target file is included in the listing.
For example::
← action=file id=someid file_id=f1 status=file_id1 ...
← action=file id=someid file_id=f1 status=file_id2 file_type=symlink data=file_id1 ...
Here the rest of the metadata has been left out for clarity. Notice that the
second file is symlink whose ``data`` field is set to the file id of the first
file (the value of the ``status`` field of the first file). The same technique
is used for hard links.
The client should not request data for hard links, instead creating them
directly after transmission is complete. For symbolic links the terminal
must send the actual symbolic link target as a UTF-8 encoded path in the
data field. The client can use this path either as-is (when the target is not
a transmitted file) or to decide whether to create the symlink with a relative
or absolute path when the target is a transmitted file.
Transmitting binary deltas
-----------------------------
Repeated transfer of large files that have only changed a little between
the receiving and sending side can be sped up significantly by transmitting
binary deltas of only the changed portions. This protocol has built-in support
for doing that. This support uses the `rsync algorithm
<https://github.com/librsync/librsync>`__. In this algorithm first the
receiving side sends a file signature that contains hashes of blocks
in the file. Then the sending side sends only those blocks that have changed.
The receiving side applies these deltas to the file to update it till it matches
the file on the sending side.
The modification to the basic protocol consists of setting the
``transmission_type`` key to ``rsync`` when requesting a file. This triggers
transmission of signatures and deltas instead of file data. The details are
different for sending and receiving.
Sending to the terminal emulator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
When sending the metadata of the file it wants to transfer, the client adds the
``transmission_type`` key::
→ action=file id=someid file_id=f1 name=/path/to/destination transmission_type=rsync
The ``STARTED`` response from the terminal will have ``transmission_type`` set
to ``rsync`` if the file exists and the terminal is able to send signature data::
← action=status id=someid file_id=f1 status=STARTED transmission_type=rsync
The terminal then transmits the signature using ``data`` commands::
← action=data id=someid file_id=f1 data=...
...
← action=end_data id=someid file_id=f1 data=...
Once the client receives and processes the full signature, it transmits the
file delta to the terminal as ``data`` commands::
→ action=data id=someid file_id=f1 data=...
→ action=data id=someid file_id=f1 data=...
...
→ action=end_data id=someid file_id=f1 data=...
The terminal then uses this delta to update the file.
Receiving from the terminal emulator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
When the client requests file data from the terminal emulator, it can
add the ``transmission_type=rsync`` key to indicate it will be sending
a signature for that file::
→ action=file id=someid file_id=f1 name=/some/path transmission_type=rsync
The client then sends the signature using ``data`` commands::
→ action=data id=someid file_id=f1 data=...
...
→ action=end_data id=someid file_id=f1 data=...
After receiving the signature the terminal replies with the delta as a series
of ``data`` commands::
← action=data id=someid file_id=f1 data=...
...
← action=end_data id=someid file_id=f1 data=...
The client then uses this delta to update the file.
The format of signatures and deltas
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
These come from `librsync <https://github.com/librsync/librsync>`__. If this
specification gains wider adoption, these formats should be documented here.
Compression
--------------
Individual files can be transmitted compressed if needed.
Currently, only :rfc:`1950` ZLIB based deflate compression is
supported, which is specified using the ``compression=zlib`` key when
requesting a file. For example when sending files to the terminal emulator,
when sending the file metadata the ``compression`` key can also be
specified::
→ action=file id=someid file_id=f1 name=/path/to/destination compression=zlib
Similarly when receiving files from the terminal emulator, the final file
command that the client sends to the terminal requesting the start of the
transfer of data for the file can include the ``compression`` key::
→ action=file id=someid file_id=f1 name=/some/path compression=zlib
.. _bypass_auth:
Bypassing explicit user authorization
------------------------------------------
In order to bypass the requirement of interactive user authentication,
this protocol has the ability to use a pre-shared secret (password).
When initiating a transfer session the client sends a hash of the password and
the session id::
→ action=send id=someid bypass=sha256:hash_value
For example, suppose that the session id is ``mysession`` and the
shared secret is ``mypassword``. Then the value of the ``bypass``
key above is ``sha256:SHA256("mysession" + ";" + "mypassword")``, which
is::
→ action=send id=mysession bypass=sha256:192bd215915eeaa8c2b2a4c0f8f851826497d12b30036d8b5b1b4fc4411caf2c
The value of ``bypass`` is of the form ``hash_function_name : hash_value``
(without spaces). Currently, only the SHA256 hash function is supported.
.. warning::
Hashing does not effectively hide the value of the password. So this
functionality should only be used in secure/trusted contexts. While there
exist hash functions harder to compute than SHA256, they are unsuitable as
they will introduce a lot of latency to starting a session and in any case
there is no mathematical proof that **any** hash function is not brute-forceable.
Encoding of transfer commands as escape codes
------------------------------------------------
Transfer commands are encoded as ``OSC`` escape codes of the form::
<OSC> 5113 ; key=value ; key=value ... <ST>
Here ``OSC`` is the bytes ``0x1b 0x5d`` and ``ST`` is the bytes
``0x1b 0x5c``. Keys are words containing only the characters ``[a-zA-Z0-9_]``
and ``value`` is arbitrary data, whose encoding is dependent on the value of
``key``. Unknown keys **must** be ignored when decoding a command.
The number ``5113`` is a constant and is unused by any known OSC codes. It is
the numeralization of the word ``file``.
.. table:: The keys and value types for this protocol
:align: left
================= ======== ============== =======================================================================
Key Key name Value type Notes
================= ======== ============== =======================================================================
action ac enum send, file, data, end_data, receive, cancel, status, finish
compression zip enum none, zlib
file_type ft enum regular, directory, symlink, link
transmission_type tt enum simple, rsync
id id safe_string A unique-ish value, to avoid collisions
file_id fid safe_string Must be unique per file in a session
bypass pw safe_string hash of the bypass password and the session id
quiet q integer 0 - verbose, 1 - only errors, 2 - totally silent
mtime mod integer the modification time of file in nanoseconds since the UNIX epoch
permissions prm integer the UNIX file permissions bits
size sz integer size in bytes
name n base64_string The path to a file
status st base64_string Status messages
parent pr safe_string The file id of the parent directory
data d base64_bytes Binary data
================= ======== ============== =======================================================================
The ``Key name`` is the actual serialized name of the key sent in the escape
code. So for example, ``permissions=123`` is serialized as ``prm=123``. This
is done to reduce overhead.
The value types are:
enum
One from a permitted set of values, for example::
ac=file
safe_string
A string consisting only of characters from the set ``[0-9a-zA-Z_:.,/!@#$%^&*()[]{}~`?"'\\|=+-]``
Note that the semi-colon is missing from this set.
integer
A base-10 number composed of the characters ``[0-9]`` with a possible
leading ``-`` sign
base64_string
A base64 encoded UTF-8 string using the standard base64 encoding
base64_bytes
Binary data encoded using the standard base64 encoding
An example of serializing an escape code is shown below::
action=send id=test name=somefile size=3 data=01 02 03
becomes::
<OSC> 5113 ; ac=send ; id=test ; n=c29tZWZpbGU= ; sz=3 ; d=AQID <ST>
Here ``c29tZWZpbGU`` is the base64 encoded form of somefile and ``AQID`` is the
base64 encoded form of the bytes ``0x01 0x02 0x03``. The spaces in the encoded
form are present for clarity and should be ignored.

214
docs/glossary.rst Normal file
View File

@@ -0,0 +1,214 @@
:orphan:
Glossary
=========
.. glossary::
os_window
kitty has two kinds of windows. Operating System windows, refered to as :term:`OS
Window <os_window>`, and *kitty windows*. An OS Window consists of one or more kitty
:term:`tabs <tab>`. Each tab in turn consists of one or more *kitty
windows* organized in a :term:`layout`.
tab
A *tab* refers to a group of :term:`kitty windows <window>`, organized in
a :term:`layout`. Every :term:`OS Window <os_window>` contains one or more tabs.
layout
A *layout* is a system of organizing :term:`kitty windows <window>` in
groups inside a tab. The layout automatically maintains the size and
position of the windows, think of a layout as a tiling window manager for
the terminal. See :doc:`layouts` for details.
window
kitty has two kinds of windows. Operating System windows, refered to as :term:`OS
Window <os_window>`, and *kitty windows*. An OS Window consists of one or more kitty
:term:`tabs <tab>`. Each tab in turn consists of one or more *kitty
windows* organized in a :term:`layout`.
overlay
An *overlay window* is a :term:`kitty window <window>` that is placed on
top of an existing kitty window, entirely covering it. Overlays are used
throughout kitty, for example, to display the :ref:`the scrollback buffer <scrollback>`,
to display :doc:`hints </kittens/hints>`, for :doc:`unicode input
</kittens/unicode_input>` etc. Normal overlays are meant for short
duration popups and so are not considered the :italic:`active window`
when determining the current working directory or getting input text for
kittens, launch commands, etc. To create an overlay considered as a
:italic:`main window` use the :code:`overlay-main` argument to
:doc:`launch`.
hyperlinks
Terminals can have hyperlinks, just like the internet. In kitty you can
:doc:`control exactly what happens <open_actions>` when clicking on a
hyperlink, based on the type of link and its URL. See also `Hyperlinks in terminal
emulators <https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda>`__.
.. _env_vars:
Environment variables
------------------------
Variables that influence kitty behavior
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. envvar:: KITTY_CONFIG_DIRECTORY
Controls where kitty looks for :file:`kitty.conf` and other configuration
files. Defaults to :file:`~/.config/kitty`. For full details of the config
directory lookup mechanism see, :option:`kitty --config`.
.. envvar:: KITTY_CACHE_DIRECTORY
Controls where kitty stores cache files. Defaults to :file:`~/.cache/kitty`
or :file:`~/Library/Caches/kitty` on macOS.
.. envvar:: KITTY_RUNTIME_DIRECTORY
Controls where kitty stores runtime files like sockets. Defaults to
the :code:`XDG_RUNTIME_DIR` environment variable if that is defined
otherwise the run directory inside the kitty cache directory is used.
.. envvar:: VISUAL
The terminal based text editor (such as :program:`vi` or :program:`nano`)
kitty uses, when, for instance, opening :file:`kitty.conf` in response to
:sc:`edit_config_file`.
.. envvar:: EDITOR
Same as :envvar:`VISUAL`. Used if :envvar:`VISUAL` is not set.
.. envvar:: GLFW_IM_MODULE
Set this to ``ibus`` to enable support for IME under X11.
.. envvar:: KITTY_WAYLAND_DETECT_MODIFIERS
When set to a non-empty value, kitty attempts to autodiscover XKB modifiers
under Wayland. This is useful if using non-standard modifers like hyper. It
is possible for the autodiscovery to fail; the default Wayland XKB mappings
are used in this case. See :pull:`3943` for details.
.. envvar:: SSH_ASKPASS
Specify the program for SSH to ask for passwords. When this is set, :doc:`ssh
kitten </kittens/ssh>` will use this environment variable by default. See
:opt:`askpass <kitten-ssh.askpass>` for details.
.. envvar:: KITTY_CLONE_SOURCE_CODE
Set this to some shell code that will be executed in the cloned window with
:code:`eval` when :ref:`clone-in-kitty <clone_shell>` is used.
.. envvar:: KITTY_CLONE_SOURCE_PATH
Set this to the path of a file that will be sourced in the cloned window when
:ref:`clone-in-kitty <clone_shell>` is used.
.. envvar:: KITTY_DEVELOP_FROM
Set this to the directory path of the kitty source code and its Python code
will be loaded from there. Only works with official binary builds.
.. envvar:: KITTY_RC_PASSWORD
Set this to a pass phrase to use the ``kitty @`` remote control command with
:opt:`remote_control_password`.
Variables that kitty sets when running child programs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. envvar:: LANG
This is only set on macOS. If the country and language from the macOS user
settings form an invalid locale, it will be set to :code:`en_US.UTF-8`.
.. envvar:: PATH
kitty prepends itself to the PATH of its own environment to ensure the
functions calling :program:`kitty` will work properly.
.. envvar:: KITTY_WINDOW_ID
An integer that is the id for the kitty :term:`window` the program is running in.
Can be used with the :doc:`kitty remote control facility <remote-control>`.
.. envvar:: KITTY_PID
An integer that is the process id for the kitty process in which the program
is running. Allows programs to tell kitty to reload its config by sending it
the SIGUSR1 signal.
.. envvar:: KITTY_PUBLIC_KEY
A public key that programs can use to communicate securely with kitty using
the remote control protocol. The format is: :code:`protocol:key data`.
.. envvar:: WINDOWID
The id for the :term:`OS Window <os_window>` the program is running in. Only available
on platforms that have ids for their windows, such as X11 and macOS.
.. envvar:: TERM
The name of the terminal, defaults to ``xterm-kitty``. See :opt:`term`.
.. envvar:: TERMINFO
Path to a directory containing the kitty terminfo database.
.. envvar:: KITTY_INSTALLATION_DIR
Path to the kitty installation directory.
.. envvar:: COLORTERM
Set to the value ``truecolor`` to indicate that kitty supports 16 million
colors.
.. envvar:: KITTY_LISTEN_ON
Set when the :doc:`remote control <remote-control>` facility is enabled and
the a socket is used for control via :option:`kitty --listen-on` or :opt:`listen_on`.
Contains the path to the socket. Avoid the need to use :option:`kitty @ --to` when
issuing remote control commands.
.. envvar:: KITTY_PIPE_DATA
Set to data describing the layout of the screen when running child
programs using :option:`launch --stdin-source` with the contents of the
screen/scrollback piped to them.
.. envvar:: KITTY_CHILD_CMDLINE
Set to the command line of the child process running in the kitty
window when calling the notification callback program on terminal bell, see
:opt:`command_on_bell`.
.. envvar:: KITTY_COMMON_OPTS
Set with the values of some common kitty options when running
kittens, so kittens can use them without needing to load :file:`kitty.conf`.
.. envvar:: KITTY_SHELL_INTEGRATION
Set when enabling :ref:`shell_integration`. It is automatically removed by
the shell integration scripts.
.. envvar:: ZDOTDIR
Set when enabling :ref:`shell_integration` with :program:`zsh`, allowing
:program:`zsh` to automatically load the integration script.
.. envvar:: XDG_DATA_DIRS
Set when enabling :ref:`shell_integration` with :program:`fish`, allowing
:program:`fish` to automatically load the integration script.
.. envvar:: ENV
Set when enabling :ref:`shell_integration` with :program:`bash`, allowing
:program:`bash` to automatically load the integration script.

View File

@@ -1,21 +1,18 @@
:tocdepth: 3
The terminal graphics protocol
==================================
Terminal graphics protocol
=================================
The goal of this specification is to create a flexible and performant protocol
that allows the program running in the terminal, hereafter called the *client*,
to render arbitrary pixel (raster) graphics to the screen of the terminal
emulator. The major design goals are
emulator. The major design goals are:
* Should not require terminal emulators to understand image formats.
* Should allow specifying graphics to be drawn at individual pixel positions.
* The graphics should integrate with the text, in particular it should be possible to draw graphics
below as well as above the text, with alpha blending. The graphics should also scroll with the text, automatically.
* Should use optimizations when the client is running on the same computer as the terminal emulator.
* Should not require terminal emulators to understand image formats.
* Should allow specifying graphics to be drawn at individual pixel positions.
* The graphics should integrate with the text, in particular it should be possible to draw graphics
below as well as above the text, with alpha blending. The graphics should also scroll with the text, automatically.
* Should use optimizations when the client is running on the same computer as the terminal emulator.
For some discussion regarding the design choices, see `#33
<https://github.com/kovidgoyal/kitty/issues/33>`_.
For some discussion regarding the design choices, see :iss:`33`.
To see a quick demo, inside a |kitty| terminal run::
@@ -28,20 +25,31 @@ alpha-blending and text over graphics.
:alt: Demo of graphics rendering in kitty
:align: center
Some programs that use the kitty graphics protocol:
Some programs and libraries that use the kitty graphics protocol:
* `termpdf.py <https://github.com/dsanson/termpdf.py>`_ - a terminal PDF/DJVU/CBR viewer
* `ranger <https://github.com/ranger/ranger>`_ - a terminal file manager, with
image previews, see this `PR <https://github.com/ranger/ranger/pull/1077>`_
* :doc:`kitty-diff <kittens/diff>` - a side-by-side terminal diff program with support for images
* `pixcat <https://github.com/mirukana/pixcat>`_ - a third party CLI and python library that wraps the graphics protocol
* `neofetch <https://github.com/dylanaraps/neofetch>`_ - A command line system
information tool
* `viu <https://github.com/atanunq/viu>`_ - a terminal image viewer
* `glkitty <https://github.com/michaeljclark/glkitty>`_ - C library to draw OpenGL shaders in the terminal with a glgears demo
* `termpdf.py <https://github.com/dsanson/termpdf.py>`_ - a terminal PDF/DJVU/CBR viewer
* `ranger <https://github.com/ranger/ranger>`_ - a terminal file manager, with
image previews, see this `PR <https://github.com/ranger/ranger/pull/1077>`_
* :doc:`kitty-diff <kittens/diff>` - a side-by-side terminal diff program with support for images
* `tpix <https://github.com/jesvedberg/tpix>`_ - a statically compiled binary that can be used to display images and easily installed on remote servers without root access
* `pixcat <https://github.com/mirukana/pixcat>`_ - a third party CLI and python library that wraps the graphics protocol
* `neofetch <https://github.com/dylanaraps/neofetch>`_ - A command line system
information tool
* `viu <https://github.com/atanunq/viu>`_ - a terminal image viewer
* `glkitty <https://github.com/michaeljclark/glkitty>`_ - C library to draw OpenGL shaders in the terminal with a glgears demo
* `ctx.graphics <https://ctx.graphics/>`_ - Library for drawing graphics
* `timg <https://github.com/hzeller/timg>`_ - a terminal image and video viewer
* `notcurses <https://github.com/dankamongmen/notcurses>`_ - C library for terminal graphics with bindings for C++, Rust and Python
* `rasterm <https://github.com/BourgeoisBear/rasterm>`_ - Go library to display images in the terminal
* `chafa <https://github.com/hpjansson/chafa>`_ - a terminal image viewer
* `hologram.nvim <https://github.com/edluffy/hologram.nvim>`_ - view images inside nvim
* `term-image <https://github.com/AnonymouX47/term-image>`_ - A Python library, CLI and TUI to display and browse images in the terminal
Other terminals that have implemented the graphics protocol:
.. contents::
* `WezTerm <https://github.com/wez/wezterm/issues/986>`_
* `Konsole <https://invent.kde.org/utilities/konsole/-/merge_requests/594>`_
* `wayst <https://github.com/91861/wayst>`_
Getting the window size
@@ -52,28 +60,33 @@ client must be able to get the window size in pixels and the number of cells
per row and column. This can be done by using the ``TIOCGWINSZ`` ioctl. Some
code to demonstrate its use
In C:
.. tab:: C
.. code-block:: c
.. code-block:: c
#include <stdio.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <sys/ioctl.h>
int main(int argc, char **argv) {
struct winsize sz;
ioctl(0, TIOCGWINSZ, &sz);
printf("number of rows: %i, number of columns: %i, screen width: %i, screen height: %i\n", sz.ws_row, sz.ws_col, sz.ws_xpixel, sz.ws_ypixel);
return 0;
}
int main(int argc, char **argv) {
struct winsize sz;
ioctl(0, TIOCGWINSZ, &sz);
printf(
"number of rows: %i, number of columns: %i, screen width: %i, screen height: %i\n",
sz.ws_row, sz.ws_col, sz.ws_xpixel, sz.ws_ypixel);
return 0;
}
In Python:
.. code-block:: python
.. tab:: Python
import array, fcntl, sys, termios
buf = array.array('H', [0, 0, 0, 0])
fcntl.ioctl(sys.stdout, termios.TIOCGWINSZ, buf)
print('number of rows: {}, number of columns: {}, screen width: {}, screen height: {}'.format(*buf))
.. code-block:: python
import array, fcntl, sys, termios
buf = array.array('H', [0, 0, 0, 0])
fcntl.ioctl(sys.stdout, termios.TIOCGWINSZ, buf)
print((
'number of rows: {} number of columns: {}'
'screen width: {} screen height: {}').format(*buf))
Note that some terminals return ``0`` for the width and height values. Such
terminals should be modified to return the correct values. Examples of
@@ -93,32 +106,36 @@ features of the graphics protocol:
.. code-block:: python
import sys
from base64 import standard_b64encode
import sys
from base64 import standard_b64encode
def serialize_gr_command(cmd, payload=None):
cmd = ','.join('{}={}'.format(k, v) for k, v in cmd.items())
ans = []
w = ans.append
w(b'\033_G'), w(cmd.encode('ascii'))
if payload:
w(b';')
w(payload)
w(b'\033\\')
return b''.join(ans)
def write_chunked(cmd, data):
data = standard_b64encode(data)
while data:
chunk, data = data[:4096], data[4096:]
m = 1 if data else 0
cmd['m'] = m
sys.stdout.buffer.write(serialize_gr_command(cmd, chunk))
sys.stdout.flush()
cmd.clear()
def serialize_gr_command(**cmd):
payload = cmd.pop('payload', None)
cmd = ','.join(f'{k}={v}' for k, v in cmd.items())
ans = []
w = ans.append
w(b'\033_G'), w(cmd.encode('ascii'))
if payload:
w(b';')
w(payload)
w(b'\033\\')
return b''.join(ans)
with open(sys.argv[-1], 'rb') as f:
write_chunked({'a': 'T', 'f': 100}, f.read())
def write_chunked(**cmd):
data = standard_b64encode(cmd.pop('data'))
while data:
chunk, data = data[:4096], data[4096:]
m = 1 if data else 0
sys.stdout.buffer.write(serialize_gr_command(payload=chunk, m=m,
**cmd))
sys.stdout.flush()
cmd.clear()
with open(sys.argv[-1], 'rb') as f:
write_chunked(a='T', f=100, data=f.read())
Save this script as :file:`png.py`, then you can use it to display any PNG
@@ -144,6 +161,8 @@ The meaning of the payload is interpreted based on the control data.
The first step is to transmit the actual image data.
.. _transferring_pixel_data:
Transferring pixel data
--------------------------
@@ -190,16 +209,17 @@ compression, then you must provide the ``S`` key with the size of the PNG data.
Compression
~~~~~~~~~~~~~
The client can send compressed image data to the terminal emulator, by specifying the
``o`` key. Currently, only zlib based deflate compression is supported, which is specified using
``o=z``. For example::
The client can send compressed image data to the terminal emulator, by
specifying the ``o`` key. Currently, only :rfc:`1950` ZLIB based deflate
compression is supported, which is specified using ``o=z``. For example::
<ESC>_Gf=24,s=10,v=20,o=z;<payload><ESC>\
This is the same as the example from the RGB data section, except that the
payload is now compressed using deflate. The terminal emulator will decompress
it before rendering. You can specify compression for any format. The terminal
emulator will decompress before interpreting the pixel data.
payload is now compressed using deflate (this occurs prior to base64-encoding).
The terminal emulator will decompress it before rendering. You can specify
compression for any format. The terminal emulator will decompress before
interpreting the pixel data.
The transmission medium
@@ -212,16 +232,26 @@ and can take the values:
Value of `t` Meaning
================== ============
``d`` Direct (the data is transmitted within the escape code itself)
``f`` A simple file
``f`` A simple file (regular files only, not named pipes or similar)
``t`` A temporary file, the terminal emulator will delete the file after reading the pixel data. For security reasons
the terminal emulator should only delete the file if it
is in a known temporary directory, such as :file:`/tmp`,
:file:`/dev/shm`, :file:`TMPDIR env var if present` and any platform
specific temporary directories.
``s`` A `POSIX shared memory object <http://man7.org/linux/man-pages/man7/shm_overview.7.html>`_.
The terminal emulator will delete it after reading the pixel data
specific temporary directories and the file has the
string :code:`tty-graphics-protocol` in its full file path.
``s`` A *shared memory object*, which on POSIX systems is a
`POSIX shared memory object <https://pubs.opengroup.org/onlinepubs/9699919799/functions/shm_open.html>`_
and on Windows is a
`Named shared memory object <https://docs.microsoft.com/en-us/windows/win32/memory/creating-named-shared-memory>`_.
The terminal emulator must read the data from the memory
object and then unlink and close it on POSIX and just
close it on Windows.
================== ============
When opening files, the terminal emulator must follow symlinks. In case of
symlink loops or too many symlinks, it should fail and respond with an error,
similar to reporting any other kind of I/O error.
Local client
^^^^^^^^^^^^^^
@@ -265,7 +295,7 @@ sequence of escape codes to the terminal emulator::
<ESC>_Gm=0;<encoded pixel data last chunk><ESC>\
Note that only the first escape code needs to have the full set of control
codes such as width, height, format etc. Subsequent chunks must have
codes such as width, height, format etc. Subsequent chunks **must** have
only the ``m`` key. The client **must** finish sending all chunks for a single image
before sending any other graphics related escape codes. Note that the cursor
position used to display the image **must** be the position when the final chunk is
@@ -300,14 +330,14 @@ use the *query action*, set ``a=q``. Then the terminal emulator will try to load
the image and respond with either OK or an error, as above, but it will not
replace an existing image with the same id, nor will it store the image.
While as of May 2020, kitty is the only terminal emulator to support this
graphics protocol, we intend that any terminal emulator that wishes to support
it can. To check if a terminal emulator supports the graphics protocol the best way
is to send the above *query action* followed by a request for the
`primary device attributes <https://vt100.net/docs/vt510-rm/DA1.html>`. If you
get back an answer for the device attributes without getting back an answer for
the *query action* the terminal emulator does not support the graphics
protocol.
As of April 2022, kitty and WezTerm are the only terminal emulators to
support this graphics protocol completely, with Konsole and wayst having partial support.
We intend that any terminal emulator that wishes to support it can do so. To
check if a terminal emulator supports the graphics protocol the best way is to
send the above *query action* followed by a request for the `primary device
attributes <https://vt100.net/docs/vt510-rm/DA1.html>`_. If you get back an
answer for the device attributes without getting back an answer for the *query
action* the terminal emulator does not support the graphics protocol.
This means that terminal emulators that support the graphics protocol, **must**
reply to *query actions* immediately without processing other input. Most
@@ -350,7 +380,9 @@ id. To do so add the ``p`` key with a number between ``1`` and ``4294967295``.
When you specify a placement id, it will be added to the acknowledgement code
above. Every placement is uniquely identified by the pair of the ``image id``
and the ``placement id``. If you specify a placement id for an image that does
not have an id, it will be ignored. An example response::
not have an id (i.e. has id=0), it will be ignored. In particular this means
there can exist multiple images with ``image id=0, placement id=0``.
An example response::
<ESC>_Gi=<image id>,p=<placement id>;OK<ESC>\
@@ -387,13 +419,21 @@ they are semi-transparent. You can specify z-index values using the ``z`` key.
Negative z-index values mean that the images will be drawn under the text. This
allows rendering of text on top of images. Negative z-index values below
INT32_MIN/2 (-1,073,741,824) will be drawn under cells with non-default background
colors.
colors. If two images with the same z-index overlap then the image with the
lower id is considered to have the lower z-index. If the images have the same
z-index and the same id, then the behavior is undefined.
.. note:: After placing an image on the screen the cursor must be moved to the
right by the number of cols in the image placement rectangle and down by the
number of rows in the image placement rectangle. If either of these cause
the cursor to leave either the screen or the scroll area, the exact
positioning of the cursor is undefined, and up to implementations.
The client can ask the terminal emulator to not move the cursor at all
by specifying ``C=1`` in the command, which sets the cursor movement policy
to no movement for placing the current image.
.. versionadded:: 0.20.0
Support for the C=1 cursor movement policy
Deleting images
@@ -417,7 +457,7 @@ Value of ``d`` Meaning
``n`` or ``N`` Delete newest image with the specified number, specified using the ``I`` key. If you specify a ``p`` key for the
placement id as well, then only the placement with the specified number and placement id will be deleted.
``c`` or ``C`` Delete all placements that intersect with the current cursor position.
``c`` or ``C`` Delete all placements that intersect with the current cursor position.
``f`` or ``F`` Delete animation frames.
``p`` or ``P`` Delete all placements that intersect a specific cell, the cell is specified using the ``x`` and ``y`` keys
``q`` or ``Q`` Delete all placements that intersect a specific cell having a specific z-index. The cell and z-index is specified using the ``x``, ``y`` and ``z`` keys.
``x`` or ``X`` Delete all placements that intersect the specified column, specified using the ``x`` key.
@@ -428,8 +468,8 @@ Value of ``d`` Meaning
Note when all placements for an image have been deleted, the image is also
deleted, if the capital letter form above is specified. Also, when the terminal
is running out of quota space for image, images without placements will be
preferentially deleted.
is running out of quota space for new images, existing images without
placements will be preferentially deleted.
Some examples::
@@ -441,7 +481,7 @@ Some examples::
Suppressing responses from the terminal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-------------------------------------------
If you are using the graphics protocol from a limited client, such as a shell
script, it might be useful to avoid having to process responses from the
@@ -453,12 +493,12 @@ terminal. For this, you can use the ``q`` key. Set it to ``1`` to suppress
Requesting image ids from the terminal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-------------------------------------------
If you are writing a program that is going to share the screen with other
programs and you still want to use image ids, it is not possible to know
what image ids are free to use. In this case, instead of using the ``i``
key to specify and image id use the ``I`` key to specify and image number
key to specify an image id use the ``I`` key to specify an image number
instead. These numbers are not unique.
When creating a new image, even if an existing image has the same number a new
one is created. And the terminal will reply with the id of the newly created
@@ -484,14 +524,185 @@ use the ``i`` key with the image id for all future communication.
The ability to use image numbers (see :doc:`kittens/query_terminal` to query kitty version)
.. _animation_protocol:
Animation
-------------------------------------------
.. versionadded:: 0.20.0
Animation support (see :doc:`kittens/query_terminal` to query kitty version)
When designing support for animation, the two main considerations were:
#. There should be a way for both client and terminal driven animations.
Since there is unknown and variable latency between client and terminal,
especially over SSH, client driven animations are not sufficient.
#. Animations often consist of small changes from one frame to the next, the
protocol should thus allow transmitting these deltas for efficiency and
performance reasons.
Animation support is added to the protocol by adding two new modes for the
``a`` (action) key. A ``f`` mode for transmitting frame data and an ``a`` mode
for controlling the animation of an image. Animation proceeds in two steps,
first a normal image is created as described earlier. Then animation frames are
added to the image to make it into an animation. Since every animation is
associated with a single image, all animation escape codes must specify either
the ``i`` or ``I`` keys to identify the image being operated on.
Transferring animation frame data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Transferring animation frame data is very similar to
:ref:`transferring_pixel_data` above. The main difference is that the image
the frame belongs to must be specified and it is possible to transmit data for
only part of a frame, declaring the rest of the frame to be filled in by data
from a previous frame, or left blank. To transfer frame data the ``a=f``
key must be used in all escape codes.
First, to transfer a simple frame that has data for the full image area, the
escape codes used are exactly the same as for transferring image data, with the
addition of: ``a=f,i=<image id>`` or ``a=f,I=<image number>``.
If the frame has data for only a part of the image, you can specify the
rectangle for it using the ``x, y, s, v`` keys, for example::
x=10,y=5,s=100,v=200 # A 100x200 rectangle with its top left corner at (10, 5)
Frames are created by composing the transmitted data onto a background canvas.
This canvas can be either a single color, or the pixels from a previous frame.
The composition can be of two types, either a simple replacement (``X=1``) key
or a full alpha blend (the default).
To use a background color for the canvas, specify the ``Y`` key as a 32-bit
RGBA color. For example::
Y=4278190335 # 0xff0000ff opaque red
Y=16711816 # 0x00ff0088 translucent green (alpha=0.53)
The default background color when none is specified is ``0`` i.e. a black,
transparent pixel.
To use the data from a previous frame, specify the ``c`` key which is a 1-based
frame number. Thus ``c=1`` refers to the root frame (the base image data),
``c=2`` refers to the second frame and so on.
If the frame is composed of multiple rectangular blocks, these can be expressed
by using the ``r`` key. When specifying the ``r`` key the data for an existing
frame is edited. The same composition operation as above happens, but now the
background canvas is the existing frame itself. ``r`` is a 1-based index, so
``r=1`` is the root frame (base image data), ``r=2`` is the second frame and so
on.
Finally, while transferring frame data, the frame *gap* can also be specified
using the ``z`` key. The gap is the number of milliseconds to wait before
displaying the next frame when the animation is running. A value of ``z=0`` is
ignored, ``z=positive number`` sets the gap to the specified number of
milliseconds and ``z=negative number`` creates a *gapless* frame. Gapless
frames are not displayed to the user since they are instantly skipped over,
however they can be useful as the base data for subsequent frames. For example,
for an animation where the background remains the same and a small object or two
move.
Controlling animations
~~~~~~~~~~~~~~~~~~~~~~~~~~
Clients can control animations by using the ``a=a`` key in the escape code sent
to the terminal.
The simplest is client driven animations, where the client transmits the frame
data and then also instructs the terminal to make a particular frame the current
frame. To change the current frame, use the ``c`` key::
<ESC>_Ga=a,i=3,c=7<ESC>\
This will make the seventh frame in the image with id ``3`` the current frame.
However, client driven animations can be sub-optimal, since the latency between
the client and terminal is unknown and variable especially over the network.
Also they require the client to remain running for the lifetime of the
animation, which is not desirable for cat like utilities.
Terminal driven animations are achieved by the client specifying *gaps* (time
in milliseconds) between frames and instructing the terminal to stop or start
the animation.
The animation state is controlled by the ``s`` key. ``s=1`` stops the
animation. ``s=2`` runs the animation, but in *loading* mode, in this mode when
reaching the last frame, instead of looping, the terminal will wait for the
arrival of more frames. ``s=3`` runs the animation normally, after the last
frame, the terminal loops back to the first frame. The number of loops can be
controlled by the ``v`` key. ``v=0`` is ignored, ``v=1`` is loop infinitely,
and any other positive number is loop ``number - 1`` times. Note that stopping
the animation resets the loop counter.
Finally, the *gap* for frames can be set using the ``z`` key. This can be
specified either when the frame is created as part of the transmit escape code
or separately using the animation control escape code. The *gap* is the time in
milliseconds to wait before displaying the next frame in the animation.
For example::
<ESC>_Ga=a,i=7,r=3,z=48<ESC>\
This sets the gap for the third frame of the image with id ``7`` to ``48``
milliseconds. Note that *gapless* frames are not displayed to the user since
the next frame comes immediately, however they can be useful to store base data
for subsequent frames, such as in an animation with an object moving against a
static background.
In particular, the first frame or *root frame* is created with the base image
data and has no gap, so its gap must be set using this control code.
Composing animation frames
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 0.22.0
Support for frame composition
Clients can *compose* animation frames, this means that they can compose pixels
in rectangular regions from one frame onto another frame. This allows for fast
and low band-width modification of frames.
To achieve this use the ``a=c`` key. The source frame is specified with
``r=frame number`` and the destination frame as ``c=frame number``. The size of
the rectangle is specified as ``w=width,h=height`` pixels. If unspecified, the
full image width and height are used. The offset of the rectangle from the
top-left corner for the source frame is specified by the ``x,y`` keys and the
destination frame by the ``X,Y`` keys. The composition operation is specified
by the ``C`` key with the default being to alpha blend the source rectangle
onto the destination rectangle. With ``C=1`` it will be a simple replacement
of pixels. For example::
<ESC>_Gi=1,r=7,c=9,w=23,h=27,X=4,Y=8,x=1,y=3<ESC>\
Will compose a ``23x27`` rectangle located at ``(4, 8)`` in the ``7th frame``
onto the rectangle located at ``(1, 3)`` in the ``9th frame``. These will be
in the image with ``id=1``.
If the frames or the image are not found the terminal emulator must
respond with `ENOENT`. If the rectangles go out of bounds of the image
the terminal must respond with `EINVAL`. If the source and destination frames are
the same and the rectangles overlap, the terminal must respond with `EINVAL`.
.. note::
In kitty, doing a composition will cause a frame to be *fully rendered*
potentially increasing its storage requirements, when the frame was previously
stored as a set of operations on other frames. If this happens and there
is not enough storage space, kitty will respond with ENOSPC.
Image persistence and storage quotas
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----------------------------------------
In order to avoid *Denial-of-Service* attacks, terminal emulators should have a
maximum storage quota for image data. It should allow at least a few full
screen images. For example the quota in kitty is 320MB per buffer. When adding
a new image, if the total size exceeds the quota, the terminal emulator should
delete older images to make space for the new one.
delete older images to make space for the new one. In kitty, for animations,
the additional frame data is stored on disk and has a separate, larger quota of
five times the base quota.
Control data reference
@@ -504,7 +715,10 @@ take, and the default value they take when missing. All integers are 32-bit.
Key Value Default Description
======= ==================== ========= =================
``a`` Single character. ``t`` The overall action this graphics command is performing.
``(t, T, q, p, d)``
``(a, c, d, f, `` ``t`` - transmit data, ``T`` - transmit data and display image,
``p, q, t, T)`` ``q`` - query terminal, ``p`` - put (display) previous transmitted image,
``d`` - delete image, ``f`` - transmit data for animation frames,
``a`` - control animation, ``c`` - compose animation frames
``q`` ``0, 1, 2`` ``0`` Suppress responses from the terminal to this graphics command.
@@ -520,22 +734,71 @@ Key Value Default Description
``O`` Positive integer. ``0`` The offset from which to read data from a file.
``i`` Positive integer.
``(0 - 4294967295)`` ``0`` The image id
``I`` Positive integer.
``(0 - 4294967295)`` ``0`` The image number
``p`` Positive integer.
``(0 - 4294967295)`` ``0`` The placement id
``o`` Single character. ``null`` The type of data compression.
``only z``
``m`` zero or one ``0`` Whether there is more chunked data available.
**Keys for image display**
-----------------------------------------------------------
``x`` Positive integer ``0`` The left edge (in pixels) of the image area to display
``y`` Positive integer ``0`` The top edge (in pixels) of the image area to display
``w`` Positive integer ``0`` The width (in pixels) of the image area to display. By default, the entire width is used.
``w`` Positive integer ``0`` The width (in pixels) of the image area to display. By default, the entire width is used
``h`` Positive integer ``0`` The height (in pixels) of the image area to display. By default, the entire height is used
``X`` Positive integer ``0`` The x-offset within the first cell at which to start displaying the image
``Y`` Positive integer ``0`` The y-offset within the first cell at which to start displaying the image
``c`` Positive integer ``0`` The number of columns to display the image over
``r`` Positive integer ``0`` The number of rows to display the image over
``C`` Positive integer ``0`` Cursor movement policy. ``0`` is the default, to move the cursor to after the image.
``1`` is to not move the cursor at all when placing the image.
``z`` 32-bit integer ``0`` The *z-index* vertical stacking order of the image
**Keys for animation frame loading**
-----------------------------------------------------------
``x`` Positive integer ``0`` The left edge (in pixels) of where the frame data should be updated
``y`` Positive integer ``0`` The top edge (in pixels) of where the frame data should be updated
``c`` Positive integer ``0`` The 1-based frame number of the frame whose image data serves as the base data
when creating a new frame, by default the base data is black, fully transparent pixels
``r`` Positive integer ``0`` The 1-based frame number of the frame that is being edited. By default, a new frame is created
``z`` 32-bit integer ``0`` The gap (in milliseconds) of this frame from the next one. A value of
zero is ignored. Negative values create a *gapless* frame. If not specified,
frames have a default gap of ``40ms``. The root frame defaults to zero gap.
``X`` Positive integer ``0`` The composition mode for blending pixels when creating a new frame or
editing a frame's data. The default is full alpha blending. ``1`` means a
simple overwrite.
``Y`` Positive integer ``0`` The background color for pixels not
specified in the frame data. Must be in 32-bit RGBA format
**Keys for animation frame composition**
-----------------------------------------------------------
``c`` Positive integer ``0`` The 1-based frame number of the frame whose image data serves as the overlaid data
``r`` Positive integer ``0`` The 1-based frame number of the frame that is being edited.
``x`` Positive integer ``0`` The left edge (in pixels) of the destination rectangle
``y`` Positive integer ``0`` The top edge (in pixels) of the destination rectangle
``w`` Positive integer ``0`` The width (in pixels) of the source and destination rectangles. By default, the entire width is used
``h`` Positive integer ``0`` The height (in pixels) of the source and destination rectangles. By default, the entire height is used
``X`` Positive integer ``0`` The left edge (in pixels) of the source rectangle
``Y`` Positive integer ``0`` The top edge (in pixels) of the source rectangle
``C`` Positive integer ``0`` The composition mode for blending
pixels. Default is full alpha blending. ``1`` means a simple overwrite.
**Keys for animation control**
-----------------------------------------------------------
``s`` Positive integer ``0`` ``1`` - stop animation, ``2`` - run animation, but wait for new frames, ``3`` - run animation
``r`` Positive integer ``0`` The 1-based frame number of the frame that is being affected
``z`` 32-bit integer ``0`` The gap (in milliseconds) of this frame from the next one. A value of
zero is ignored. Negative values create a *gapless* frame.
``c`` Positive integer ``0`` The 1-based frame number of the frame that should be made the current frame
``v`` Positive integer ``0`` The number of loops to play. ``0`` is
ignored, ``1`` is play infinite and is the default and larger number
means play that number ``-1`` loops
**Keys for deleting images**
-----------------------------------------------------------
``d`` Single character. ``a`` What to delete.

View File

@@ -1,526 +1,74 @@
:tocdepth: 2
==========================================================
kitty - the fast, featureful, GPU based terminal emulator
kitty
==========================================================
.. container:: major-features
* Offloads rendering to the GPU for :doc:`lower system load <performance>` and
buttery smooth scrolling. Uses threaded rendering to minimize input latency.
* Supports all modern terminal features: :doc:`graphics (images)
<graphics-protocol>`, unicode, `true-color
<https://gist.github.com/XVilka/8346728>`_,
OpenType ligatures, mouse protocol, :doc:`hyperlinks <open_actions>`,
focus tracking, `bracketed paste <https://cirw.in/blog/bracketed-paste>`_
and several :doc:`new terminal protocol extensions
<protocol-extensions>`.
* Supports tiling multiple terminal windows side by side in different
:ref:`layouts <layouts>` without needing to use an extra program like tmux
* Can be :doc:`controlled from scripts or the shell prompt <remote-control>`,
even over SSH.
* Has a framework for :ref:`kittens`, small terminal programs that can be used to
extend |kitty|'s functionality. For example, they are used for
:doc:`Unicode input <kittens/unicode-input>`, :doc:`Hints <kittens/hints>` and
:doc:`Side-by-side diff <kittens/diff>`.
* Supports :ref:`startup sessions <sessions>` which allow you to specify
the window/tab layout, working directories and programs to run on startup.
* Cross-platform: |kitty| works on Linux and macOS, but because it uses only
OpenGL for rendering, it should be trivial to port to other Unix-like platforms.
* Allows you to open :ref:`the scrollback buffer <scrollback>` in a
separate window using arbitrary programs of your choice. This is useful for
browsing the history comfortably in a pager or editor.
* Has :ref:`multiple copy/paste buffers <cpbuf>`, like vim.
.. figure:: screenshots/screenshot.png
:alt: Screenshot, showing three programs in the 'Tall' layout
:align: center
:scale: 100%
Screenshot, showing vim, tig and git running in |kitty| with the 'Tall' layout
.. _quickstart:
Quickstart
--------------
Pre-built binaries of |kitty| are available for both macOS and Linux.
See the :doc:`binary install instructions </binary>`. You can
:doc:`build from source </build>`.
You can also use your favorite package manager to install the |kitty| package.
|kitty| packages are available for:
`macOS with Homebrew (Cask) <https://formulae.brew.sh/cask/kitty>`_,
`macOS and Linux with Nix <https://nixos.org/nixos/packages.html?channel=nixpkgs-unstable&query=kitty>`_,
`Ubuntu <https://launchpad.net/ubuntu/+source/kitty>`_,
`Debian <https://packages.debian.org/buster/kitty>`_,
`openSUSE <https://build.opensuse.org/package/show/X11:terminals/kitty>`_,
`Arch Linux <https://www.archlinux.org/packages/community/x86_64/kitty/>`_,
`Gentoo <https://packages.gentoo.org/packages/x11-terms/kitty>`_,
`Fedora <https://src.fedoraproject.org/rpms/kitty>`_,
`Void Linux <https://github.com/void-linux/void-packages/blob/master/srcpkgs/kitty/template>`_,
and `Solus <https://dev.getsol.us/source/kitty/>`_.
See :doc:`Configuring kitty <conf>` for help on configuring |kitty| and
:doc:`Invocation <invocation>` for the command line arguments |kitty| supports.
.. contents::
Design philosophy
-------------------
|kitty| is designed for power keyboard users. To that end all its controls
work with the keyboard (although it fully supports mouse interactions as
well). Its configuration is a simple, human editable, single file for
easy reproducibility (I like to store configuration in source control).
The code in |kitty| is designed to be simple, modular and hackable. It is
written in a mix of C (for performance sensitive parts) and Python (for
easy hackability of the UI). It does not depend on any large and complex
UI toolkit, using only OpenGL for rendering everything.
Finally, |kitty| is designed from the ground up to support all modern
terminal features, such as unicode, true color, bold/italic fonts, text
formatting, etc. It even extends existing text formatting escape codes,
to add support for features not available elsewhere, such as colored and
styled (curly) underlines. One of the design goals of |kitty| is to be
easily extensible so that new features can be added in the future with
relatively little effort.
Tabs and Windows
-------------------
|kitty| is capable of running multiple programs organized into tabs and
windows. The top level of organization is the *Tab*. Each tab consists
of one or more *windows*. The windows can be arranged in multiple
different layouts, like windows are organized in a tiling window
manager. The keyboard controls (which are all customizable) for tabs and
windows are:
Scrolling
~~~~~~~~~~~~~~
======================== =======================
Action Shortcut
======================== =======================
Scroll line up :sc:`scroll_line_up` (also :kbd:`⌥+⌘+⇞` and :kbd:`⌘+↑` on macOS)
Scroll line down :sc:`scroll_line_down` (also :kbd:`⌥+⌘+⇟` and :kbd:`⌘+↓` on macOS)
Scroll page up :sc:`scroll_page_up` (also :kbd:`⌘+⇞` on macOS)
Scroll page down :sc:`scroll_page_down` (also :kbd:`⌘+⇟` on macOS)
Scroll to top :sc:`scroll_home` (also :kbd:`⌘+↖` on macOS)
Scroll to bottom :sc:`scroll_end` (also :kbd:`⌘+↘` on macOS)
======================== =======================
Tabs
~~~~~~~~~~~
======================== =======================
Action Shortcut
======================== =======================
New tab :sc:`new_tab` (also :kbd:`⌘+t` on macOS)
Close tab :sc:`close_tab` (also :kbd:`⌘+w` on macOS)
Next tab :sc:`next_tab` (also :kbd:`^+⇥` and :kbd:`⇧+⌘+]` on macOS)
Previous tab :sc:`previous_tab` (also :kbd:`⇧+^+⇥` and :kbd:`⇧+⌘+[` on macOS)
Next layout :sc:`next_layout`
Move tab forward :sc:`move_tab_forward`
Move tab backward :sc:`move_tab_backward`
Set tab title :sc:`set_tab_title` (also :kbd:`⇧+⌘+i` on macOS)
======================== =======================
Windows
~~~~~~~~~~~~~~~~~~
======================== =======================
Action Shortcut
======================== =======================
New window :sc:`new_window` (also :kbd:`⌘+↩` on macOS)
New OS window :sc:`new_os_window` (also :kbd:`⌘+n` on macOS)
Close window :sc:`close_window` (also :kbd:`⇧+⌘+d` on macOS)
Next window :sc:`next_window`
Previous window :sc:`previous_window`
Move window forward :sc:`move_window_forward`
Move window backward :sc:`move_window_backward`
Move window to top :sc:`move_window_to_top`
Focus specific window :sc:`first_window`, :sc:`second_window` ... :sc:`tenth_window`
(also :kbd:`⌘+1`, :kbd:`⌘+2` ... :kbd:`⌘+9` on macOS)
(clockwise from the top-left)
======================== =======================
Additionally, you can define shortcuts in :file:`kitty.conf` to focus neighboring
windows and move windows around (similar to window movement in vim)::
map ctrl+left neighboring_window left
map shift+left move_window right
map ctrl+down neighboring_window down
map shift+down move_window up
...
You can also define a shortcut to switch to the previously active window::
map ctrl+p nth_window -1
``nth_window`` will focus the nth window for positive numbers and the
previously active windows for negative numbers.
.. _detach_window:
You can define shortcuts to detach the current window and
move it to another tab or another OS window::
# moves the window into a new OS window
map ctrl+f2 detach_window
# moves the window into a new Tab
map ctrl+f3 detach_window new-tab
# asks which tab to move the window into
map ctrl+f4 detach_window ask
Similarly, you can detach the current tab, with::
# moves the tab into a new OS window
map ctrl+f2 detach_tab
# asks which OS Window to move the tab into
map ctrl+f4 detach_tab ask
Finally, you can define a shortcut to close all windows in a tab other than
the currently active window::
map f9 close_other_windows_in_tab
Other keyboard shortcuts
----------------------------------
================================== =======================
Action Shortcut
================================== =======================
Copy to clipboard :sc:`copy_to_clipboard` (also :kbd:`⌘+c` on macOS)
Paste from clipboard :sc:`paste_from_clipboard` (also :kbd:`⌘+v` on macOS)
Paste from selection :sc:`paste_from_selection`
Increase font size :sc:`increase_font_size` (also :kbd:`⌘++` on macOS)
Decrease font size :sc:`decrease_font_size` (also :kbd:`⌘+-` on macOS)
Restore font size :sc:`reset_font_size` (also :kbd:`⌘+0` on macOS)
Toggle fullscreen :sc:`toggle_fullscreen` (also :kbd:`^+⌘+f` on macOS)
Toggle maximized :sc:`toggle_maximized`
Input unicode character :sc:`input_unicode_character`
Click URL using the keyboard :sc:`open_url`
Reset the terminal :sc:`reset_terminal`
Pass current selection to program :sc:`pass_selection_to_program`
Edit |kitty| config file :sc:`edit_config_file`
Open a |kitty| shell :sc:`kitty_shell`
Increase background opacity :sc:`increase_background_opacity`
Decrease background opacity :sc:`decrease_background_opacity`
Full background opacity :sc:`full_background_opacity`
Reset background opacity :sc:`reset_background_opacity`
================================== =======================
.. _layouts:
Layouts
----------
A layout is an arrangement of multiple kitty *windows* inside a top-level OS window. You can create a new window
using the :sc:`new_window` key combination.
Currently, there are six layouts available:
* **Fat** -- One (or optionally more) windows are shown full width on the top, the rest of the windows are shown side-by-side on the bottom
* **Grid** -- All windows are shown in a grid
* **Horizontal** -- All windows are shown side-by-side
* **Splits** -- Windows arranged in arbitrary patterns created using horizontal and vertical splits
* **Stack** -- Only a single maximized window is shown at a time
* **Tall** -- One (or optionally more) windows are shown full height on the left, the rest of the windows are shown one below the other on the right
* **Vertical** -- All windows are shown one below the other
By default, all layouts are enabled and you can switch between layouts using
the :sc:`next_layout` key combination. You can also create shortcuts to select
particular layouts, and choose which layouts you want to enable/disable, see
:ref:`conf-kitty-shortcuts.layout` for examples. The first layout listed in
:opt:`enabled_layouts` becomes the default layout.
For more details on the layouts and how to use them see :doc:`layouts`.
.. _kittens:
Kittens
------------------
|kitty| has a framework for easily creating terminal programs that make use of
its advanced features. These programs are called kittens. They are used both
to add features to |kitty| itself and to create useful standalone programs.
Some prominent kittens:
:doc:`icat <kittens/icat>`
Display images in the terminal
:doc:`diff <kittens/diff>`
A fast, side-by-side diff for the terminal with syntax highlighting and
images
:doc:`Unicode Input <kittens/unicode-input>`
Easily input arbitrary unicode characters in |kitty| by name or hex code.
:doc:`Hints <kittens/hints>`
Select and open/paste/insert arbitrary text snippets such as URLs,
filenames, words, lines, etc from the terminal screen.
:doc:`Panel <kittens/panel>`
Draw a GPU accelerated dock panel on your desktop showing the output
from an arbitrary terminal program.
:doc:`Clipboard <kittens/clipboard>`
Copy/paste to the clipboard from shell scripts, even over SSH.
You can also :doc:`Learn to create your own kittens <kittens/custom>`.
Configuring kitty
-------------------
|kitty| is highly configurable, everything from keyboard shortcuts to
painting frames-per-second. For details and a sample :file:`kitty.conf`,
see the :doc:`configuration docs <conf>`.
Remote control
------------------
|kitty| has a very powerful system that allows you to control it from the
:doc:`shell prompt, even over SSH <remote-control>`. You can change colors,
fonts, open new windows, tabs, set their titles, change window layout, get text
from one window and send text to another, etc, etc. The possibilities are
endless. See the :doc:`tutorial <remote-control>` to get started.
.. _sessions:
Startup Sessions
------------------
You can control the tabs, window layout, working directory, startup programs,
etc. by creating a "session" file and using the :option:`kitty --session`
command line flag or the :opt:`startup_session` option in :file:`kitty.conf`.
For example:
.. code-block:: session
# Set the window layout for the current tab
layout tall
# Set the working directory for windows in the current tab
cd ~
# Create a window and run the specified command in it
launch zsh
# Create a window with some environment variables set and run
# vim in it
launch env FOO=BAR vim
# Set the title for the next window
title Chat with x
launch irssi --profile x
# Create a new tab (the part after new_tab is the optional tab
# name which will be displayed in the tab bar, if omitted, the
# title of the active window will be used instead)
new_tab my tab
cd ~/somewhere
# Set the layouts allowed in this tab
enabled_layouts tall, stack
# Set the current layout
layout stack
launch zsh
# Create a new OS window
new_os_window
# set new window size to 80x25 cells
os_window_size 80c 25c
# set the --class for the new OS window
os_window_class mywindow
launch sh
# Make the current window the active (focused) window
focus
launch emacs
# Add a watcher that will be called with various events that occur
# on all subsequent windows. See the documentation of the launch command
# for details on watchers.
watcher /some/python/file.py
launch mpd
launch irssi
# Remove the watcher for further windows
watcher clear
Mouse features
-------------------
* You can hold down :kbd:`ctrl+shift` and click on a URL to open it in a browser.
* You can double click to select a word and then drag to select more words.
* You can triple click to select a line and then drag to select more lines.
* You can right click to extend a previous selection.
* You can hold down :kbd:`ctrl+alt` and drag with the mouse to select in
columns (see also :opt:`rectangle_select_modifiers`).
* Selecting text automatically copies it to the primary clipboard (on
platforms with a primary clipboard).
* You can select text with kitty even when a terminal program has grabbed
the mouse by holding down the :kbd:`shift` key (see also
:opt:`terminal_select_modifiers`).
Font control
-----------------
|kitty| has extremely flexible and powerful font selection features. You can
specify individual families for the regular, bold, italic and bold+italic
fonts. You can even specify specific font families for specific ranges of
unicode characters. This allows precise control over text rendering. It can
come in handy for applications like powerline, without the need to use patched
fonts. See the various font related configuration directives in
:ref:`conf-kitty-fonts`.
.. _scrollback:
The scrollback buffer
-----------------------
|kitty| supports scrolling back to view history, just like most terminals. You
can use either keyboard shortcuts or the mouse scroll wheel to do so. However,
|kitty| has an extra, neat feature. Sometimes you need to explore the
scrollback buffer in more detail, maybe search for some text or refer to it
side-by-side while typing in a follow-up command. |kitty| allows you to do this
by pressing the :sc:`show_scrollback` key-combination, which will open the
scrollback buffer in your favorite pager program (which is ``less`` by default).
Colors and text formatting are preserved. You can explore the scrollback buffer
comfortably within the pager.
Additionally, you can pipe the contents of the scrollback buffer to an
arbitrary, command running in a new window, tab or overlay, for example::
map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting less +G -R
Would open the scrollback buffer in a new window when you press the :kbd:`F1`
key. See :sc:`show_scrollback` for details.
If you wish to store very large amounts of scrollback to view using the piping or
:sc:`show_scrollback` features, you can use the :opt:`scrollback_pager_history_size`
option.
.. _cpbuf:
Multiple copy/paste buffers
-----------------------------
In addition to being able to copy/paste from the system clipboard, in |kitty| you
can also setup an arbitrary number of copy paste buffers. To do so, simply add
something like the following to your :file:`kitty.conf`::
map f1 copy_to_buffer a
map f2 paste_from_buffer a
This will allow you to press :kbd:`F1` to copy the current selection to an
internal buffer named ``a`` and :kbd:`F2` to paste from that buffer. The buffer
names are arbitrary strings, so you can define as many such buffers as you
need.
Marks
-------------
kitty has the ability to mark text on the screen based on regular expressions.
This can be useful to highlight words or phrases when browsing output from long
running programs or similar. To learn how this feature works, see :doc:`marks`.
Frequently Asked Questions
---------------------------------
The list of Frequently Asked Questions (*FAQ*) is :doc:`available here <faq>`.
.. _completion:
Cool integrations for kitty with other CLI tools
--------------------------------------------------
kitty provides extremely powerful interfaces such as :doc:`remote-control` and
:doc:`kittens/custom` and :doc:`kittens/icat`
that allow it to be integrated with other tools seamlessly. For a list of such
user created integrations, see: :doc:`integrations`.
Completion for kitty
---------------------------------
|kitty| comes with completion for the ``kitty`` command for popular shells.
bash
~~~~~~~~
Add the following to your :file:`~/.bashrc`
.. code-block:: sh
source <(kitty + complete setup bash)
Older versions of bash (for example, v3.2) do not support
process substitution with the source command, in which
case you can try an alternative:
.. code-block:: sh
source /dev/stdin <<<"$(kitty + complete setup bash)"
zsh
~~~~~~~~~
Add the following to your :file:`~/.zshrc`
.. code-block:: sh
autoload -Uz compinit
compinit
# Completion for kitty
kitty + complete setup zsh | source /dev/stdin
The important thing above is to make sure the call to |kitty| to load the zsh
completions happens after the call to :file:`compinit`.
fish
~~~~~~~~
For versions of fish earlier than 3.0.0, add the following to your
:file:`~/.config/fish/config.fish`. Later versions source completions by default.
.. code-block:: sh
kitty + complete setup fish | source
Changelog
------------------
See :doc:`changelog`.
*The fast, feature-rich, GPU based terminal emulator*
.. toctree::
:hidden:
:glob:
*
kittens/*
generated/rc
quickstart
overview
faq
support
performance
changelog
integrations
protocol-extensions
press-mentions
.. tab:: Fast
* Offloads rendering to the GPU for :doc:`lower system load <performance>`
* Uses threaded rendering for :iss:`absolutely minimal latency <2701#issuecomment-636497270>`
* Performance tradeoffs can be :ref:`tuned <conf-kitty-performance>`
.. tab:: Capable
* Graphics, with :doc:`images and animations <graphics-protocol>`
* Ligatures and emoji, with :opt:`per glyph font substitution <symbol_map>`
* :term:`Hyperlinks<hyperlinks>`, with :doc:`configurable actions <open_actions>`
.. tab:: Scriptable
* Control from :doc:`scripts or the shell <remote-control>`
* Extend with :ref:`kittens <kittens>` using the Python language
* Use :ref:`startup sessions <sessions>` to specify working environments
.. tab:: Composable
* Programmable tabs, :ref:`splits <splits_layout>` and multiple :doc:`layouts <layouts>` to manage windows
* Browse the :ref:`entire history <scrollback>` or the :sc:`output from the last command <show_last_command_output>`
comfortably in pagers and editors
* Edit or download :doc:`remote files <kittens/remote_file>` in an existing SSH session
.. tab:: Cross-platform
* Linux
* macOS
* Various BSDs
.. tab:: Innovative
Pioneered various extensions to move the entire terminal ecosystem forward
* :doc:`graphics-protocol`
* :doc:`keyboard-protocol`
* Lots more in :doc:`protocol-extensions`
.. only:: dirhtml
.. raw:: html
<video controls width="640" height="360" poster="_static/poster.png">
<source src="https://download.calibre-ebook.com/videos/kitty.mp4" type="video/mp4">
<source src="https://download.calibre-ebook.com/videos/kitty.webm" type="video/webm">
</video>
.. rst-class:: caption caption-text
Watch kitty in action!
To get started see :doc:`quickstart`.

View File

@@ -1,249 +0,0 @@
#!/usr/bin/env python3
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
import atexit
import json
import os
import platform
import re
import shlex
import shutil
import subprocess
import sys
import tempfile
py3 = sys.version_info[0] > 2
is64bit = platform.architecture()[0] == '64bit'
is_macos = 'darwin' in sys.platform.lower()
if is_macos:
mac_ver = tuple(map(int, platform.mac_ver()[0].split('.')))
if mac_ver[:2] < (10, 12):
raise SystemExit('Your version of macOS is too old, at least 10.12 is required')
try:
__file__
from_file = True
except NameError:
from_file = False
if py3:
unicode = str
raw_input = input
import urllib.request as urllib
def encode_for_subprocess(x):
return x
else:
from future_builtins import map
import urllib2 as urllib
def encode_for_subprocess(x):
if isinstance(x, unicode):
x = x.encode('utf-8')
return x
def run(*args):
if len(args) == 1:
args = shlex.split(args[0])
args = list(map(encode_for_subprocess, args))
ret = subprocess.Popen(args).wait()
if ret != 0:
raise SystemExit(ret)
class Reporter: # {{{
def __init__(self, fname):
self.fname = fname
self.last_percent = 0
def __call__(self, blocks, block_size, total_size):
percent = (blocks*block_size)/float(total_size)
report = '\rDownloaded {:.1%} '.format(percent)
if percent - self.last_percent > 0.05:
self.last_percent = percent
print(report, end='')
sys.stdout.flush()
# }}}
def get_latest_release_data():
print('Checking for latest release on GitHub...')
req = urllib.Request('https://api.github.com/repos/kovidgoyal/kitty/releases/latest', headers={'Accept': 'application/vnd.github.v3+json'})
try:
res = urllib.urlopen(req).read().decode('utf-8')
except Exception as err:
raise SystemExit('Failed to contact {} with error: {}'.format(req.get_full_url(), err))
data = json.loads(res)
html_url = data['html_url'].replace('/tag/', '/download/').rstrip('/')
for asset in data.get('assets', ()):
name = asset['name']
if is_macos:
if name.endswith('.dmg'):
return html_url + '/' + name, asset['size']
else:
if name.endswith('.txz'):
if is64bit:
if name.endswith('-x86_64.txz'):
return html_url + '/' + name, asset['size']
else:
if name.endswith('-i686.txz'):
return html_url + '/' + name, asset['size']
raise SystemExit('Failed to find the installer package on github')
def do_download(url, size, dest):
print('Will download and install', os.path.basename(dest))
reporter = Reporter(os.path.basename(dest))
# Get content length and check if range is supported
rq = urllib.urlopen(url)
headers = rq.info()
sent_size = int(headers['content-length'])
if sent_size != size:
raise SystemExit('Failed to download from {} Content-Length ({}) != {}'.format(url, sent_size, size))
with open(dest, 'wb') as f:
while f.tell() < size:
raw = rq.read(8192)
if not raw:
break
f.write(raw)
reporter(f.tell(), 1, size)
rq.close()
if os.path.getsize(dest) < size:
raise SystemExit('Download failed, try again later')
print('\rDownloaded {} bytes'.format(os.path.getsize(dest)))
def clean_cache(cache, fname):
for x in os.listdir(cache):
if fname not in x:
os.remove(os.path.join(cache, x))
def download_installer(url, size):
fname = url.rpartition('/')[-1]
tdir = tempfile.gettempdir()
cache = os.path.join(tdir, 'kitty-installer-cache')
if not os.path.exists(cache):
os.makedirs(cache)
clean_cache(cache, fname)
dest = os.path.join(cache, fname)
if os.path.exists(dest) and os.path.getsize(dest) == size:
print('Using previously downloaded', fname)
return dest
if os.path.exists(dest):
os.remove(dest)
do_download(url, size, dest)
return dest
def macos_install(dmg, dest='/Applications', launch=True):
mp = tempfile.mkdtemp()
atexit.register(shutil.rmtree, mp)
run('hdiutil', 'attach', dmg, '-mountpoint', mp)
try:
os.chdir(mp)
app = 'kitty.app'
d = os.path.join(dest, app)
if os.path.exists(d):
shutil.rmtree(d)
dest = os.path.join(dest, app)
run('ditto', '-v', app, dest)
print('Successfully installed kitty into', dest)
if launch:
run('open', dest)
finally:
os.chdir('/')
run('hdiutil', 'detach', mp)
def linux_install(installer, dest=os.path.expanduser('~/.local'), launch=True):
dest = os.path.join(dest, 'kitty.app')
if os.path.exists(dest):
shutil.rmtree(dest)
os.makedirs(dest)
print('Extracting tarball...')
run('tar', '-C', dest, '-xJof', installer)
print('kitty successfully installed to', dest)
kitty = os.path.join(dest, 'bin', 'kitty')
print('Use', kitty, 'to run kitty')
if launch:
run(kitty, '--detach')
def main(dest=None, launch=True, installer=None):
if not dest:
if is_macos:
dest = '/Applications'
else:
dest = os.path.expanduser('~/.local')
machine = os.uname()[4]
if machine and machine.lower().startswith('arm'):
raise SystemExit(
'You are running on an ARM system. The kitty binaries are only'
' available for x86 systems. You will have to build from'
' source.')
if not installer:
url, size = get_latest_release_data()
installer = download_installer(url, size)
else:
installer = os.path.abspath(installer)
if not os.access(installer, os.R_OK):
raise SystemExit('Could not read from: {}'.format(installer))
if is_macos:
macos_install(installer, dest=dest, launch=launch)
else:
linux_install(installer, dest=dest, launch=launch)
def script_launch():
# To test: python3 -c "import runpy; runpy.run_path('installer.py', run_name='script_launch')"
def path(x):
return os.path.expandvars(os.path.expanduser(x))
def to_bool(x):
return x.lower() in {'y', 'yes', '1', 'true'}
type_map = {x: path for x in 'dest installer'.split()}
type_map['launch'] = to_bool
kwargs = {}
for arg in sys.argv[1:]:
if arg:
m = re.match('([a-z_]+)=(.+)', arg)
if m is None:
raise SystemExit('Unrecognized command line argument: ' + arg)
k = m.group(1)
if k not in type_map:
raise SystemExit('Unrecognized command line argument: ' + arg)
kwargs[k] = type_map[k](m.group(2))
main(**kwargs)
def update_intaller_wrapper():
# To run: python3 -c "import runpy; runpy.run_path('installer.py', run_name='update_wrapper')" installer.sh
with open(__file__, 'rb') as f:
src = f.read().decode('utf-8')
wrapper = sys.argv[-1]
with open(wrapper, 'r+b') as f:
raw = f.read().decode('utf-8')
nraw = re.sub(r'^# HEREDOC_START.+^# HEREDOC_END', lambda m: '# HEREDOC_START\n{}\n# HEREDOC_END'.format(src), raw, flags=re.MULTILINE | re.DOTALL)
if 'update_intaller_wrapper()' not in nraw:
raise SystemExit('regex substitute of HEREDOC failed')
f.seek(0), f.truncate()
f.write(nraw.encode('utf-8'))
if __name__ == '__main__' and from_file:
main()
elif __name__ == 'update_wrapper':
update_intaller_wrapper()
elif __name__ == 'script_launch':
script_launch()

View File

@@ -1,30 +1,173 @@
#!/bin/sh
#
# installer.sh
# Copyright (C) 2018 Kovid Goyal <kovid at kovidgoyal.net>
#
# Distributed under terms of the GPLv3 license.
#
python=$(command -v python3)
if [ -z "$python" ]; then
python=$(command -v python2)
fi
if [ -z "$python" ]; then
python=$(command -v python2.7)
fi
if [ -z "$python" ]; then
python=$(command -v python)
fi
if [ -z "$python" ]; then
python=python
fi
{ \unalias command; \unset -f command; } >/dev/null 2>&1
tdir=''
cleanup() {
[ -n "$tdir" ] && {
command rm -rf "$tdir"
tdir=''
}
}
echo Using python executable: $python
die() {
cleanup
printf "\033[31m%s\033[m\n\r" "$*" > /dev/stderr;
exit 1;
}
$python -c "import sys; script_launch=lambda:sys.exit('Download of installer failed!'); exec(sys.stdin.read()); script_launch()" "$@" <<'INSTALLER_HEREDOC'
# {{{
# HEREDOC_START
# HEREDOC_END
# }}}
INSTALLER_HEREDOC
detect_network_tool() {
if command -v curl 2> /dev/null > /dev/null; then
fetch() {
command curl -fL "$1"
}
fetch_quiet() {
command curl -fsSL "$1"
}
elif command -v wget 2> /dev/null > /dev/null; then
fetch() {
command wget -O- "$1"
}
fetch_quiet() {
command wget --quiet -O- "$1"
}
else
die "Neither curl nor wget available, cannot download kitty"
fi
}
detect_os() {
arch=""
case "$(command uname)" in
'Darwin') OS="macos";;
'Linux')
OS="linux"
case "$(command uname -m)" in
x86_64) arch="x86_64";;
aarch64*) arch="arm64";;
armv8*) arch="arm64";;
i386) arch="i686";;
i686) arch="i686";;
*) die "Unknown CPU architecture $(command uname -m)";;
esac
;;
*) die "kitty binaries are not available for $(command uname)"
esac
}
expand_tilde() {
tilde_less="${1#\~/}"
[ "$1" != "$tilde_less" ] && tilde_less="$HOME/$tilde_less"
printf '%s' "$tilde_less"
}
parse_args() {
dest='~/.local'
[ "$OS" = "macos" ] && dest="/Applications"
launch='y'
installer=''
while :; do
case "$1" in
dest=*) dest="${1#*=}";;
launch=*) launch="${1#*=}";;
installer=*) installer="${1#*=}";;
"") break;;
*) die "Unrecognized command line option: $1";;
esac
shift
done
dest=$(expand_tilde "${dest}")
[ "$launch" != "y" -a "$launch" != "n" ] && die "Unrecognized command line option: launch=$launch"
dest="$dest/kitty.app"
}
get_file_url() {
url="https://github.com/kovidgoyal/kitty/releases/download/$1/kitty-$2"
if [ "$OS" = "macos" ]; then
url="$url.dmg"
else
url="$url-$arch.txz"
fi
}
get_release_url() {
release_version=$(fetch_quiet "https://sw.kovidgoyal.net/kitty/current-version.txt")
[ $? -ne 0 -o -z "$release_version" ] && die "Could not get kitty latest release version"
get_file_url "v$release_version" "$release_version"
}
get_nightly_url() {
get_file_url "nightly" "nightly"
}
get_download_url() {
installer_is_file="n"
case "$installer" in
"nightly") get_nightly_url ;;
"") get_release_url ;;
*) installer_is_file="y" ;;
esac
}
linux_install() {
if [ "$installer_is_file" = "y" ]; then
command tar -C "$dest" "-xJof" "$installer"
else
printf '%s\n\n' "Downloading from: $url"
fetch "$url" | command tar -C "$dest" "-xJof" "-"
fi
}
macos_install() {
tdir=$(command mktemp -d "/tmp/kitty-install-XXXXXXXXXXXX")
[ "$installer_is_file" != "y" ] && {
installer="$tdir/kitty.dmg"
printf '%s\n\n' "Downloading from: $url"
fetch "$url" > "$installer" || die "Failed to download: $url"
}
command mkdir "$tdir/mp"
command hdiutil attach "$installer" "-mountpoint" "$tdir/mp" || die "Failed to mount kitty.dmg"
command ditto -v "$tdir/mp/kitty.app" "$dest"
rc="$?"
command hdiutil detach "$tdir/mp"
command rm -rf "$tdir"
tdir=''
[ "$rc" != "0" ] && die "Failed to copy kitty.app from mounted dmg"
}
prepare_install_dest() {
printf "%s\n" "Installing to $dest"
command rm -rf "$dest"
command mkdir -p "$dest" || die "Failed to create the directory: $dest"
}
exec_kitty() {
if [ "$OS" = "macos" ]; then
exec "open" "$dest"
else
exec "$dest/bin/kitty" "--detach"
fi
die "Failed to launch kitty"
}
main() {
detect_os
parse_args "$@"
detect_network_tool
get_download_url
prepare_install_dest
if [ "$OS" = "macos" ]; then
macos_install
else
linux_install
fi
[ "$launch" = "y" ] && exec_kitty
exit 0
}
main "$@"

View File

@@ -1,9 +1,11 @@
:tocdepth: 2
Integrations with other tools
================================
kitty provides extremely powerful interfaces such as :doc:`remote-control` and
:doc:`kittens/custom` and :doc:`kittens/icat`
that allow it to be integrated with other tools seamlessly.
:doc:`kittens/custom` and :doc:`kittens/icat` that allow it to be integrated
with other tools seamlessly.
Image and document viewers
@@ -12,120 +14,257 @@ Image and document viewers
Powered by kitty's :doc:`graphics-protocol` there exist many tools for viewing
images and other types of documents directly in your terminal, even over SSH.
.. _tool_termpdf:
`termpdf.py <https://github.com/dsanson/termpdf.py>`_
a terminal PDF/DJVU/CBR viewer
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A terminal PDF/DJVU/CBR viewer
.. _tool_mdcat:
`mdcat <https://github.com/lunaryorn/mdcat>`_
Display markdown files nicely formatted with images in the terminal
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Display markdown files nicely formatted with images in the terminal
.. _tool_ranger:
`ranger <https://github.com/ranger/ranger>`_
a terminal file manager, with previews of file contents powered by kitty's graphics protocol.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A terminal file manager, with previews of file contents powered by kitty's
graphics protocol.
.. _tool_nnn:
`nnn <https://github.com/jarun/nnn/>`_
another terminal file manager, with previews of file contents powered by kitty's graphics protocol.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Another terminal file manager, with previews of file contents powered by kitty's
graphics protocol.
.. _tool_hunter:
`hunter <https://github.com/rabite0/hunter>`_
another terminal file manager, with previews of file contents powered by kitty's graphics protocol.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Another terminal file manager, with previews of file contents powered by kitty's
graphics protocol.
.. _tool_term_image:
`term-image <https://github.com/AnonymouX47/term-image>`__
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Tool to browse images in a terminal using kitty's graphics protocol.
.. _tool_koneko:
`koneko <https://github.com/twenty5151/koneko>`_
browse images from the pixiv artist community directly in kitty
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Browse images from the pixiv artist community directly in kitty.
.. _tool_viu:
`viu <https://github.com/atanunq/viu>`_
view images in the terminal, similar to kitty's icat, however also supports
displaying animated GIFs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
View images in the terminal, similar to kitty's icat.
.. _tool_nb:
`nb <https://github.com/xwmx/nb>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Command line and local web note-taking, bookmarking, archiving, and knowledge
base application that uses kitty's graphics protocol for images.
.. _tool_w3m:
`w3m <https://github.com/tats/w3m>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A text mode WWW browser that supports kitty's graphics protocol to display
images.
.. _tool_timg:
`timg <https://github.com/hzeller/timg>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A terminal image and video viewer, that displays static and animated images or
plays videos. Fast multi-threaded loading, JPEG exif rotation, grid view and
connecting to the webcam make it a versatile terminal utility.
System and data visualisation tools
---------------------------------------
.. _tool_neofetch:
`neofetch <https://github.com/dylanaraps/neofetch>`_
A command line system information tool that shows images using kitty's graphics protocol
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A command line system information tool that shows images using kitty's graphics
protocol
.. _tool_matplotlib:
`matplotlib <https://github.com/jktr/matplotlib-backend-kitty>`_
show matplotlib plots directly in kitty
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Show matplotlib plots directly in kitty
.. _tool_KittyTerminalImage:
`KittyTerminalImages.jl <https://github.com/simonschoelly/KittyTerminalImages.jl>`_
show images from Julia directly in kitty
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Show images from Julia directly in kitty
.. _tool_euporie:
`euporie <https://github.com/joouha/euporie>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A text-based user interface for running and editing Jupyter notebooks, powered
by kitty's graphics protocol for displaying plots
.. _tool_gnuplot:
`gnuplot <http://www.gnuplot.info/>`_
a graphing and data visualization tool that can be made to display its
output in kitty with the following bash snippet::
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
function iplot {
cat <<EOF | gnuplot
set terminal pngcairo enhanced font 'Fira Sans,10'
set autoscale
set samples 1000
set output '|kitty +kitten icat --stdin yes'
set object 1 rectangle from screen 0,0 to screen 1,1 fillcolor rgb"#fdf6e3" behind
plot $@
set output '/dev/null'
EOF
}
A graphing and data visualization tool that can be made to display its output in
kitty with the following bash snippet:
Add this to bashrc and then to plot a function, simply do::
.. code-block:: sh
iplot 'sin(x*3)*exp(x*.2)'
function iplot {
cat <<EOF | gnuplot
set terminal pngcairo enhanced font 'Fira Sans,10'
set autoscale
set samples 1000
set output '|kitty +kitten icat --stdin yes'
set object 1 rectangle from screen 0,0 to screen 1,1 fillcolor rgb"#fdf6e3" behind
plot $@
set output '/dev/null'
EOF
}
Add this to bashrc and then to plot a function, simply do:
.. code-block:: sh
iplot 'sin(x*3)*exp(x*.2)'
.. tool_onefetch:
`onefetch <https://github.com/o2sh/onefetch>`_
a tool to fetch information about your git repositories
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A tool to fetch information about your git repositories
`wttr <https://github.com/chubin/wttr.in>`_
a tool to display weather information in your terminal with curl
.. tool_patat:
`patat <https://github.com/jaspervdj/patat>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Terminal based presentations using pandoc and kitty's image protocol for
images
.. tool_wttr:
`wttr.in <https://github.com/chubin/wttr.in>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A tool to display weather information in your terminal with curl
.. tool_wl_clipboard:
`wl-clipboard-manager <https://github.com/maximbaz/wl-clipboard-manager>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
View and manage the system clipboard under Wayland in your kitty terminal
.. tool_dmenu_term:
`dmenu-term <https://github.com/maximbaz/dmenu-term>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Run applications on your system with fuzzy find inside a kitty window
Editor integration
-----------------------
kitty can be integrated into many different terminal editors to add features
such a split windows, previews, REPLs etc.
|kitty| can be integrated into many different terminal based text editors to add
features such a split windows, previews, REPLs etc.
.. tool_kakoune:
`kakoune <https://kakoune.org/>`_
integrates with kitty to use native kitty windows for its windows/panels and REPLs.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Integrates with kitty to use native kitty windows for its windows/panels and
REPLs.
.. tool_vim_slime:
`vim-slime <https://github.com/jpalardy/vim-slime#kitty>`_
uses kitty remote control for a Lisp REPL.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Uses kitty remote control for a Lisp REPL.
.. tool_vim_kitty_navigator:
`vim-kitty-navigator <https://github.com/knubie/vim-kitty-navigator>`_
allows you to navigate seamlessly between vim and kitty splits using a consistent set of hotkeys.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Allows you to navigate seamlessly between vim and kitty splits using a
consistent set of hotkeys.
.. tool_vim_test:
`vim-test <https://github.com/vim-test/vim-test>`_
allows easily running tests in a terminal window
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Allows easily running tests in a terminal window
.. tool_hologram:
`hologram.nvim <https://github.com/edluffy/hologram.nvim>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Terminal image viewer for Neovim
Scrollback manipulation
-------------------------
.. tool_kitty_search:
`kitty-search <https://github.com/trygveaa/kitty-kitten-search>`_
Live incremental search of the scrollback buffer.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Live incremental search of the scrollback buffer.
.. tool_kitty_grab:
`kitty-grab <https://github.com/yurikhan/kitty_grab>`_
keyboard based text selection for the kitty scrollback buffer.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Keyboard based text selection for the kitty scrollback buffer.
Miscellaneous
------------------
.. tool_kitty_smart_tab:
`kitty-smart-tab <https://github.com/yurikhan/kitty-smart-tab>`_
use keys to either control tabs or pass them onto running applications if
no tabs are present
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Use keys to either control tabs or pass them onto running applications if no
tabs are present
.. tool_kitty_smart_scroll:
`kitty-smart-scroll <https://github.com/yurikhan/kitty-smart-scroll>`_
use keys to either scroll or pass them onto running applications if
no scrollback buffer is present
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Use keys to either scroll or pass them onto running applications if no
scrollback buffer is present
`reload keybindings <https://github.com/kovidgoyal/kitty/issues/1292#issuecomment-582388769>`_
reload key bindings from :file:`kitty.conf` without needing to restart
kitty
.. tool_kitti3:
`kitti3 <https://github.com/LandingEllipse/kitti3>`_
allow using kitty as a drop-down terminal under the i3 window manager
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Allow using kitty as a drop-down terminal under the i3 window manager
.. tool_weechat_hints:
`weechat-hints <https://github.com/GermainZ/kitty-weechat-hints>`_
URL hints kitten for WeeChat that works without having to use WeeChat's
raw-mode.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
URL hints kitten for WeeChat that works without having to use WeeChat's
raw-mode.
.. tool_glkitty:
`glkitty <https://github.com/michaeljclark/glkitty>`_
C library to draw OpenGL shaders in the terminal with a glgears demo
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
C library to draw OpenGL shaders in the terminal with a glgears demo

View File

@@ -1,6 +1,15 @@
:orphan:
The kitty command line interface
====================================
.. program:: kitty
.. include:: generated/cli-kitty.rst
.. include:: basic.rst
See also
-----------
See kitty.conf(5)

View File

@@ -1,128 +0,0 @@
Key encoding for extended keyboard protocol
===============================================
See :ref:`extended-key-protocol` for more information and `this table in JSON
format <https://github.com/kovidgoyal/kitty/blob/master/key_encoding.json>`_.
===================== ======================
Name Encoded representation
0 ``G``
1 ``H``
2 ``I``
3 ``J``
4 ``K``
5 ``L``
6 ``M``
7 ``N``
8 ``O``
9 ``P``
A ``S``
APOSTROPHE ``B``
B ``T``
BACKSLASH ``t``
BACKSPACE ``1``
C ``U``
CAPS LOCK ``:``
COMMA ``C``
D ``V``
DELETE ``3``
DOWN ``6``
E ``W``
END ``-``
ENTER ``z``
EQUAL ``R``
ESCAPE ``y``
F ``X``
F1 ``/``
F10 ``]``
F11 ``{``
F12 ``}``
F13 ``@``
F14 ``%``
F15 ``$``
F16 ``#``
F17 ``BA``
F18 ``BB``
F19 ``BC``
F2 ``*``
F20 ``BD``
F21 ``BE``
F22 ``BF``
F23 ``BG``
F24 ``BH``
F25 ``BI``
F3 ``?``
F4 ``&``
F5 ``<``
F6 ``>``
F7 ``(``
F8 ``)``
F9 ``[``
G ``Y``
GRAVE ACCENT ``v``
H ``Z``
HOME ``.``
I ``a``
INSERT ``2``
J ``b``
K ``c``
KP 0 ``BJ``
KP 1 ``BK``
KP 2 ``BL``
KP 3 ``BM``
KP 4 ``BN``
KP 5 ``BO``
KP 6 ``BP``
KP 7 ``BQ``
KP 8 ``BR``
KP 9 ``BS``
KP ADD ``BX``
KP DECIMAL ``BT``
KP DIVIDE ``BU``
KP ENTER ``BY``
KP EQUAL ``BZ``
KP MULTIPLY ``BV``
KP SUBTRACT ``BW``
L ``d``
LEFT ``5``
LEFT ALT ``Bc``
LEFT BRACKET ``s``
LEFT CONTROL ``Bb``
LEFT SHIFT ``Ba``
LEFT SUPER ``Bd``
M ``e``
MINUS ``D``
N ``f``
NUM LOCK ``=``
O ``g``
P ``h``
PAGE DOWN ``9``
PAGE UP ``8``
PAUSE ``!``
PERIOD ``E``
PRINT SCREEN ``^``
Q ``i``
R ``j``
RIGHT ``4``
RIGHT ALT ``Bg``
RIGHT BRACKET ``u``
RIGHT CONTROL ``Bf``
RIGHT SHIFT ``Be``
RIGHT SUPER ``Bh``
S ``k``
SCROLL LOCK ``+``
SEMICOLON ``Q``
SLASH ``F``
SPACE ``A``
T ``l``
TAB ``0``
U ``m``
UP ``7``
V ``n``
W ``o``
WORLD 1 ``w``
WORLD 2 ``x``
X ``p``
Y ``q``
Z ``r``
===================== ======================

677
docs/keyboard-protocol.rst Normal file
View File

@@ -0,0 +1,677 @@
Comprehensive keyboard handling in terminals
==============================================
There are various problems with the current state of keyboard handling in
terminals. They include:
* No way to use modifiers other than ``ctrl`` and ``alt``
* No way to reliably use multiple modifier keys, other than, ``shift+alt`` and
``ctrl+alt``.
* Many of the existing escape codes used to encode these events are ambiguous
with different key presses mapping to the same escape code.
* No way to handle different types of keyboard events, such as press, release or repeat
* No reliable way to distinguish single ``Esc`` key presses from the start of a
escape sequence. Currently, client programs use fragile timing related hacks
for this, leading to bugs, for example:
`neovim #2035 <https://github.com/neovim/neovim/issues/2035>`_.
To solve these issues and others, kitty has created a new keyboard protocol,
that is backward compatible but allows applications to opt-in to support more
advanced usages. The protocol is based on initial work in `fixterms
<http://www.leonerd.org.uk/hacks/fixterms/>`_, however, it corrects various
issues in that proposal, listed at the :ref:`bottom of this document
<fixterms_bugs>`. For public discussion of this spec, see :iss:`3248`.
You can see this protocol with all enhancements in action by running::
kitty +kitten show_key -m kitty
inside the kitty terminal to report key events.
In addition to kitty, this protocol is also implemented in:
* The `foot terminal <https://codeberg.org/dnkl/foot/issues/319>`__
* The `WezTerm terminal <https://wezfurlong.org/wezterm/config/lua/config/enable_kitty_keyboard.html>`__
* The `notcurses library
<https://github.com/dankamongmen/notcurses/issues/2131>`__
* The `crossterm library
<https://github.com/crossterm-rs/crossterm/pull/688>`__
* The `neovim text editor <https://github.com/neovim/neovim/pull/18181>`__
* The `kakoune text editor <https://github.com/mawww/kakoune/issues/4103>`__
* The `dte text editor <https://gitlab.com/craigbarnes/dte/-/issues/138>`__
.. versionadded:: 0.20.0
Quickstart
---------------
If you are an application or library developer just interested in using this
protocol to make keyboard handling simpler and more robust in your application,
without too many changes, do the following:
#. Emit the escape code ``CSI > 1 u`` at application startup if using the main
screen or when entering alternate screen mode, if using the alternate
screen.
#. All key events will now be sent in only a few forms to your application,
that are easy to parse unambiguously.
#. Emit the escape sequence ``CSI < u`` at application exit if using the main
screen or just before leaving alternate screen mode if using the alternate screen,
to restore the previously used keyboard mode.
Key events will all be delivered to your application either as plain UTF-8
text, or using the following escape codes, for those keys that do not produce
text (``CSI`` is the bytes ``0x1b 0x5b``)::
CSI number ; modifiers [u~]
CSI 1; modifiers [ABCDEFHPQRS]
0x0d - for the Enter key
0x7f or 0x08 - for Backspace
0x09 - for Tab
The ``number`` in the first form above will be either the Unicode codepoint for a
key, such as ``97`` for the :kbd:`a` key, or one of the numbers from the
:ref:`functional` table below. The ``modifiers`` optional parameter encodes any
modifiers pressed for the key event. The encoding is described in the
:ref:`modifiers` section.
The second form is used for a few functional keys, such as the :kbd:`Home`,
:kbd:`End`, :kbd:`Arrow` keys and :kbd:`F1` ... :kbd:`F4`, they are enumerated in
the :ref:`functional` table below. Note that if no modifiers are present the
parameters are omitted entirely giving an escape code of the form ``CSI
[ABCDEFHPQRS]``.
If you want support for more advanced features such as repeat and release
events, alternate keys for shortcut matching et cetera, these can be turned on
using :ref:`progressive_enhancement` as documented in the rest of this
specification.
An overview
------------------
Key events are divided into two types, those that produce text and those that
do not. When a key event produces text, the text is sent directly as UTF-8
encoded bytes. This is safe as UTF-8 contains no C0 control codes.
When the key event does not have text, the key event is encoded as an escape code. In
legacy compatibility mode (the default) this uses legacy escape codes, so old terminal
applications continue to work. Key events that could not be represented in
legacy mode are encoded using a ``CSI u`` escape code, that most terminal
programs should just ignore. For more advanced features, such as release/repeat
reporting etc., applications can tell the terminal they want this information by
sending an escape code to :ref:`progressively enhance <progressive_enhancement>` the data reported for
key events.
The central escape code used to encode key events is::
CSI unicode-key-code:alternate-key-codes ; modifiers:event-type ; text-as-codepoints u
Spaces in the above definition are present for clarity and should be ignored.
``CSI`` is the bytes ``0x1b 0x5b``. All parameters are decimal numbers. Fields
are separated by the semi-colon and sub-fields by the colon. Only the
``unicode-key-code`` field is mandatory, everything else is optional. The
escape code is terminated by the ``u`` character (the byte ``0x75``).
.. _key_codes:
Key codes
~~~~~~~~~~~~~~
The ``unicode-key-code`` above is the Unicode codepoint representing the key, as a
decimal number. For example, the :kbd:`A` key is represented as ``97`` which is
the unicode code for lowercase ``a``. Note that the codepoint used is *always*
the lower-case (or more technically, un-shifted) version of the key. If the
user presses, for example, :kbd:`ctrl+shift+a` the escape code would be ``CSI
97;modifiers u``. It *must not* be ``CSI 65; modifiers u``.
If *alternate key reporting* is requested by the program running in the
terminal, the terminal can send two additional Unicode codepoints, the
*shifted key* and *base layout key*, separated by colons.
The shifted key is simply the upper-case version of ``unicode-codepoint``, or
more technically, the shifted version. So `a` becomes `A` and so on, based on
the current keyboard layout. This is needed to be able to match against a
shortcut such as :kbd:`ctrl+plus` which depending on the type of keyboard could
be either :kbd:`ctrl+shift+equal` or :kbd:`ctrl+plus`. Note that the shifted
key must be present only if shift is also present in the modifiers.
The *base layout key* is the key corresponding to the physical key in the
standard PC-101 key layout. So for example, if the user is using a Cyrillic
keyboard with a Cyrillic keyboard layout pressing the :kbd:`ctrl+С` key will
be :kbd:`ctrl+c` in the standard layout. So the terminal should send the *base
layout key* as ``99`` corresponding to the ``c`` key.
If only one alternate key is present, it is the *shifted key* if the terminal
wants to send only a base layout key but no shifted key, it must use an empty
sub-field for the shifted key, like this::
CSI unicode-key-code::base-layout-key
.. _modifiers:
Modifiers
~~~~~~~~~~~~~~
This protocol supports six modifier keys, :kbd:`shift`, :kbd:`alt`,
:kbd:`ctrl`, :kbd:`super`, :kbd:`hyper`, :kbd:`meta`, :kbd:`num_lock` and
:kbd:`caps_lock`. Here :kbd:`super` is either the *Windows/Linux* key or the
:kbd:`command` key on mac keyboards. The :kbd:`alt` key is the :kbd:`option`
key on mac keyboards. :kbd:`hyper` and :kbd:`meta` are typically present only
on X11/Wayland based systems with special XKB rules. Modifiers are encoded as a
bit field with::
shift 0b1 (1)
alt 0b10 (2)
ctrl 0b100 (4)
super 0b1000 (8)
hyper 0b10000 (16)
meta 0b100000 (32)
caps_lock 0b1000000 (64)
num_lock 0b10000000 (128)
In the escape code, the modifier value is encoded as a decimal number which is
``1 + actual modifiers``. So to represent :kbd:`shift` only, the value would be ``1 +
1 = 2``, to represent :kbd:`ctrl+shift` the value would be ``1 + 0b101 = 6``
and so on. If the modifier field is not present in the escape code, its default
value is ``1`` which means no modifiers.
.. _event_types:
Event types
~~~~~~~~~~~~~~~~
There are three key event types: ``press, repeat and release``. They are
reported (if requested ``0b10``) as a sub-field of the modifiers field
(separated by a colon). If no modifiers are present, the modifiers field must
have the value ``1`` and the event type sub-field the type of event. The
``press`` event type has value ``1`` and is the default if no event type sub
field is present. The ``repeat`` type is ``2`` and the ``release`` type is
``3``. So for example::
CSI key-code # this is a press event
CSI key-code;modifier # this is a press event
CSI key-code;modifier:1 # this is a press event
CSI key-code;modifier:2 # this is a repeat event
CSI key-code;modifier:3 # this is a release event
.. note:: Key events that result in text are reported as plain UTF-8 text, so
events are not supported for them, unless the application requests *key
report mode*, see below.
.. _text_as_codepoints:
Text as code points
~~~~~~~~~~~~~~~~~~~~~
The terminal can optionally send the text associated with key events as a
sequence of Unicode code points. This behavior is opt-in by the :ref:`progressive
enhancement <progressive_enhancement>` mechanism described below. Some examples::
shift+a -> CSI 97 ; 2 ; 65 u # The text 'A' is reported as 65
option+a -> CSI 97 ; ; 229 u # The text 'å' is reported as 229
If multiple code points are present, they must be separated by colons.
If no known key is associated with the text the key number ``0`` must be used.
Non-Unicode keys
~~~~~~~~~~~~~~~~~~~~~~~
There are many keys that don't correspond to letters from human languages, and
thus aren't represented in Unicode. Think of functional keys, such as
:kbd:`Escape`, :kbd:`Play`, :kbd:`Pause`, :kbd:`F1`, :kbd:`Home`, etc. These
are encoded using Unicode code points from the Private Use Area (``57344 -
63743``). The mapping of key names to code points for these keys is in the
:ref:`Functional key definition table below <functional>`.
.. _progressive_enhancement:
Progressive enhancement
--------------------------
While, in theory, every key event could be completely represented by this
protocol and all would be hunk-dory, in reality there is a vast universe of
existing terminal programs that expect legacy control codes for key events and
that are not likely to ever be updated. To support these, in default mode,
the terminal will emit legacy escape codes for compatibility. If a terminal
program wants more robust key handling, it can request it from the terminal,
via the mechanism described here. Each enhancement is described in detail
below. The escape code for requesting enhancements is::
CSI = flags ; mode u
Here ``flags`` is a decimal encoded integer to specify a set of bit-flags. The
meanings of the flags are given below. The second, ``mode`` parameter is
optional (defaulting to ``1``) and specifies how the flags are applied.
The value ``1`` means all set bits are set and all unset bits are reset.
The value ``2`` means all set bits are set, unset bits are left unchanged.
The value ``3`` means all set bits are reset, unset bits are left unchanged.
.. csv-table:: The progressive enhancement flags
:header: "Bit", "Meaning"
"0b1 (1)", ":ref:`disambiguate`"
"0b10 (2)", ":ref:`report_events`"
"0b100 (4)", ":ref:`report_alternates`"
"0b1000 (8)", ":ref:`report_all_keys`"
"0b10000 (16)", ":ref:`report_text`"
The program running in the terminal can query the terminal for the
current values of the flags by sending::
CSI ? u
The terminal will reply with::
CSI ? flags u
The program can also push/pop the current flags onto a stack in the
terminal with::
CSI > flags u # for push, if flags ommitted default to zero
CSI < number u # to pop number entries, defaulting to 1 if unspecified
Terminals should limit the size of the stack as appropriate, to prevent
Denial-of-Service attacks. Terminals must maintain separate stacks for the main
and alternate screens. If a pop request is received that empties the stack,
all flags are reset. If a push request is received and the stack is full, the
oldest entry from the stack must be evicted.
.. note:: The main and alternate screens in the terminal emulator must maintain
their own, independent, keyboard mode stacks. This is so that a program that
uses the alternate screen such as an editor, can change the keyboard mode
in the alternate screen only, without affecting the mode in the main screen
or even knowing what that mode is. Without this, and if no stack is
implemented for keyboard modes (such as in some legacy terminal emulators)
the editor would have to somehow know what the keyboard mode of the main
screen is and restore to that mode on exit.
.. _disambiguate:
Disambiguate escape codes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This type of progressive enhancement (``0b1``) fixes the problem of some legacy key press
encodings overlapping with other control codes. For instance, pressing the
:kbd:`Esc` key generates the byte ``0x1b`` which also is used to indicate the
start of an escape code. Similarly pressing the key :kbd:`alt+[` will generate
the bytes used for CSI control codes.
Turning on this flag will cause the terminal to report the :kbd:`Esc`, :kbd:`alt+key`,
:kbd:`ctrl+key`, :kbd:`ctrl+alt+key`, :kbd:`shift+alt+key` keys using ``CSI u`` sequences instead
of legacy ones. Here key is any ASCII key as described in :ref:`legacy_text`.
Additionally, all keypad keys will be reported as separate keys with ``CSI u``
encoding, using dedicated numbers from the :ref:`table below <functional>`.
With this flag turned on, all key events that do not generate text are
represented in one of the following two forms::
CSI number; modifier u
CSI 1; modifier [~ABCDEFHPQRS]
This makes it very easy to parse key events in an application. In particular,
:kbd:`ctrl+c` will no longer generate the ``SIGINT`` signal, but instead be
delivered as a ``CSI u`` escape code. This has the nice side effect of making it
much easier to integrate into the application event loop. The only exceptions
are the :kbd:`Enter`, :kbd:`Tab` and :kbd:`Backspace` keys which still generate the same
bytes as in legacy mode this is to allow the user to type and execute commands
in the shell such as ``reset`` after a program that sets this mode crashes
without clearing it.
.. _report_events:
Report event types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This progressive enhancement (``0b10``) causes the terminal to report key repeat
and key release events. Normally only key press events are reported and key
repeat events are treated as key press events. See :ref:`event_types` for
details on how these are reported.
.. _report_alternates:
Report alternate keys
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This progressive enhancement (``0b100``) causes the terminal to report
alternate key values in addition to the main value, to aid in shortcut
matching. See :ref:`key_codes` for details on how these are reported.
.. _report_all_keys:
Report all keys as escape codes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Key events that generate text, such as plain key presses without modifiers,
result in just the text being sent, in the legacy protocol. There is no way to
be notified of key repeat/release events. These types of events are needed for
some applications, such as games (think of movement using the ``WASD`` keys).
This progressive enhancement (``0b1000``) turns on key reporting even for key
events that generate text. When it is enabled, text will not be sent, instead
only key events are sent. If the text is needed as well, combine with the
Report associated text enhancement below.
Additionally, with this mode, events for pressing modifier keys are reported.
Note that *all* keys are reported as escape codes, including :kbd:`Enter`,
:kbd:`Tab`, :kbd:`Backspace` etc.
.. _report_text:
Report associated text
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This progressive enhancement (``0b10000``) causes key events that generate text
to be reported as ``CSI u`` escape codes with the text embedded in the escape
code. See :ref:`text_as_codepoints` above for details on the mechanism.
.. _detection:
Detection of support for this protocol
------------------------------------------
An application can query the terminal for support of this protocol by sending
the escape code querying for the :ref:`current progressive enhancement
<progressive_enhancement>` status
followed by request for the `primary device attributes
<https://vt100.net/docs/vt510-rm/DA1.html>`__. If an answer for the device
attributes is received without getting back an answer for the progressive
enhancement the terminal does not support this protocol.
Legacy key event encoding
--------------------------------
In the default mode, the terminal uses a legacy encoding for key events. In
this encoding, only key press and repeat events are sent and there is no
way to distinguish between them. Text is sent directly as UTF-8 bytes.
Any key events not described in this section are sent using the standard
``CSI u`` encoding. This includes keys that are not encodable in the legacy
encoding, thereby increasing the space of usable key combinations even without
progressive enhancement.
Legacy functional keys
~~~~~~~~~~~~~~~~~~~~~~~~
These keys are encoded using three schemes::
CSI number ; modifier ~
CSI 1 ; modifier {ABCDEFHPQRS}
SS3 {ABCDEFHPQRS}
In the above, if there are no modifiers, the modifier parameter is omitted.
The modifier value is encoded as described in the :ref:`modifiers` section,
above. When the second form is used, the number is always ``1`` and must be
omitted if the modifiers field is also absent. The third form becomes the
second form when modifiers are present (``SS3 is the bytes 0x1b 0x4f``).
These sequences must match entries in the terminfo database for maximum
compatibility. The table below lists the key, its terminfo entry name and
the escape code used for it by kitty. A different terminal would use whatever
escape code is present in its terminfo database for the key.
Some keys have an alternate representation when the terminal is in *cursor key
mode* (the ``smkx/rmkx`` terminfo capabilities). This form is used only in
*cursor key mode* and only when no modifiers are present.
.. csv-table:: Legacy functional encoding
:header: "Name", "Terminfo name", "Escape code"
"INSERT", "kich1", "CSI 2 ~"
"DELETE", "kdch1", "CSI 3 ~"
"PAGE_UP", "kpp", "CSI 5 ~"
"PAGE_DOWN", "knp", "CSI 6 ~"
"UP", "cuu1,kcuu1", "CSI A, SS3 A"
"DOWN", "cud1,kcud1", "CSI B, SS3 B"
"RIGHT", "cuf1,kcuf1", "CSI C, SS3 C"
"LEFT", "cub1,kcub1", "CSI D, SS3 D"
"HOME", "home,khome", "CSI H, SS3 H"
"END", "-,kend", "CSI F, SS3 F"
"F1", "kf1", "SS3 P"
"F2", "kf2", "SS3 Q"
"F3", "kf3", "SS3 R"
"F4", "kf4", "SS3 S"
"F5", "kf5", "CSI 15 ~"
"F6", "kf6", "CSI 17 ~"
"F7", "kf7", "CSI 18 ~"
"F8", "kf8", "CSI 19 ~"
"F9", "kf9", "CSI 20 ~"
"F10", "kf10", "CSI 21 ~"
"F11", "kf11", "CSI 23 ~"
"F12", "kf12", "CSI 24 ~"
"MENU", "kf16", "CSI 29 ~"
There are a few more functional keys that have special cased legacy encodings.
These are present because they are commonly used and for the sake of legacy
terminal applications that get confused when seeing CSI u escape codes:
.. csv-table:: C0 controls
:header: "Key", "No mods", "Ctrl", "Alt", "Shift", "Ctrl + Shift", "Alt + Shift", "Ctrl + Alt"
"Enter", "0xd", "0xd", "0x1b 0xd", "0xd", "0xd", "0x1b 0xd", "0x1b 0xd"
"Escape", "0x1b", "0x1b", "0x1b 0x1b", "0x1b", "0x1b", "0x1b 0x1b", "0x1b 0x1b"
"Backspace", "0x7f", "0x8", "0x1b 0x7f", "0x7f", "0x8", "0x1b 0x7f", "0x1b 0x8"
"Tab", "0x9", "0x9", "0x1b 0x9", "CSI Z", "CSI Z", "0x1b CSI Z", "0x1b 0x9"
"Space", "0x20", "0x0", "0x1b 0x20", "0x20", "0x0", "0x1b 0x20", "0x1b 0x0"
Note that :kbd:`Backspace` and :kbd:`ctrl+Backspace` are swapped in some
terminals, this can be detected using the ``kbs`` terminfo property that
must correspond to the :kbd:`Backspace` key.
All keypad keys are reported as their equivalent non-keypad keys. To
distinguish these, use the :ref:`disambiguate <disambiguate>` flag.
.. _legacy_text:
Legacy text keys
~~~~~~~~~~~~~~~~~~~
For legacy compatibility, the keys :kbd:`a`-:kbd:`z` :kbd:`0`-:kbd:`9`
:kbd:`\`` :kbd:`-` :kbd:`=` :kbd:`[` :kbd:`]` :kbd:`\\` :kbd:`;` :kbd:`'`
:kbd:`,` :kbd:`.` :kbd:`/` with the modifiers :kbd:`shift`, :kbd:`alt`,
:kbd:`ctrl`, :kbd:`shift+alt`, :kbd:`ctrl+alt` are output using the following
algorithm:
#. If the :kbd:`alt` key is pressed output the byte for ``ESC (0x1b)``
#. If the :kbd:`ctrl` modifier is pressed map the key using the table
in :ref:`ctrl_mapping`.
#. Otherwise, if the :kbd:`shift` modifier is pressed, output the shifted key,
for example, ``A`` for ``a`` and ``$`` for ``4``.
#. Otherwise, output the key unmodified
Additionally, :kbd:`ctrl+space` is output as the NULL byte ``(0x0)``.
Any other combination of modifiers with these keys is output as the appropriate
``CSI u`` escape code.
.. csv-table:: Example encodings
:header: "Key", "Plain", "shift", "alt", "ctrl", "shift+alt", "alt+ctrl", "ctrl+shift"
"i", "i (105)", "I (73)", "ESC i", ") (41)", "ESC I", "ESC )", "CSI 105; 6 u"
"3", "3 (51)", "# (35)", "ESC 3", "3 (51)", "ESC #", "ESC 3", "CSI 51; 6 u"
";", "; (59)", ": (58)", "ESC ;", "; (59)", "ESC :", "ESC ;", "CSI 59; 6 u"
.. note::
Many of the legacy escape codes are ambiguous with multiple different key
presses yielding the same escape code(s), for example, :kbd:`ctrl+i` is the
same as :kbd:`tab`, :kbd:`ctrl+m` is the same as :kbd:`Enter`, :kbd:`ctrl+r`
is the same :kbd:`ctrl+shift+r`, etc. To resolve these use the
:ref:`disambiguate progressive enhancement <disambiguate>`.
.. _functional:
Functional key definitions
----------------------------
All numbers are in the Unicode Private Use Area (``57344 - 63743``) except
for a handful of keys that use numbers under 32 and 127 (C0 control codes) for legacy
compatibility reasons.
.. {{{
.. start functional key table (auto generated by gen-key-constants.py do not edit)
.. csv-table:: Functional key codes
:header: "Name", "CSI", "Name", "CSI"
"ESCAPE", "``27 u``", "ENTER", "``13 u``"
"TAB", "``9 u``", "BACKSPACE", "``127 u``"
"INSERT", "``2 ~``", "DELETE", "``3 ~``"
"LEFT", "``1 D``", "RIGHT", "``1 C``"
"UP", "``1 A``", "DOWN", "``1 B``"
"PAGE_UP", "``5 ~``", "PAGE_DOWN", "``6 ~``"
"HOME", "``1 H or 7 ~``", "END", "``1 F or 8 ~``"
"CAPS_LOCK", "``57358 u``", "SCROLL_LOCK", "``57359 u``"
"NUM_LOCK", "``57360 u``", "PRINT_SCREEN", "``57361 u``"
"PAUSE", "``57362 u``", "MENU", "``57363 u``"
"F1", "``1 P or 11 ~``", "F2", "``1 Q or 12 ~``"
"F3", "``1 R or 13 ~``", "F4", "``1 S or 14 ~``"
"F5", "``15 ~``", "F6", "``17 ~``"
"F7", "``18 ~``", "F8", "``19 ~``"
"F9", "``20 ~``", "F10", "``21 ~``"
"F11", "``23 ~``", "F12", "``24 ~``"
"F13", "``57376 u``", "F14", "``57377 u``"
"F15", "``57378 u``", "F16", "``57379 u``"
"F17", "``57380 u``", "F18", "``57381 u``"
"F19", "``57382 u``", "F20", "``57383 u``"
"F21", "``57384 u``", "F22", "``57385 u``"
"F23", "``57386 u``", "F24", "``57387 u``"
"F25", "``57388 u``", "F26", "``57389 u``"
"F27", "``57390 u``", "F28", "``57391 u``"
"F29", "``57392 u``", "F30", "``57393 u``"
"F31", "``57394 u``", "F32", "``57395 u``"
"F33", "``57396 u``", "F34", "``57397 u``"
"F35", "``57398 u``", "KP_0", "``57399 u``"
"KP_1", "``57400 u``", "KP_2", "``57401 u``"
"KP_3", "``57402 u``", "KP_4", "``57403 u``"
"KP_5", "``57404 u``", "KP_6", "``57405 u``"
"KP_7", "``57406 u``", "KP_8", "``57407 u``"
"KP_9", "``57408 u``", "KP_DECIMAL", "``57409 u``"
"KP_DIVIDE", "``57410 u``", "KP_MULTIPLY", "``57411 u``"
"KP_SUBTRACT", "``57412 u``", "KP_ADD", "``57413 u``"
"KP_ENTER", "``57414 u``", "KP_EQUAL", "``57415 u``"
"KP_SEPARATOR", "``57416 u``", "KP_LEFT", "``57417 u``"
"KP_RIGHT", "``57418 u``", "KP_UP", "``57419 u``"
"KP_DOWN", "``57420 u``", "KP_PAGE_UP", "``57421 u``"
"KP_PAGE_DOWN", "``57422 u``", "KP_HOME", "``57423 u``"
"KP_END", "``57424 u``", "KP_INSERT", "``57425 u``"
"KP_DELETE", "``57426 u``", "KP_BEGIN", "``1 E or 57427 ~``"
"MEDIA_PLAY", "``57428 u``", "MEDIA_PAUSE", "``57429 u``"
"MEDIA_PLAY_PAUSE", "``57430 u``", "MEDIA_REVERSE", "``57431 u``"
"MEDIA_STOP", "``57432 u``", "MEDIA_FAST_FORWARD", "``57433 u``"
"MEDIA_REWIND", "``57434 u``", "MEDIA_TRACK_NEXT", "``57435 u``"
"MEDIA_TRACK_PREVIOUS", "``57436 u``", "MEDIA_RECORD", "``57437 u``"
"LOWER_VOLUME", "``57438 u``", "RAISE_VOLUME", "``57439 u``"
"MUTE_VOLUME", "``57440 u``", "LEFT_SHIFT", "``57441 u``"
"LEFT_CONTROL", "``57442 u``", "LEFT_ALT", "``57443 u``"
"LEFT_SUPER", "``57444 u``", "LEFT_HYPER", "``57445 u``"
"LEFT_META", "``57446 u``", "RIGHT_SHIFT", "``57447 u``"
"RIGHT_CONTROL", "``57448 u``", "RIGHT_ALT", "``57449 u``"
"RIGHT_SUPER", "``57450 u``", "RIGHT_HYPER", "``57451 u``"
"RIGHT_META", "``57452 u``", "ISO_LEVEL3_SHIFT", "``57453 u``"
"ISO_LEVEL5_SHIFT", "``57454 u``"
.. end functional key table
.. }}}
Note that the escape codes above of the form ``CSI 1 letter`` will omit the
``1`` if there are no modifiers, since ``1`` is the default value.
.. _ctrl_mapping:
Legacy :kbd:`ctrl` mapping of ASCII keys
------------------------------------------
When the :kbd:`ctrl` key and another key are pressed on the keyboard, terminals
map the result *for some keys* to a *C0 control code* i.e. an value from ``0 -
31``. This mapping was historically dependent on the layout of hardware
terminal keyboards and is not specified anywhere, completely. The best known
reference is `Table 3-5 in the VT-100 docs <https://vt100.net/docs/vt100-ug/chapter3.html>`_.
The table below provides a mapping that is a commonly used superset of the table above.
Any ASCII keys not in the table must be left untouched by :kbd:`ctrl`.
.. {{{
.. start ctrl mapping (auto generated by gen-key-constants.py do not edit)
.. csv-table:: Emitted bytes when :kbd:`ctrl` is held down and a key is pressed
:header: "Key", "Byte", "Key", "Byte", "Key", "Byte"
"SPC ", "0", "/", "31", "0", "48"
"1", "49", "2", "0", "3", "27"
"4", "28", "5", "29", "6", "30"
"7", "31", "8", "127", "9", "57"
"?", "127", "@", "0", "[", "27"
"\\", "28", "]", "29", "^", "30"
"_", "31", "a", "1", "b", "2"
"c", "3", "d", "4", "e", "5"
"f", "6", "g", "7", "h", "8"
"i", "9", "j", "10", "k", "11"
"l", "12", "m", "13", "n", "14"
"o", "15", "p", "16", "q", "17"
"r", "18", "s", "19", "t", "20"
"u", "21", "v", "22", "w", "23"
"x", "24", "y", "25", "z", "26"
"~", "30"
.. end ctrl mapping
.. }}}
.. _fixterms_bugs:
Bugs in fixterms
-------------------
The following is a list of errata in the `original fixterms proposal
<http://www.leonerd.org.uk/hacks/fixterms/>`_, corrected in this
specification.
* No way to disambiguate :kbd:`Esc` key presses, other than using 8-bit controls
which are undesirable for other reasons
* Incorrectly claims special keys are sometimes encoded using ``CSI letter`` encodings when it
is actually ``SS3 letter`` in all terminals newer than a VT-52, which is
pretty much everything.
* :kbd:`ctrl+shift+tab` should be ``CSI 9 ; 6 u`` not ``CSI 1 ; 5 Z``
(shift+tab is not a separate key from tab)
* No support for the :kbd:`super` modifier.
* Makes no mention of cursor key mode and how it changes encodings
* Incorrectly encoding shifted keys when shift modifier is used, for instance,
for :kbd:`ctrl+shift+i` is encoded as :kbd:`ctrl+I`.
* No way to have non-conflicting escape codes for :kbd:`alt+letter`,
:kbd:`ctrl+letter`, :kbd:`ctrl+alt+letter` key presses
* No way to specify both shifted and unshifted keys for robust shortcut
matching (think matching :kbd:`ctrl+shift+equal` and :kbd:`ctrl+plus`)
* No way to specify alternate layout key. This is useful for keyboard layouts
such as Cyrillic where you want the shortcut :kbd:`ctrl+c` to work when
pressing the :kbd:`ctrl+С` on the keyboard.
* No way to report repeat and release key events, only key press events
* No way to report key events for presses that generate text, useful for
gaming. Think of using the :kbd:`WASD` keys to control movement.
* Only a small subset of all possible functional keys are assigned numbers.
* Claims the ``CSI u`` escape code has no fixed meaning, but has been used for
decades as ``SCORC`` for instance by xterm and ansi.sys and `DECSMBV
<https://vt100.net/docs/vt510-rm/DECSMBV.html>`_ by the VT-510 hardware
terminal. This doesn't really matter since these uses are for communication
to the terminal not from the terminal.
* Handwaves that :kbd:`ctrl` *tends to* mask with ``0x1f``. In actual fact it
does this only for some keys. The action of :kbd:`ctrl` is not specified and
varies between terminals, historically because of different keyboard layouts.

View File

@@ -1,23 +1,25 @@
broadcast - type text in all kitty windows
broadcast
==================================================
The ``broadcast`` kitten can be used to type text simultaneously in
all kitty windows (or a subset as desired).
*Type text in all kitty windows simultaneously*
The ``broadcast`` kitten can be used to type text simultaneously in all
:term:`kitty windows <window>` (or a subset as desired).
To use it, simply create a mapping in :file:`kitty.conf` such as::
map F1 launch --allow-remote-control kitty +kitten broadcast
map f1 launch --allow-remote-control kitty +kitten broadcast
Then press the :kbd:`F1` key and whatever you type in the newly created widow
Then press the :kbd:`F1` key and whatever you type in the newly created window
will be sent to all kitty windows.
You can use the options described below to control which windows
are selected.
You can use the options described below to control which windows are selected.
For example, only broadcast to other windows in the current tab::
map f1 launch --allow-remote-control kitty +kitten broadcast --match-tab state:focused
.. program:: kitty +kitten broadcast
Command Line Interface
--------------------------
.. include:: /generated/cli-kitten-broadcast.rst

View File

@@ -1,6 +1,8 @@
clipboard - copy/paste to the system clipboard
clipboard
==================================================
*Copy/paste to the system clipboard from shell scripts*
.. highlight:: sh
@@ -21,7 +23,4 @@ use::
.. program:: kitty +kitten clipboard
Command Line Interface
--------------------------
.. include:: /generated/cli-kitten-clipboard.rst

View File

@@ -1,21 +1,20 @@
Custom kittens
=================
You can easily create your own kittens to extend kitty. They are just
terminal programs written in Python. When launching a kitten, kitty will
open an overlay window over the current window and optionally pass the
contents of the current window/scrollback to the kitten over its :file:`STDIN`.
The kitten can then perform whatever actions it likes, just as a normal
terminal program. After execution of the kitten is complete, it has access
to the running kitty instance so it can perform arbitrary actions
such as closing windows, pasting text, etc.
You can easily create your own kittens to extend kitty. They are just terminal
programs written in Python. When launching a kitten, kitty will open an overlay
window over the current window and optionally pass the contents of the current
window/scrollback to the kitten over its :file:`STDIN`. The kitten can then
perform whatever actions it likes, just as a normal terminal program. After
execution of the kitten is complete, it has access to the running kitty instance
so it can perform arbitrary actions such as closing windows, pasting text, etc.
Let's see a simple example of creating a kitten. It will ask the user for some
input and paste it into the terminal window.
Create a file in the kitty config folder, :file:`~/.config/kitty/mykitten.py`
(you might need to adjust the path to wherever the kitty config folder is on
your machine).
Create a file in the kitty config directory, :file:`~/.config/kitty/mykitten.py`
(you might need to adjust the path to wherever the :ref:`kitty config directory
<confloc>` is on your machine).
.. code-block:: python
@@ -35,7 +34,7 @@ your machine).
# get the kitty window into which to paste answer
w = boss.window_id_map.get(target_window_id)
if w is not None:
w.paste(answer)
w.paste_text(answer)
Now in :file:`kitty.conf` add the lines::
@@ -43,11 +42,30 @@ Now in :file:`kitty.conf` add the lines::
map ctrl+k kitten mykitten.py
Start kitty and press :kbd:`ctrl+k` and you should see the kitten running.
The best way to develop your own kittens is to modify one of the built in
kittens. Look in the kittens sub-directory of the kitty source code for those.
Or see below for a list of :ref:`third-party kittens <external_kittens>`,
that other kitty users have created.
Start kitty and press :kbd:`Ctrl+K` and you should see the kitten running.
The best way to develop your own kittens is to modify one of the built-in
kittens. Look in the `kittens sub-directory
<https://github.com/kovidgoyal/kitty/tree/master/kittens>`__ of the kitty source
code for those. Or see below for a list of :ref:`third-party kittens
<external_kittens>`, that other kitty users have created.
kitty API to use with kittens
-------------------------------
Kittens have full access to internal kitty APIs. However these are neither
entirely stable nor documented. You can instead use the kitty
:doc:`Remote control API </remote-control>`. Simply call
:code:`boss.call_remote_control()`, with the same arguments you
would pass to ``kitty @``. For example:
.. code-block:: python
def handle_result(args: List[str], answer: str, target_window_id: int, boss: Boss) -> None:
# get the kitty window to which to send text
w = boss.window_id_map.get(target_window_id)
if w is not None:
boss.call_remote_control(w, ('send-text', 'hello world'))
Passing arguments to kittens
@@ -60,61 +78,100 @@ You can pass arguments to kittens by defining them in the map directive in
These will be available as the ``args`` parameter in the ``main()`` and
``handle_result()`` functions. Note also that the current working directory
of the kitten is set to the working directory of whatever program is
running in the active kitty window. The special argument ``@selection``
is replaced by the currently selected text in the active kitty window.
of the kitten is set to the working directory of whatever program is running in
the active kitty window. The special argument ``@selection`` is replaced by the
currently selected text in the active kitty window.
Passing the contents of the screen to the kitten
---------------------------------------------------
If you would like your kitten to have access to the contents of the screen
and/or the scrollback buffer, you just need to add an annotation to the ``handle_result()``
function, telling kitty what kind of input your kitten would like. For example:
and/or the scrollback buffer, you just need to add an annotation to the
``handle_result()`` function, telling kitty what kind of input your kitten would
like. For example:
.. code-block:: py
from typing import List
from kitty.boss import Boss
# in main, STDIN is for the kitten process and will contain
# the contents of the screen
def main(args):
def main(args: List[str]) -> str:
return sys.stdin.read()
# in handle_result, STDIN is for the kitty process itself, rather
# than the kitten process and should not be read from.
from kittens.tui.handler import result_handler
@result_handler(type_of_input='text')
def handle_result(args, stdin_data, target_window_id, boss):
def handle_result(args: List[str], stdin_data: str, target_window_id: int, boss: Boss) -> None:
pass
This will send the plain text of the active window to the kitten's
:file:`STDIN`. For text with formatting escape codes, use ``ansi``
instead. If you want line wrap markers as well, use ``screen-ansi``
or just ``screen``. For the scrollback buffer as well, use
``history``, ``ansi-history`` or ``screen-history``. To get
the currently selected text, use ``selection``.
:file:`STDIN`. There are many other types of input you can ask for, described in
the table below:
.. table:: Types of input to kittens
:align: left
=========================== =======================================================================================================
Keyword Type of :file:`STDIN` input
=========================== =======================================================================================================
``text`` Plain text of active window
``ansi`` Formatted text of active window
``screen`` Plain text of active window with line wrap markers
``screen-ansi`` Formatted text of active window with line wrap markers
``history`` Plain text of active window and its scrollback
``ansi-history`` Formatted text of active window and its scrollback
``screen-history`` Plain text of active window and its scrollback with line wrap markers
``screen-ansi-history`` Formatted text of active window and its scrollback with line wrap markers
``output`` Plain text of the output from the last run command
``output-screen`` Plain text of the output from the last run command with wrap markers
``output-ansi`` Formatted text of the output from the last run command
``output-screen-ansi`` Formatted text of the output from the last run command with wrap markers
``selection`` The text currently selected with the mouse
=========================== =======================================================================================================
In addition to ``output``, that gets the output of the last run command,
``last_visited_output`` gives the output of the command last jumped to
and ``first_output`` gives the output of the first command currently on screen.
These can also be combined with ``screen`` and ``ansi`` for formatting.
.. note::
For the types based on the output of a command, :ref:`shell_integration` is
required.
Using kittens to script kitty, without any terminal UI
-----------------------------------------------------------
If you would like your kitten to script kitty, without bothering to write a
terminal program, you can tell the kittens system to run the
``handle_result()`` function without first running the ``main()`` function.
terminal program, you can tell the kittens system to run the ``handle_result()``
function without first running the ``main()`` function.
For example, here is a kitten that "zooms/unzooms" the current terminal window
by switching to the stack layout or back to the previous layout.
For example, here is a kitten that "zooms in/zooms out" the current terminal
window by switching to the stack layout or back to the previous layout. This is
equivalent to the builtin :ac:`toggle_layout` action.
Create a file in the kitty config folder, :file:`~/.config/kitty/zoom_toggle.py`
Create a Python file in the :ref:`kitty config directory <confloc>`,
:file:`~/.config/kitty/zoom_toggle.py`
.. code-block:: py
def main(args):
from typing import List
from kitty.boss import Boss
def main(args: List[str]) -> str:
pass
from kittens.tui.handler import result_handler
@result_handler(no_ui=True)
def handle_result(args, answer, target_window_id, boss):
def handle_result(args: List[str], answer: str, target_window_id: int, boss: Boss) -> None:
tab = boss.active_tab
if tab is not None:
if tab.current_layout.name == 'stack':
@@ -123,7 +180,7 @@ Create a file in the kitty config folder, :file:`~/.config/kitty/zoom_toggle.py`
tab.goto_layout('stack')
Now in kitty.conf add::
Now in :file:`kitty.conf` add::
map f11 kitten zoom_toggle.py
@@ -134,7 +191,7 @@ layout, by simply adding the line::
boss.toggle_fullscreen()
To the ``handle_result()`` function, above.
to the ``handle_result()`` function, above.
.. _send_mouse_event:
@@ -142,7 +199,7 @@ To the ``handle_result()`` function, above.
Sending mouse events
--------------------
If the program running in a window is receiving mouse events you can simulate
If the program running in a window is receiving mouse events, you can simulate
those using::
from kitty.fast_data_types import send_mouse_event
@@ -169,15 +226,15 @@ that type, and will return ``True`` if it sent the event, and ``False`` if not.
Debugging kittens
--------------------
The part of the kitten that runs in ``main()`` is just a normal program and
the output of print statements will be visible in the kitten window. Or
alternately, you can use::
The part of the kitten that runs in ``main()`` is just a normal program and the
output of print statements will be visible in the kitten window. Or alternately,
you can use::
from kittens.tui.loop import debug
debug('whatever')
The ``debug()`` function is just like ``print()`` except that the output
will appear in the ``STDOUT`` of the kitty process inside which the kitten is
The ``debug()`` function is just like ``print()`` except that the output will
appear in the ``STDOUT`` of the kitty process inside which the kitten is
running.
The ``handle_result()`` part of the kitten runs inside the kitty process.
@@ -185,18 +242,119 @@ The output of print statements will go to the ``STDOUT`` of the kitty process.
So if you run kitty from another kitty instance, the output will be visible
in the first kitty instance.
Adding options to kittens
----------------------------
If you would like to use kitty's config framework to make your kittens
configurable, you will need some boilerplate. Put the following files in the
directory of your kitten.
:file:`kitten_options_definition.py`
.. code-block:: python
from kitty.conf.types import Action, Definition
definition = Definition(
'!kitten_options_utils',
Action(
'map', 'parse_map',
{'key_definitions': 'kitty.conf.utils.KittensKeyMap'},
['kitty.types.ParsedShortcut', 'kitty.conf.utils.KeyAction']
),
)
agr = definition.add_group
egr = definition.end_group
opt = definition.add_option
map = definition.add_map
# main options {{{
agr('main', 'Main')
opt('some_option', '33',
option_type='some_option_parser',
long_text='''
Help text for this option
'''
)
egr() # }}}
# shortcuts {{{
agr('shortcuts', 'Keyboard shortcuts')
map('Quit', 'quit q quit')
egr() # }}}
:file:`kitten_options_utils.py`
.. code-block:: python
from kitty.conf.utils import KittensKeyDefinition, key_func, parse_kittens_key
func_with_args, args_funcs = key_func()
FuncArgsType = Tuple[str, Sequence[Any]]
def some_option_parser(val: str) -> int:
return int(val) + 3000
def parse_map(val: str) -> Iterable[KittensKeyDefinition]:
x = parse_kittens_key(val, args_funcs)
if x is not None:
yield x
Then run::
kitty +runpy 'from kitty.conf.generate import main; main()' /path/to/kitten_options_definition.py
You can parse and read the options in your kitten using the following code:
.. code-block:: python
from .kitten_options_types import Options, defaults
from kitty.conf.utils import load_config as _load_config, parse_config_base
from typing import Optional, Iterable, Dict, Any
def load_config(*paths: str, overrides: Optional[Iterable[str]] = None) -> Options:
from .kitten_options_parse import (
create_result_dict, merge_result_dicts, parse_conf_item
)
def parse_config(lines: Iterable[str]) -> Dict[str, Any]:
ans: Dict[str, Any] = create_result_dict()
parse_config_base(
lines,
parse_conf_item,
ans,
)
return ans
overrides = tuple(overrides) if overrides is not None else ()
opts_dict, paths = _load_config(defaults, parse_config, merge_result_dicts, *paths, overrides=overrides)
opts = Options(opts_dict)
opts.config_paths = paths
opts.config_overrides = overrides
return opts
See `the code <https://github.com/kovidgoyal/kitty/tree/master/kittens/diff>`__
for the builtin :doc:`diff kitten </kittens/diff>` for examples of creating more
options and keyboard shortcuts.
.. _external_kittens:
Kittens created by kitty users
---------------------------------------------
`vim-kitty-navigator <https://github.com/knubie/vim-kitty-navigator>`_
Allows you to navigate seamlessly between vim and kitty splits using a consistent set of hotkeys.
Allows you to navigate seamlessly between vim and kitty splits using a
consistent set of hotkeys.
`smart-scroll <https://github.com/yurikhan/kitty-smart-scroll>`_
Makes the kitty scroll bindings work in full screen applications
`insert password <https://github.com/kovidgoyal/kitty/issues/1222>`_
:iss:`insert password <1222>`
Insert a password from a CLI password manager, taking care to only do it at
a password prompt.

View File

@@ -1,6 +1,8 @@
kitty-diff - A fast side-by-side diff tool with syntax highlighting and images
kitty-diff
================================================================================
*A fast side-by-side diff tool with syntax highlighting and images*
.. highlight:: sh
Major Features
@@ -10,8 +12,8 @@ Major Features
* Displays diffs side-by-side in the kitty terminal
* Does syntax highlighting of the displayed diffs, asynchronously, for maximum
speed
* Does syntax highlighting of the displayed diffs, asynchronously, for
maximum speed
* Displays images as well as text diffs, even over SSH
@@ -21,21 +23,19 @@ Major Features
.. figure:: ../screenshots/diff.png
:alt: Screenshot, showing a sample diff
:align: center
:scale: 100%
:width: 100%
Screenshot, showing a sample diff
.. contents::
Installation
---------------
Simply :ref:`install kitty <quickstart>`. You also need
to have either the `git <https://git-scm.com/>`_ program or the ``diff`` program
installed. Additionally, for syntax highlighting to work,
`pygments <http://pygments.org/>`_ must be installed (note that pygments is
included in the macOS kitty app).
Simply :ref:`install kitty <quickstart>`. You also need to have either the `git
<https://git-scm.com/>`__ program or the :program:`diff` program installed.
Additionally, for syntax highlighting to work, `pygments
<https://pygments.org/>`__ must be installed (note that pygments is included in
the official kitty binary builds).
Usage
@@ -45,9 +45,10 @@ In the kitty terminal, run::
kitty +kitten diff file1 file2
to see the diff between file1 and file2.
to see the diff between :file:`file1` and :file:`file2`.
Create an alias in your shell's startup file to shorten the command, for example:
Create an alias in your shell's startup file to shorten the command, for
example:
.. code-block:: sh
@@ -67,33 +68,33 @@ Keyboard controls
========================= ===========================
Action Shortcut
========================= ===========================
Quit :kbd:`q, Ctrl+c, Esc`
Scroll line up :kbd:`k, up`
Scroll line down :kbd:`j, down`
Quit :kbd:`Q`, :kbd:`Ctrl+C`, :kbd:`Esc`
Scroll line up :kbd:`K`, :kbd:`Up`
Scroll line down :kbd:`J`, :kbd:`Down`
Scroll page up :kbd:`PgUp`
Scroll page down :kbd:`PgDn`
Scroll to top :kbd:`Home`
Scroll to bottom :kbd:`End`
Scroll to next page :kbd:`Space, PgDn`
Scroll to next page :kbd:`Space`, :kbd:`PgDn`
Scroll to previous page :kbd:`PgUp`
Scroll to next change :kbd:`n`
Scroll to previous change :kbd:`p`
Scroll to next change :kbd:`N`
Scroll to previous change :kbd:`P`
Increase lines of context :kbd:`+`
Decrease lines of context :kbd:`-`
All lines of context :kbd:`a`
All lines of context :kbd:`A`
Restore default context :kbd:`=`
Search forwards :kbd:`/`
Search backwards :kbd:`?`
Clear search :kbd:`Esc`
Scroll to next match :kbd:`>, .`
Scroll to previous match :kbd:`<, ,`
Scroll to next match :kbd:`>`, :kbd:`.`
Scroll to previous match :kbd:`<`, :kbd:`,`
========================= ===========================
Integrating with git
-----------------------
Add the following to `~/.gitconfig`:
Add the following to :file:`~/.gitconfig`:
.. code-block:: ini
@@ -119,36 +120,31 @@ Why does this work only in kitty?
----------------------------------------
The diff kitten makes use of various features that are :doc:`kitty only
</protocol-extensions>`, such as the :doc:`kitty graphics protocol
</graphics-protocol>`, the :ref:`extended keyboard protocol
<extended-key-protocol>`, etc. It also leverages terminal program
infrastructure I created for all of kitty's other kittens to reduce the amount
of code needed (the entire implementation is under 2000 lines of code).
</protocol-extensions>`, such as the :doc:`kitty graphics protocol
</graphics-protocol>`, the :doc:`extended keyboard protocol
</keyboard-protocol>`, etc. It also leverages terminal program infrastructure
I created for all of kitty's other kittens to reduce the amount of code needed
(the entire implementation is under 2000 lines of code).
And fundamentally, it's kitty only because I wrote it for myself, and I am
highly unlikely to use any other terminals :)
Configuration
------------------------
You can configure the colors used, keyboard shortcuts, the diff implementation,
the default lines of context, etc. by creating a :file:`diff.conf` file in
your :ref:`kitty config folder <confloc>`. See below for the supported
configuration directives.
the default lines of context, etc. by creating a :file:`diff.conf` file in your
:ref:`kitty config folder <confloc>`. See below for the supported configuration
directives.
.. include:: /generated/conf-kitten-diff.rst
Command Line Interface
-------------------------
.. include:: /generated/cli-kitten-diff.rst
Sample diff.conf
-----------------

View File

@@ -1,54 +1,63 @@
Hints
==========
|kitty| has a *hints mode* to select and act on arbitrary text snippets currently
visible on the screen. For example, you can press :sc:`open_url`
to choose any URL visible on the screen and then open it using your system
|kitty| has a *hints mode* to select and act on arbitrary text snippets
currently visible on the screen. For example, you can press :sc:`open_url`
to choose any URL visible on the screen and then open it using your default web
browser.
.. figure:: ../screenshots/hints_mode.png
:alt: URL hints mode
:align: center
:scale: 100%
:width: 100%
URL hints mode
Similarly, you can press :sc:`insert_selected_path` to
select anything that looks like a path or filename and then insert it into the
terminal, very useful for picking files from the output of a ``git`` or ``ls`` command and
adding them to the command line for the next command.
Similarly, you can press :sc:`insert_selected_path` to select anything that
looks like a path or filename and then insert it into the terminal, very useful
for picking files from the output of a :program:`git` or :program:`ls` command
and adding them to the command line for the next command.
You can also press :sc:`goto_file_line` to select anything that looks
like a path or filename followed by a colon and a line number and open
the file in vim at the specified line number. The patterns and editor
to be used can be modified using options passed to the kitten. For example::
You can also press :sc:`goto_file_line` to select anything that looks like a
path or filename followed by a colon and a line number and open the file in
:program:`vim` at the specified line number. The patterns and editor to be used
can be modified using options passed to the kitten. For example::
map ctrl+g kitten hints --type=linenum --linenum-action=tab nvim +{line} {path}
will open the selected file in a new tab inside neovim when you press
:kbd:`ctrl+g`.
will open the selected file in a new tab inside `Neovim <https://neovim.io/>`__
when you press :kbd:`Ctrl+G`.
Pressing :sc:`open_selected_hyperlink` will open hyperlinks, i.e. a URL
Pressing :sc:`open_selected_hyperlink` will open :term:`hyperlinks`, i.e. a URL
that has been marked as such by the program running in the terminal,
for example, by ``ls --hyperlink=auto``. You can also :doc:`customize what actions are
taken for different types of URLs <../open_actions>`.
for example, by ``ls --hyperlink=auto``. If :program:`ls` comes with your OS
does not support hyperlink, you may need to install `GNU Coreutils
<https://www.gnu.org/software/coreutils/>`__.
You can also :doc:`customize what actions are taken for different types of URLs
<../open_actions>`.
.. note:: If there are more hints than letters, hints will use multiple
letters. In this case, when you press the first letter, only hints
starting with that letter are displayed. Pressing the second letter will
select that hint or press :kbd:`Enter` or :kbd:`Space` to select the empty
hint.
The hints kitten is very powerful to see more detailed help on its various
options and modes of operation, see below. You can use these options to
create mappings in :file:`kitty.conf` to select various different text
snippets. See :sc:`insert_selected_path` for examples.
snippets. See :sc:`insert_selected_path <insert_selected_path>` for examples.
Completely customizing the matching and actions of the kitten
---------------------------------------------------------------
The hints kitten supports writing simple python scripts that can be used to
The hints kitten supports writing simple Python scripts that can be used to
completely customize how it finds matches and what happens when a match is
selected. This allows the hints kitten to provide the user interface, while
you can provide the logic for finding matches and performing actions on them.
This is best illustrated with an example. Create the file
:file:`custom-hints.py` in the kitty config directory with the following
contents:
selected. This allows the hints kitten to provide the user interface, while you
can provide the logic for finding matches and performing actions on them. This
is best illustrated with an example. Create the file :file:`custom-hints.py` in
the :ref:`kitty config directory <confloc>` with the following contents:
.. code-block:: python
@@ -88,8 +97,14 @@ Now run kitty with::
When you press the :kbd:`F1` key you will be able to select a word to
look it up in the Google dictionary.
Command Line Interface
-------------------------
.. include:: ../generated/cli-kitten-hints.rst
.. note::
To avoid having to specify the same command line options on every
invocation, you can use the :opt:`action_alias` option in
:file:`kitty.conf`, creating aliases that have common sets of options.
For example::
action_alias myhints kitten hints --alphabet qfjdkslaureitywovmcxzpq1234567890
map f1 myhints --customize-processing custom-hints.py

View File

@@ -2,9 +2,11 @@ Hyperlinked grep
=================
This kitten allows you to search your files using `ripgrep
<https://www.google.com/search?q=ripgrep>`_ and open the results
directly in your favorite editor in the terminal, at the line containing
the search result, simply by clicking on the result you want.
<https://github.com/BurntSushi/ripgrep>`__ and open the results directly in your
favorite editor in the terminal, at the line containing the search result,
simply by clicking on the result you want.
.. versionadded:: 0.19.0
To set it up, first create :file:`~/.config/kitty/open-actions.conf` with the
following contents:
@@ -15,26 +17,26 @@ following contents:
# by the hyperlink_grep kitten and nothing else so far.
protocol file
fragment_matches [0-9]+
action launch --type=overlay vim +${FRAGMENT} ${FILE_PATH}
action launch --type=overlay --cwd=current vim +${FRAGMENT} ${FILE_PATH}
# Open text files without fragments in the editor
protocol file
mime text/*
action launch --type=overlay ${EDITOR} ${FILE_PATH}
action launch --type=overlay --cwd=current ${EDITOR} ${FILE_PATH}
Now, run a search with::
kitty +kitten hyperlinked_grep something
Hold down the :kbd:`ctrl+shift` keys and click on any of the
result lines, to open the file in vim at the matching line. If
you use some editor other than vim, you should adjust the
:file:`open-actions.conf` file accordingly.
Hold down the :kbd:`Ctrl+Shift` keys and click on any of the result lines, to
open the file in :program:`vim` at the matching line. If you use some editor
other than :program:`vim`, you should adjust the :file:`open-actions.conf` file
accordingly.
Finally, add an alias to your shell's rc files to invoke the kitten as ``hg``::
Finally, add an alias to your shell's rc files to invoke the kitten as
:command:`hg`::
alias hg='kitty +kitten hyperlinked_grep'
alias hg="kitty +kitten hyperlinked_grep"
You can now run searches with::
@@ -42,27 +44,52 @@ You can now run searches with::
hg some-search-term
If you want to enable completion, for the kitten, you can delegate completion
to rg. For that, instead of using an alias create a simple wrapper script named
:file:`hg` somewhere in your ``PATH``:
to :program:`rg`. How to do that varies based on the shell:
.. code-block:: sh
#!/bin/sh
exec kitty +kitten hyperlinked_grep "$@"
.. tab:: zsh
Then, for example, for ZSH, add the following to :file:`.zshrc`::
Instead of using an alias, create a simple wrapper script named
:program:`hg` somewhere in your :envvar:`PATH`:
compdef _rg hg
.. code-block:: sh
#!/bin/sh
exec kitty +kitten hyperlinked_grep "$@"
Then, add the following to :file:`.zshrc`::
compdef _rg hg
.. tab:: fish
You can combine both the aliasing/wrapping and pointing fish to ripgrep's
autocompletion with a fish wrapper function in your :file:`config.fish`
or :file:`~/.config/fish/functions/hg.fish`:
.. code-block:: fish
function hg --wraps rg; kitty +kitten hyperlinked_grep $argv; end
To learn more about kitty's powerful framework for customizing URL click
actions, :doc:`see here <../open_actions>`.
actions, see :doc:`here </open_actions>`.
By default, this kitten adds hyperlinks for several parts of ripgrep output:
the per-file header, match context lines, and match lines. You can control
which items are linked with a :command:`--kitten hyperlink` flag. For example,
:command:`--kitten hyperlink=matching_lines` will only add hyperlinks to the
match lines. :command:`--kitten hyperlink=file_headers,context_lines` will link
file headers and context lines but not match lines. :command:`--kitten
hyperlink=none` will cause the command line to be passed to directly to
:command:`rg` so no hyperlinking will be performed. :command:`--kitten
hyperlink` may be specified multiple times.
Hopefully, someday this functionality will make it into some `upstream grep
<https://github.com/BurntSushi/ripgrep/issues/665>`_
program directly removing the need for this kitten.
<https://github.com/BurntSushi/ripgrep/issues/665>`__ program directly removing
the need for this kitten.
.. note::
While you can pass any of ripgrep's comand line options to the kitten and
they will be forwarded to rg, do not use options that change the output
formatting as the kitten works by parsing the output from ripgrep.
they will be forwarded to :program:`rg`, do not use options that change the
output formatting as the kitten works by parsing the output from ripgrep.

View File

@@ -1,14 +1,16 @@
icat - Display images in the terminal
icat
========================================
*Display images in the terminal*
The ``icat`` kitten can be used to display arbitrary images in the |kitty|
terminal. Using it is as simple as::
kitty +kitten icat image.jpeg
It supports all image types supported by `ImageMagick
<https://www.imagemagick.org>`_. It even works over SSH. For details, see
the :doc:`kitty graphics protocol </graphics-protocol>`.
<https://www.imagemagick.org>`__. It even works over SSH. For details, see the
:doc:`kitty graphics protocol </graphics-protocol>`.
You might want to create an alias in your shell's configuration files::
@@ -18,14 +20,14 @@ Then you can simply use ``icat image.png`` to view images.
.. note::
`ImageMagick <https://www.imagemagick.org>`_ must be installed for ``icat`` to
work.
`ImageMagick <https://www.imagemagick.org>`__ must be installed for icat
kitten to work.
.. note::
kitty's image display protocol may not work when used within a terminal
multiplexer such as ``screen`` or ``tmux``, depending on whether the
multiplexer has added support for it or not.
multiplexer such as :program:`screen` or :program:`tmux`, depending on
whether the multiplexer has added support for it or not.
.. program:: kitty +kitten icat
@@ -33,9 +35,19 @@ Then you can simply use ``icat image.png`` to view images.
The ``icat`` kitten has various command line arguments to allow it to be used
from inside other programs to display images. In particular, :option:`--place`,
:option:`--detect-support` and :option:`--print-window-size`.
:option:`--detect-support`, :option:`--silent` and
:option:`--print-window-size`.
If you are trying to integrate icat into a complex program like a file manager
or editor, there are a few things to keep in mind. icat works by communicating
over the TTY device, it both writes to and reads from the TTY. So it is
imperative that while it is running the host program does not do any TTY I/O.
Any key presses or other input from the user on the TTY device will be
discarded. At a minimum, you should use the :option:`--silent` and
:option:`--transfer-mode` command line arguments. To be really robust you should
consider writing proper support for the :doc:`kitty graphics protocol
</graphics-protocol>` in the program instead. Nowadays there are many libraries
that have support for it.
Command Line Interface
--------------------------
.. include:: /generated/cli-kitten-icat.rst

View File

@@ -4,8 +4,8 @@ Draw a GPU accelerated dock panel on your desktop
.. highlight:: sh
You can use this kitten to draw a GPU accelerated panel on the edge
of your screen, that shows the output from an arbitrary terminal program.
You can use this kitten to draw a GPU accelerated panel on the edge of your
screen, that shows the output from an arbitrary terminal program.
It is useful for showing status information or notifications on your desktop
using terminal programs instead of GUI toolkits.
@@ -14,7 +14,7 @@ using terminal programs instead of GUI toolkits.
.. figure:: ../screenshots/panel.png
:alt: Screenshot, showing a sample panel
:align: center
:scale: 100%
:width: 100%
Screenshot, showing a sample panel
@@ -32,12 +32,9 @@ Using this kitten is simple, for example::
kitty +kitten panel sh -c 'printf "\n\n\nHello, world."; sleep 5s'
This will show ``Hello, world.`` at the top edge of your screen for five
seconds. Here the terminal program we are running is ``sh`` with a script to
print out ``Hello, world!``. You can make the terminal program as complex as
seconds. Here the terminal program we are running is :program:`sh` with a script
to print out ``Hello, world!``. You can make the terminal program as complex as
you like, as demonstrated in the screenshot above.
Command Line Interface
-------------------------
.. include:: ../generated/cli-kitten-panel.rst

View File

@@ -1,21 +1,18 @@
Query terminal
=================
Used to query kitty from terminal programs about version, values of various
runtime options controlling its features, etc.
This kitten is used to query |kitty| from terminal programs about version, values
of various runtime options controlling its features, etc.
The querying is done using the (*semi*) standard XTGETTCAP escape sequence
pioneered by XTerm, so it works over SSH as well. The downside is that it
is slow, since it requires a roundtrip to the terminal emulator and back.
pioneered by xterm, so it works over SSH as well. The downside is that it is
slow, since it requires a roundtrip to the terminal emulator and back.
If you want to do some of the same querying in your terminal program without
depending on the kitten, you can do so, by processing the same escape codes.
Search `this page <https://invisible-island.net/xterm/ctlseqs/ctlseqs.html>`_
for *XTGETTCAP* to see the syntax for the escape code and read the source
of this kitten to find the values of the keys for the various queries.
Search `this page <https://invisible-island.net/xterm/ctlseqs/ctlseqs.html>`__
for *XTGETTCAP* to see the syntax for the escape code and read the source of
this kitten to find the values of the keys for the various queries.
Command Line Interface
-------------------------
.. include:: ../generated/cli-kitten-query_terminal.rst

View File

@@ -1,35 +1,46 @@
Remote files
==============
|kitty| has the ability to easily *Edit*, *Open* or *Download* files
from a computer into which you are SSHed. In your SSH session run::
|kitty| has the ability to easily *Edit*, *Open* or *Download* files from a
computer into which you are SSHed. In your SSH session run::
ls --hyperlink=auto
Then hold down :kbd:`ctrl+shift` and click the name of the file.
Then hold down :kbd:`Ctrl+Shift` and click the name of the file.
.. figure:: ../screenshots/remote_file.png
:alt: Remote file actions
:align: center
:scale: 100%
:width: 100%
Remote file actions
|kitty| will ask you what you want to do with the remote file. You can choose
to *Edit* it in which case kitty will download it and open it locally in your
``EDITOR``. As you make changes to the file, they are automatically transferred
to the remote computer. Note that this happens without needing to install *any*
special software on the server, beyond ``ls`` that supports hyperlinks.
:envvar:`EDITOR`. As you make changes to the file, they are automatically
transferred to the remote computer. Note that this happens without needing
to install *any* special software on the server, beyond :program:`ls` that
supports hyperlinks.
.. seealso:: See the :ref:`edit-in-kitty <edit_file>` command
.. seealso:: See the :doc:`transfer` kitten
.. versionadded:: 0.19.0
.. note::
Nested SSH sessions are not supported. The kitten will always try to copy
remote files from the first SSH host. This is because there is no way for
|kitty| to detect and follow a nested SSH session robustly.
For best results, use this kitten with the :doc:`ssh kitten <./ssh>`.
Otherwise, nested SSH sessions are not supported. The kitten will always try to copy
remote files from the first SSH host. This is because, without the ssh
kitten, there is no way for
|kitty| to detect and follow a nested SSH session robustly. Use the
:doc:`transfer` kitten for such situations.
.. note::
If you have not setup automatic password-less SSH access, then, when
editing starts you will be asked to enter your password just once,
thereafter the SSH connection will be re-used.
If you have not setup automatic password-less SSH access, and are not using
the ssh kitten, then, when editing
starts you will be asked to enter your password just once, thereafter the SSH
connection will be re-used.
Similarly, you can choose to save the file to the local computer or download
and open it in its default file handler.

164
docs/kittens/ssh.rst Normal file
View File

@@ -0,0 +1,164 @@
Truly convenient SSH
=========================================
* Automatic :ref:`shell_integration` on remote hosts
* Easily :ref:`clone local shell/editor config <real_world_ssh_kitten_config>` on remote hosts
* Automatic :opt:`re-use of existing connections <kitten-ssh.share_connections>` to avoid connection setup latency
* Make kitty itself available in the remote host :opt:`on demand <kitten-ssh.remote_kitty>`
* Easily :opt:`change terminal colors <kitten-ssh.color_scheme>` when connecting to remote hosts
.. versionadded:: 0.25.0
Automatic shell integration, file transfer and reuse of connections
The ssh kitten allows you to login easily to remote hosts, and automatically
setup the environment there to be as comfortable as your local shell. You can
specify environment variables to set on the remote host and files to copy there,
making your remote experience just like your local shell. Additionally, it
automatically sets up :ref:`shell_integration` on the remote host and copies the
kitty terminfo database there.
The ssh kitten is a thin wrapper around the traditional `ssh <https://man.openbsd.org/ssh>`__
command line program and supports all the same options and arguments and configuration.
In interactive usage scenarios it is a drop in replacement for :program:`ssh`.
To try it out, simply run:
.. code-block:: sh
kitty +kitten ssh some-hostname-to-connect-to
You should end up at a shell prompt on the remote host, with shell integration
enabled. If you like it you can add an alias to it in your shell's rc files:
.. code-block:: sh
alias s="kitty +kitten ssh"
So now you can just type ``s hostname`` to connect.
If you define a mapping in :file:`kitty.conf` such as::
map f1 new_window_with_cwd
Then, pressing :kbd:`F1` will open a new window automatically logged into the
same host using the ssh kitten, at the same directory.
The ssh kitten can be configured using the :file:`~/.config/kitty/ssh.conf` file
where you can specify environment variables to set on the remote host and files
to copy from the local to the remote host. Let's see a quick example:
.. code-block:: conf
# Copy the files and directories needed to setup some common tools
copy .zshrc .vimrc .vim
# Setup some environment variables
env SOME_VAR=x
# COPIED_VAR will have the same value on the remote host as it does locally
env COPIED_VAR=_kitty_copy_env_var_
# Create some per hostname settings
hostname someserver-*
copy env-files
env SOMETHING=else
hostname someuser@somehost
copy --dest=foo/bar some-file
copy --glob some/files.*
See below for full details on the syntax and options of :file:`ssh.conf`.
Additionally, you can pass config options on the command line:
.. code-block:: sh
kitty +kitten ssh --kitten interpreter=python servername
The :code:`--kitten` argument can be specified multiple times, with directives
from :file:`ssh.conf`. These are merged with :file:`ssh.conf` as if they were
appended to the end of that file. They apply only to the host being SSHed to by
this invocation, so any :opt:`hostname <kitten-ssh.hostname>` directives are
ignored.
.. warning::
Due to limitations in the design of SSH, any typing you do before the
shell prompt appears may be lost. So ideally don't start typing till you see
the shell prompt. 😇
.. _real_world_ssh_kitten_config:
A real world example
----------------------
Suppose you often SSH into a production server, and you would like to setup
your shell and editor there using your custom settings. However, other people
could SSH in as well and you don't want to clobber their settings. Here is how
this could be achieved using the ssh kitten with :program:`zsh` and
:program:`vim` as the shell and editor, respectively:
.. code-block:: conf
# Have these settings apply to servers in my organization
hostname myserver-*
# Setup zsh to read its files from my-conf/zsh
env ZDOTDIR $HOME/my-conf/zsh
copy --dest my-conf/zsh/.zshrc .zshrc
copy --dest my-conf/zsh/.zshenv .zshenv
# If you use other zsh init files add them in a similar manner
# Setup vim to read its config from my-conf/vim
env VIMINIT $HOME/my-conf/vim/vimrc
env VIMRUNTIME $HOME/my-conf/vim
copy --dest my-conf/vim .vim
copy --dest my-conf/vim/vimrc .vimrc
How it works
----------------
The ssh kitten works by having SSH transmit and execute a POSIX sh (or
:opt:`optionally <kitten-ssh.interpreter>` Python) bootstrap script on the
remote host using an :opt:`interpreter <kitten-ssh.interpreter>`. This script
reads setup data over the TTY device, which kitty sends as a Base64 encoded
compressed tarball. The script extracts it and places the :opt:`files <kitten-ssh.copy>`
and sets the :opt:`environment variables <kitten-ssh.env>` before finally
launching the :opt:`login shell <kitten-ssh.login_shell>` with :opt:`shell
integration <kitten-ssh.shell_integration>` enabled. The data is requested by
the kitten over the TTY with a random one time password. kitty reads the request
and if the password matches a password pre-stored in shared memory on the
localhost by the kitten, the transmission is allowed. If your local
`OpenSSH <https://www.openssh.com/>`__ version is >= 8.4 then the data is
transmitted instantly without any roundtrip delay.
.. note::
When connecting to BSD hosts, it is possible the bootstrap script will fail
or run slowly, because the default shells are crippled in various ways.
Your best bet is to install Python on the remote, make sure the login shell
is something POSIX sh compliant, and use :code:`python` as the
:opt:`interpreter <kitten-ssh.interpreter>` in :file:`ssh.conf`.
.. note::
This may or may not work when using terminal multiplexers, depending on
whether they passthrough the escape codes and if the values of the
environment variables :envvar:`KITTY_PID` and :envvar:`KITTY_WINDOW_ID` are
correct in the current session (they can be wrong when connecting to a tmux
session running in a different window) and the ssh kitten is run in the
currently active multiplexer window.
.. include:: /generated/conf-kitten-ssh.rst
.. _ssh_copy_command:
The copy command
--------------------
.. include:: /generated/ssh-copy.rst

79
docs/kittens/themes.rst Normal file
View File

@@ -0,0 +1,79 @@
Changing kitty colors
========================
The themes kitten allows you to easily change color themes, from a collection of
over two hundred pre-built themes available at `kitty-themes
<https://github.com/kovidgoyal/kitty-themes>`_. To use it, simply run::
kitty +kitten themes
.. image:: ../screenshots/themes.png
:alt: The themes kitten in action
:width: 600
The kitten allows you to pick a theme, with live previews of the colors. You can
choose between light and dark themes and search by theme name by just typing a
few characters from the name.
The kitten maintains a list of recently used themes to allow quick switching.
If you want to restore the colors to default, you can do so by choosing the
``Default`` theme.
.. versionadded:: 0.23.0
The themes kitten
How it works
----------------
A theme in kitty is just a :file:`.conf` file containing kitty settings.
When you select a theme, the kitten simply copies the :file:`.conf` file
to :file:`~/.config/kitty/current-theme.conf` and adds an include for
:file:`current-theme.conf` to :file:`kitty.conf`. It also comments out any
existing color settings in :file:`kitty.conf` so they do not interfere.
Once that's done, the kitten sends kitty a signal to make it reload its config.
Using your own themes
-----------------------
You can also create your own themes as :file:`.conf` files. Put them in the
:file:`themes` sub-directory of the :ref:`kitty config directory <confloc>`,
usually, :file:`~/.config/kitty/themes`. The kitten will automatically add them
to the list of themes. You can use this to modify the builtin themes, by giving
the conf file the name :file:`Some theme name.conf` to override the builtin
theme of that name. Note that after doing so you have to run the kitten and
choose that theme once for your changes to be applied.
Contributing new themes
-------------------------
If you wish to contribute a new theme to the kitty theme repository, start by
going to the `kitty-themes <https://github.com/kovidgoyal/kitty-themes>`__
repository. `Fork it
<https://docs.github.com/en/get-started/quickstart/fork-a-repo>`__, and use the
file :download:`template.conf
<https://github.com/kovidgoyal/kitty-themes/raw/master/template.conf>` as a
template when creating your theme. Once you are satisfied with how it looks,
`submit a pull request
<https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request>`__
to have your theme merged into the `kitty-themes
<https://github.com/kovidgoyal/kitty-themes>`__ repository, which will make it
available in this kitten automatically.
Changing the theme non-interactively
---------------------------------------
You can specify the theme name as an argument when invoking the kitten to have
it change to that theme instantly. For example::
kitty +kitten themes --reload-in=all Dimmed Monokai
Will change the theme to ``Dimmed Monokai`` in all running kitty instances. See
below for more details on non-interactive operation.
.. include:: ../generated/cli-kitten-themes.rst

99
docs/kittens/transfer.rst Normal file
View File

@@ -0,0 +1,99 @@
Transfer files
================
.. _rsync: https://en.wikipedia.org/wiki/Rsync
.. warning::
This kitten is currently experimental, use with care.
Transfer files to and from remote computers over the ``TTY`` device itself.
This means that file transfer works over nested SSH sessions, serial links,
etc. Anywhere you have a terminal device, you can transfer files.
.. image:: ../screenshots/transfer.png
:alt: The transfer kitten at work
This kitten supports transferring entire directory trees, preserving soft and
hard links, file permissions, times, etc. It even supports the rsync_ protocol
to transfer only changes to large files.
.. seealso:: See the :doc:`remote_file` kitten
.. note::
This kitten (which practically means kitty) must be installed on the other
machine as well. If that is not possible you can use the :doc:`remote_file`
kitten instead. Or write your own script to use the underlying
:doc:`file transfer protocol </file-transfer-protocol>`.
.. versionadded:: 0.24.0
Basic usage
---------------
In what follows, the *local computer* is the computer running this kitten and
the *remote computer* is the computer connected to the other end of the TTY
pipe.
To send a file from the local computer to the remote computer, simply run::
kitty +kitten transfer /path/to/local/file /path/to/destination/on/remote/computer
You will be prompted by kitty for confirmation on allowing the transfer, and if
you grant permission, the file will be copied.
Similarly, to get a file from the remote computer to the local computer, use
the :option:`--direction <kitty +kitten transfer --direction>` option::
kitty +kitten transfer --direction=receive /path/to/remote/file /path/to/destination/on/local/computer
Multiple files and even directories can be transferred::
kitty +kitten transfer file1 dir1 destination/
Here :file:`file1` will be copied inside :file:`destination` and :file:`dir1`
will be recursively copied into :file:`destination`. Note the trailing slash on
:file:`destination`. This tells kitty the destination is a directory. While not
strictly necessary (kitty will infer the need for a destination directory from
the fact that you are copying multiple things) it is good practice to always
use a trailing slash when the destination is supposed to be a directory.
Also, when transferring multiple files/directories it is a good idea to
use the :option:`--confirm-paths <kitty +kitten transfer --confirm-paths>`
option which will give you an opportunity to review and confirm the files that
will be touched.
Avoiding the confirmation prompt
------------------------------------
Normally, when you start a file transfer kitty will prompt you for confirmation.
This is to ensure that hostile programs running on a remote machine cannot
read/write files on your computer without your permission. If the remote machine
is trusted and the connection between your computer and the remote machine is
secure, then you can disable the confirmation prompt by:
#. Setting the :opt:`file_transfer_confirmation_bypass` option to some password.
#. When invoking the kitten use the :option:`--permissions-bypass
<kitty +kitten transfer --permissions-bypass>` to supply the password you set
in step one.
.. warning:: Using a password to bypass confirmation means any software running
on the remote machine could potentially learn that password and use it to
gain full access to your computer. Also anyone that can intercept the data
stream between your computer and the remote machine can also learn this
password. So use it only with secure connections to trusted computers.
Delta transfers
-----------------------------------
This kitten has the ability to use the rsync_ protocol to only transfer the
differences between files. To turn it on use the :option:`--transmit-deltas
<kitty +kitten transfer --transmit-deltas>` option. Note that this will actually
be slower when transferring small files because of round trip overhead, so use
with care.
.. include:: ../generated/cli-kitten-transfer.rst

View File

@@ -1,33 +0,0 @@
Unicode input
================
You can input unicode characters by name, hex code, recently used and even an editable favorites list.
Press :sc:`input_unicode_character` to start the unicode input widget, shown below.
.. figure:: ../screenshots/unicode.png
:alt: A screenshot of the unicode input widget
:align: center
:scale: 100%
A screenshot of the unicode input widget
In :guilabel:`Code` mode, you enter a unicode character by typing in the hex code for the
character and pressing enter, for example, type in ``2716`` and press enter to get
✖. You can also choose a character from the list of recently used characters by
typing a leading period and then the two character index and pressing Enter.
The up and down arrow keys can be used to choose the previous and next unicode
symbol respectively.
In :guilabel:`Name` mode you instead type words from the character name and use the arrow
keys/tab to select the character from the displayed matches. You can also type
a leading period and the index for the match if you don't like to use arrow
keys.
You can switch between modes using either the function keys or by pressing
:kbd:`Ctrl+[` and :kbd:`Ctrl+]`.
Command Line Interface
-------------------------
.. include:: ../generated/cli-kitten-unicode_input.rst

View File

@@ -0,0 +1,33 @@
Unicode input
================
You can input Unicode characters by name, hex code, recently used and even an
editable favorites list. Press :sc:`input_unicode_character` to start the
unicode input kitten, shown below.
.. figure:: ../screenshots/unicode.png
:alt: A screenshot of the unicode input kitten
:align: center
:width: 100%
A screenshot of the unicode input kitten
In :guilabel:`Code` mode, you enter a Unicode character by typing in the hex
code for the character and pressing :kbd:`Enter`. For example, type in ``2716``
and press :kbd:`Enter` to get ````. You can also choose a character from the
list of recently used characters by typing a leading period ``.`` and then the
two character index and pressing :kbd:`Enter`.
The :kbd:`Up` and :kbd:`Down` arrow keys can be used to choose the previous and
next Unicode symbol respectively.
In :guilabel:`Name` mode you instead type words from the character name and use
the :kbd:`ArrowKeys` / :kbd:`Tab` to select the character from the displayed
matches. You can also type a space followed by a period and the index for the
match if you don't like to use arrow keys.
You can switch between modes using either the keys :kbd:`F1` ... :kbd:`F4` or
:kbd:`Ctrl+1` ... :kbd:`Ctrl+4` or by pressing :kbd:`Ctrl+[` and :kbd:`Ctrl+]`
or by pressing :kbd:`Ctrl+Tab` and :kbd:`Ctrl+Shift+Tab`.
.. include:: ../generated/cli-kitten-unicode_input.rst

81
docs/kittens_intro.rst Normal file
View File

@@ -0,0 +1,81 @@
.. _kittens:
Extend with kittens
-----------------------
.. toctree::
:hidden:
:glob:
kittens/icat
kittens/diff
kittens/unicode_input
kittens/themes
kittens/hints
kittens/remote_file
kittens/hyperlinked_grep
kittens/transfer
kittens/ssh
kittens/custom
kittens/*
|kitty| has a framework for easily creating terminal programs that make use of
its advanced features. These programs are called kittens. They are used both to
add features to |kitty| itself and to create useful standalone programs.
Some prominent kittens:
:doc:`icat <kittens/icat>`
Display images in the terminal
:doc:`diff <kittens/diff>`
A fast, side-by-side diff for the terminal with syntax highlighting and
images
:doc:`Unicode input <kittens/unicode_input>`
Easily input arbitrary Unicode characters in |kitty| by name or hex code.
:doc:`Hints <kittens/hints>`
Select and open/paste/insert arbitrary text snippets such as URLs,
filenames, words, lines, etc. from the terminal screen.
:doc:`Remote file <kittens/remote_file>`
Edit, open, or download remote files over SSH easily, by simply clicking on
the filename.
:doc:`Transfer files <kittens/transfer>`
Transfer files and directories seamlessly and easily from remote machines
over your existing SSH sessions with a simple command.
:doc:`Hyperlinked grep <kittens/hyperlinked_grep>`
Search your files using `ripgrep <https://github.com/BurntSushi/ripgrep>`__
and open the results directly in your favorite editor in the terminal,
at the line containing the search result, simply by clicking on the result
you want.
:doc:`Broadcast <kittens/broadcast>`
Type in one :term:`kitty window <window>` and have it broadcast to all (or a
subset) of other :term:`kitty windows <window>`.
:doc:`SSH <kittens/ssh>`
SSH with automatic :ref:`shell integration <shell_integration>`, connection
re-use for low latency and easy cloning of local shell and editor
configuration to the remote host.
:doc:`Panel <kittens/panel>`
Draw a GPU accelerated dock panel on your desktop showing the output from an
arbitrary terminal program.
:doc:`Clipboard <kittens/clipboard>`
Copy/paste to the clipboard from shell scripts, even over SSH.
You can also :doc:`Learn to create your own kittens <kittens/custom>`.

295
docs/kitty_at_template.py Normal file
View File

@@ -0,0 +1,295 @@
#!/usr/bin/env python
# License: GPLv3 Copyright: 2022, Kovid Goyal <kovid at kovidgoyal.net>
import argparse
import base64
import hashlib
import json
import os
import sys
import termios
import time
import tty
from contextlib import contextmanager
from ctypes import (
CDLL, POINTER, byref, c_char_p, c_int, c_size_t, c_void_p,
create_string_buffer
)
from ctypes.util import find_library
_plat = sys.platform.lower()
is_macos: bool = 'darwin' in _plat
def build_crypto_tools(): # {{{
class EVP_PKEY_POINTER(c_void_p):
algorithm = 0
def __del__(self):
EVP_PKEY_free(self)
@property
def public(self):
sz = c_size_t(0)
EVP_PKEY_get_raw_public_key(self, None, byref(sz))
buf = create_string_buffer(sz.value)
EVP_PKEY_get_raw_public_key(self, buf, byref(sz))
return buf.raw
def derive_secret(self, pubkey):
pubkey = EVP_PKEY_new_raw_public_key(self.algorithm, None, pubkey, len(pubkey))
ctx = EVP_PKEY_CTX_new(self, None)
EVP_PKEY_derive_init(ctx)
EVP_PKEY_derive_set_peer(ctx, pubkey)
sz = c_size_t(0)
EVP_PKEY_derive(ctx, None, byref(sz))
buf = create_string_buffer(sz.value)
EVP_PKEY_derive(ctx, buf, byref(sz))
return hashlib.sha256(buf.raw).digest()
class EVP_PKEY_CTX_POINTER(c_void_p):
def __del__(self):
EVP_PKEY_CTX_free(self)
class EVP_CIPHER_CTX_POINTER(c_void_p):
def __del__(self):
EVP_CIPHER_CTX_free(self)
class EVP_CIPHER_POINTER(c_void_p):
pass
cl = find_library('crypto')
if not cl:
raise SystemExit('Failed to find libcrypto on your system, make sure OpenSSL is installed')
crypto = CDLL(cl)
libc = CDLL(None)
def create_crypto_func(name, *argtypes, restype=c_int, int_return_ok=lambda x: x == 1):
impl = getattr(crypto, name)
impl.restype = restype
impl.argtypes = argtypes
def func(*a):
res = impl(*a)
if restype is c_int:
if not int_return_ok(res):
print('Call to', name, 'failed with return code:', res, file=sys.stderr)
abort_on_openssl_error()
elif restype is not None and issubclass(restype, c_void_p):
if res.value is None:
print('Call to', name, 'failed with NULL return', file=sys.stderr)
abort_on_openssl_error()
return res
return func
OBJ_txt2nid = create_crypto_func('OBJ_txt2nid', c_char_p, int_return_ok=bool)
EVP_PKEY_CTX_new_id = create_crypto_func('EVP_PKEY_CTX_new_id', c_int, c_void_p, restype=EVP_PKEY_CTX_POINTER)
EVP_PKEY_CTX_new = create_crypto_func('EVP_PKEY_CTX_new', EVP_PKEY_POINTER, c_void_p, restype=EVP_PKEY_CTX_POINTER)
EVP_PKEY_keygen_init = create_crypto_func('EVP_PKEY_keygen_init', EVP_PKEY_CTX_POINTER)
EVP_PKEY_keygen = create_crypto_func('EVP_PKEY_keygen', EVP_PKEY_CTX_POINTER, POINTER(EVP_PKEY_POINTER))
ERR_print_errors_fp = create_crypto_func('ERR_print_errors_fp', c_void_p, restype=None)
EVP_PKEY_free = create_crypto_func('EVP_PKEY_free', EVP_PKEY_POINTER, restype=None)
EVP_PKEY_CTX_free = create_crypto_func('EVP_PKEY_CTX_free', EVP_PKEY_CTX_POINTER, restype=None)
EVP_PKEY_get_raw_public_key = create_crypto_func('EVP_PKEY_get_raw_public_key', EVP_PKEY_POINTER, c_char_p, POINTER(c_size_t))
EVP_PKEY_new_raw_public_key = create_crypto_func('EVP_PKEY_new_raw_public_key', c_int, c_void_p, c_char_p, c_size_t, restype=EVP_PKEY_POINTER)
EVP_PKEY_derive_init = create_crypto_func('EVP_PKEY_derive_init', EVP_PKEY_CTX_POINTER)
EVP_PKEY_derive_set_peer = create_crypto_func('EVP_PKEY_derive_set_peer', EVP_PKEY_CTX_POINTER, EVP_PKEY_POINTER)
EVP_PKEY_derive = create_crypto_func('EVP_PKEY_derive', EVP_PKEY_CTX_POINTER, c_char_p, POINTER(c_size_t))
EVP_CIPHER_CTX_free = create_crypto_func('EVP_CIPHER_CTX_free', EVP_CIPHER_CTX_POINTER, restype=None)
EVP_get_cipherbyname = create_crypto_func('EVP_get_cipherbyname', c_char_p, restype=EVP_CIPHER_POINTER)
EVP_CIPHER_key_length = create_crypto_func('EVP_CIPHER_key_length', EVP_CIPHER_POINTER, int_return_ok=bool)
EVP_CIPHER_iv_length = create_crypto_func('EVP_CIPHER_iv_length', EVP_CIPHER_POINTER, int_return_ok=bool)
EVP_CIPHER_CTX_block_size = create_crypto_func('EVP_CIPHER_CTX_block_size', EVP_CIPHER_CTX_POINTER, int_return_ok=bool)
EVP_CIPHER_CTX_new = create_crypto_func('EVP_CIPHER_CTX_new', restype=EVP_CIPHER_CTX_POINTER)
EVP_EncryptInit_ex = create_crypto_func('EVP_EncryptInit_ex', EVP_CIPHER_CTX_POINTER, EVP_CIPHER_POINTER, c_void_p, c_char_p, c_char_p)
EVP_EncryptUpdate = create_crypto_func('EVP_EncryptUpdate', EVP_CIPHER_CTX_POINTER, c_char_p, POINTER(c_int), c_char_p, c_int)
EVP_EncryptFinal_ex = create_crypto_func('EVP_EncryptFinal_ex', EVP_CIPHER_CTX_POINTER, c_char_p, POINTER(c_int))
EVP_CIPHER_CTX_ctrl = create_crypto_func('EVP_CIPHER_CTX_ctrl', EVP_CIPHER_CTX_POINTER, c_int, c_int, c_char_p)
try:
EVP_CIPHER_CTX_tag_length = create_crypto_func('EVP_CIPHER_CTX_tag_length', EVP_CIPHER_CTX_POINTER, int_return_ok=bool)
except AttributeError: # need openssl >= 3
def EVP_CIPHER_CTX_tag_length(cipher):
return 16
EVP_CTRL_AEAD_GET_TAG, EVP_CTRL_AEAD_SET_TAG = 0x10, 0x11 # these are defines in the header dont know how to get them programmatically
EVP_CTRL_AEAD_SET_TAG
def abort_on_openssl_error():
stderr = c_void_p.in_dll(libc, 'stderr')
ERR_print_errors_fp(stderr)
raise SystemExit(1)
def elliptic_curve_keypair(algorithm='X25519'):
nid = OBJ_txt2nid(algorithm.encode())
pctx = EVP_PKEY_CTX_new_id(nid, None)
EVP_PKEY_keygen_init(pctx)
key = EVP_PKEY_POINTER()
EVP_PKEY_keygen(pctx, byref(key))
key.algorithm = nid
return key
def encrypt(plaintext, symmetric_key, algorithm='aes-256-gcm'):
cipher = EVP_get_cipherbyname(algorithm.encode())
if len(symmetric_key) != EVP_CIPHER_key_length(cipher):
raise KeyError(f'The symmetric key has length {len(symmetric_key)} != {EVP_CIPHER_key_length(cipher)} needed for {algorithm}')
ctx = EVP_CIPHER_CTX_new()
iv = os.urandom(EVP_CIPHER_iv_length(cipher))
EVP_EncryptInit_ex(ctx, cipher, None, symmetric_key, iv)
bs = EVP_CIPHER_CTX_block_size(ctx)
ciphertext = create_string_buffer(len(plaintext) + 2 * bs)
outlen = c_int(len(ciphertext))
EVP_EncryptUpdate(ctx, ciphertext, byref(outlen), plaintext, len(plaintext))
ans = ciphertext[:outlen.value]
outlen = c_int(len(ciphertext))
EVP_EncryptFinal_ex(ctx, ciphertext, byref(outlen))
if outlen.value:
ans += ciphertext[:outlen.value]
tag = create_string_buffer(EVP_CIPHER_CTX_tag_length(cipher))
EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_GET_TAG, len(tag), tag)
return iv, ans, tag.raw
return elliptic_curve_keypair, encrypt
# }}}
# utils {{{
def encrypt_cmd(cmd, password, pubkey=None):
elliptic_curve_keypair, encrypt = build_crypto_tools()
if pubkey is None:
pubkey = os.environ['KITTY_PUBLIC_KEY']
v, d = pubkey.split(':', 1)
if v != '1':
raise SystemExit(f'Unsupported encryption protocol: {v}')
pubkey = base64.b85decode(d)
k = elliptic_curve_keypair()
sk = k.derive_secret(pubkey)
cmd['timestamp'] = time.time_ns()
cmd['password'] = password
data = json.dumps(cmd).encode()
iv, encrypted, tag = encrypt(data, sk)
def e(x):
return base64.b85encode(x).decode('ascii')
return {
'encrypted': e(encrypted), 'iv': e(iv), 'tag': e(tag), 'pubkey': e(k.public), 'version': cmd['version']
}
@contextmanager
def raw_mode(fd):
old = termios.tcgetattr(fd)
try:
tty.setraw(fd)
yield
finally:
termios.tcsetattr(fd, termios.TCSADRAIN, old)
def config_dir():
if 'KITTY_CONFIG_DIRECTORY' in os.environ:
return os.path.abspath(os.path.expanduser(os.environ['KITTY_CONFIG_DIRECTORY']))
locations = []
if 'XDG_CONFIG_HOME' in os.environ:
locations.append(os.path.abspath(os.path.expanduser(os.environ['XDG_CONFIG_HOME'])))
locations.append(os.path.expanduser('~/.config'))
if is_macos:
locations.append(os.path.expanduser('~/Library/Preferences'))
for loc in filter(None, os.environ.get('XDG_CONFIG_DIRS', '').split(os.pathsep)):
locations.append(os.path.abspath(os.path.expanduser(loc)))
for loc in locations:
if loc:
q = os.path.join(loc, 'kitty')
if os.access(q, os.W_OK) and os.path.exists(os.path.join(q, 'kitty.conf')):
return q
for loc in locations:
if loc:
q = os.path.join(loc, 'kitty')
if os.path.isdir(q) and os.access(q, os.W_OK):
return q
return ''
def resolve_custom_file(path):
path = os.path.expanduser(path)
path = os.path.expandvars(path)
if not os.path.isabs(path):
cdir = config_dir()
if cdir:
path = os.path.join(cdir, path)
return path
def get_password(opts):
if opts.use_password == 'never':
return ''
ans = ''
if opts.password:
ans = opts.password
if not ans and opts.password_file:
if opts.password_file == '-':
if sys.stdin.isatty():
from getpass import getpass
ans = getpass()
else:
ans = sys.stdin.read().rstrip()
try:
tty_fd = os.open(os.ctermid(), os.O_RDONLY | os.O_CLOEXEC)
except OSError:
pass
else:
with open(tty_fd, closefd=True):
os.dup2(tty_fd, sys.stdin.fileno())
else:
try:
with open(resolve_custom_file(opts.password_file)) as f:
ans = f.read().rstrip()
except OSError:
pass
if not ans and opts.password_env:
ans = os.environ.get(opts.password_env, '')
if not ans and opts.use_password == 'always':
raise SystemExit('No password was found')
if ans and len(ans) > 1024:
raise SystemExit('Specified password is too long')
return ans
# }}}
arg_parser = argparse.ArgumentParser(prog='kitty@', description='Control kitty remotely.')
arg_parser.add_argument('--password', default='', help='''\
A password to use when contacting kitty. This will cause kitty to ask the user
for permission to perform the specified action, unless the password has been
accepted before or is pre-configured in kitty.conf''')
arg_parser.add_argument('--password-file', default='rc-pass', help='''\
A file from which to read the password. Trailing whitespace is ignored. Relative
paths are resolved from the kitty configuration directory. Use - to read from STDIN.
Used if no --password is supplied. Defaults to checking for the
rc-pass file in the kitty configuration directory.''')
arg_parser.add_argument('--password-env', default='KITTY_RC_PASSWORD', help='''\
The name of an environment variable to read the password from.
Used if no --password-file is supplied. Defaults to checking the KITTY_RC_PASSWORD.''')
arg_parser.add_argument('--use-password', default='if-available', choices=('if-available', 'always', 'never'), help='''\
If no password is available, kitty will usually just send the remote control command
without a password. This option can be used to force it to always or never use
the supplied password.''')
args = arg_parser.parse_args()
def populate_cmd(cmd):
raise NotImplementedError()
password = get_password(args)
cmd = {'version': [0, 20, 0]} # use a random version that's fairly old
populate_cmd(cmd)
if password:
encrypt_cmd(cmd, password)
# cmd = {'version': [0, 14, 2], 'cmd': 'ls'}
# cmd = encrypt_cmd(cmd, 'test')
# with open(os.open(os.ctermid(), os.O_RDWR | os.O_CLOEXEC), 'w') as tty_file, raw_mode(tty_file.fileno()):
# print(end=f'\x1bP@kitty-cmd{json.dumps(cmd)}\x1b\\', flush=True, file=tty_file)
# os.read(tty_file.fileno(), 4096)

View File

@@ -1,27 +1,25 @@
Launching programs in new windows/tabs
========================================
The :command:`launch` command
--------------------------------
.. program:: launch
|kitty| has a :code:`launch` action that can be used to run arbitrary programs
in new windows/tabs. It can be mapped to user defined shortcuts in kitty.conf.
It is very powerful and allows sending the contents of
the current window to the launched program, as well as many other options.
in new windows/tabs. It can be mapped to user defined shortcuts in
:file:`kitty.conf`. It is very powerful and allows sending the contents of the
current window to the launched program, as well as many other options.
In the simplest form, you can use it to open a new kitty window running the
shell, as shown below::
map f1 launch
To run a different program simply pass the command line as arguments to
launch::
To run a different program simply pass the command line as arguments to launch::
map f1 launch vim path/to/some/file
To open a new window with the same working directory as the currently
active window::
To open a new window with the same working directory as the currently active
window::
map f1 launch --cwd=current
@@ -29,18 +27,35 @@ To open the new window in a new tab::
map f1 launch --type=tab
To pass the contents of the current screen and scrollback to the started process::
To run multiple commands in a shell, use::
map f1 launch sh -c "ls && exec zsh"
To pass the contents of the current screen and scrollback to the started
process::
map f1 launch --stdin-source=@screen_scrollback less
There are many more powerful options, refer to the complete list below.
.. note::
To avoid duplicating launch actions with frequently used parameters, you can
use :opt:`action_alias` to define launch action aliases. For example::
action_alias launch_tab launch --cwd=current --type=tab
map f1 launch_tab vim
map f2 launch_tab emacs
The :kbd:`F1` key will now open :program:`vim` in a new tab with the current
windows working directory.
The piping environment
--------------------------
When using :option:`launch --stdin-source`, the program to which the data is
piped has a special environment variable declared, ``KITTY_PIPE_DATA`` whose
contents are::
piped has a special environment variable declared, :envvar:`KITTY_PIPE_DATA`
whose contents are::
KITTY_PIPE_DATA={scrolled_by}:{cursor_x},{cursor_y}:{lines},{columns}
@@ -54,45 +69,96 @@ Special arguments
-------------------
There are a few special placeholder arguments that can be specified as part of
the command line. Namely ``@selection`` which is replaced by the current
selection and ``@active-kitty-window-id`` which is replaced by the id of the
currently active kitty window. For example::
the command line:
``@selection``
Replaced by the currently selected text.
``@active-kitty-window-id``
Replaced by the id of the currently active kitty window.
``@line-count``
Replaced by the number of lines in STDIN. Only present when passing some
data to STDIN.
``@input-line-number``
Replaced the number of lines a pager should scroll to match the current
scroll position in kitty. See :opt:`scrollback_pager` for details.
``@scrolled-by``
Replaced by the number of lines kitty is currently scrolled by.
``@cursor-x``
Replaced by the current cursor x position with 1 being the leftmost cell.
``@cursor-y``
Replaced by the current cursor y position with 1 being the topmost cell.
``@first-line-on-screen``
Replaced by the first line on screen. Can be used for pager positioning.
``@last-line-on-screen``
Replaced by the last line on screen. Can be used for pager positioning.
For example::
map f1 launch my-program @active-kitty-window-id
.. _watchers:
Watching launched windows
---------------------------
The :option:`launch --watcher` option allows you to specify python functions
The :option:`launch --watcher` option allows you to specify Python functions
that will be called at specific events, such as when the window is resized or
closed. Simply specify the path to a python module that specifies callback
closed. Simply specify the path to a Python module that specifies callback
functions for the events you are interested in, for example:
.. code-block:: python
def on_resize(boss, window, data):
from typing import Any, Dict
from kitty.boss import Boss
from kitty.window import Window
def on_resize(boss: Boss, window: Window, data: Dict[str, Any]) -> None:
# Here data will contain old_geometry and new_geometry
def on_focus_change(boss, window, data):
# Here data kill contain focused
def on_focus_change(boss: Boss, window: Window, data: Dict[str, Any])-> None:
# Here data will contain focused
def on_close(boss, window, data):
def on_close(boss: Boss, window: Window, data: Dict[str, Any])-> None:
# called when window is closed, typically when the program running in
# it exits.
Every callback is passed a reference to the global ``Boss`` object as well as
the ``Window`` object the action is occurring on. The ``data`` object is
mapping that contains event dependent data. Some useful methods and attributes
for the ``Window`` object are: ``as_text(as_ans=False, add_history=False,
the ``Window`` object the action is occurring on. The ``data`` object is a dict
that contains event dependent data. Some useful methods and attributes for the
``Window`` object are: ``as_text(as_ans=False, add_history=False,
add_wrap_markers=False, alternate_screen=False)`` with which you can get the
contents of the window and its scrollback buffer. Similarly,
``window.child.pid`` is the PID of the processes that was launched
in the window and ``window.id`` is the internal kitty ``id`` of the
window.
in the window and ``window.id`` is the internal kitty ``id`` of the window.
Finding executables
-----------------------
When you specify a command to run as just a name rather than an absolute path,
it is searched for in the system-wide :envvar:`PATH` environment variable. Note
that this **may not** be the value of :envvar:`PATH` inside a shell, as shell
startup scripts often change the value of this variable. If it is not found
there, then a system specific list of default paths is searched. If it is still
not found, then your shell is run and the value of :envvar:`PATH` inside the
shell is used.
See :opt:`exe_search_path` for details and how to control this.
Syntax reference
------------------

View File

@@ -1,5 +1,5 @@
Layouts
============
Arrange windows
-------------------
kitty has the ability to define its own windows that can be tiled next to each
other in arbitrary arrangements, based on *Layouts*, see below for examples:
@@ -8,33 +8,33 @@ other in arbitrary arrangements, based on *Layouts*, see below for examples:
.. figure:: screenshots/screenshot.png
:alt: Screenshot, showing three programs in the 'Tall' layout
:align: center
:scale: 100%
:width: 100%
Screenshot, showing vim, tig and git running in |kitty| with the 'Tall' layout
Screenshot, showing :program:`vim`, :program:`tig` and :program:`git`
running in |kitty| with the *Tall* layout
.. figure:: screenshots/splits.png
:alt: Screenshot, showing windows in the 'Splits' layout
:align: center
:scale: 100%
:width: 100%
Screenshot, showing windows with arbitrary arrangement in the 'Splits'
Screenshot, showing windows with arbitrary arrangement in the *Splits*
layout
There are many different layouts available. They are all enabled by default,
you can switch layouts using :sc:`next_layout`. To control which layouts
are available use :opt:`enabled_layouts`, the first listed layout becomes
the default. Individual layouts and how to use them are described below.
.. contents::
There are many different layouts available. They are all enabled by default, you
can switch layouts using :ac:`next_layout` (:sc:`next_layout` by default). To
control which layouts are available use :opt:`enabled_layouts`, the first listed
layout becomes the default. Individual layouts and how to use them are described
below.
The Stack Layout
------------------
This is the simplest layout it displays a single window using all available
space, other windows are hidden behind it. It has no options::
This is the simplest layout. It displays a single window using all available
space, other windows are hidden behind it. This layout has no options::
enabled_layouts stack
@@ -42,14 +42,14 @@ space, other windows are hidden behind it. It has no options::
The Tall Layout
------------------
Displays one (or optionally more) full height windows on the left half of the
Displays one (or optionally more) full-height windows on the left half of the
screen. Remaining windows are tiled vertically on the right half of the screen.
There are options to control how the screen is split horizontally ``bias``
(an integer between ``10`` and ``90``) and options to control how many
full-height windows there are ``full_size`` (a positive integer). The
``mirrored`` option when set to ``true`` will cause the short windows to be
on the left side of the screen instead of the right. The syntax
for the options is shown below::
``mirrored`` option when set to ``true`` will cause the full-height windows to
be on the right side of the screen instead of the left. The syntax
for the options is::
enabled_layouts tall:bias=50;full_size=1;mirrored=false
@@ -67,24 +67,32 @@ for the options is shown below::
│ │ │
└──────────────┴───────────────┘
In addition, you can map keys to increase or decrease the number of full size
windows, for example::
In addition, you can map keys to increase or decrease the number of full-height
windows, or toggle the mirrored setting, for example::
map ctrl+[ layout_action decrease_num_full_size_windows
map ctrl+] layout_action increase_num_full_size_windows
map ctrl+/ layout_action mirror toggle
map ctrl+y layout_action mirror true
map ctrl+n layout_action mirror false
You can also map a key to change the bias by providing a list of percentages
and it will rotate through the list as you press the key. If you only provide
one number it'll toggle between that percentage and 50, for example::
map ctrl+. layout_action bias 50 62 70
map ctrl+, layout_action bias 62
The Fat Layout
----------------
Displays one (or optionally more) full width windows on the top half of the
screen. Remaining windows are tiled horizontally on the bottom half of the screen.
There are options to control how the screen is split vertically ``bias``
Displays one (or optionally more) full-width windows on the top half of the
screen. Remaining windows are tiled horizontally on the bottom half of the
screen. There are options to control how the screen is split vertically ``bias``
(an integer between ``10`` and ``90``) and options to control how many
full-height windows there are ``full_size`` (a positive integer). The
``mirrored`` option when set to ``true`` will cause the narrow windows to be
on the top of the screen instead of the bottom. The syntax for the options is
shown below::
full-width windows there are ``full_size`` (a positive integer). The
``mirrored`` option when set to ``true`` will cause the full-width windows to be
on the bottom of the screen instead of the top. The syntax for the options is::
enabled_layouts fat:bias=50;full_size=1;mirrored=false
@@ -102,11 +110,15 @@ shown below::
└─────────┴──────────┴─────────┘
This layout also supports the same layout actions as the *Tall* layout, shown above.
The Grid Layout
--------------------
Display windows in a balanced grid with all windows the same size except the
last column if there are not enough windows to fill the grid. Has no options::
last column if there are not enough windows to fill the grid. This layout has no
options::
enabled_layouts grid
@@ -130,30 +142,47 @@ The Splits Layout
This is the most flexible layout. You can create any arrangement of windows
by splitting exiting windows repeatedly. To best use this layout you should
define a few extra keybindings in :file:`kitty.conf`::
define a few extra key bindings in :file:`kitty.conf`::
map F5 launch --location=hsplit
map F6 launch --location=vsplit
map F7 layout_action rotate
# Create a new window splitting the space used by the existing one so that
# the two windows are placed one above the other
map f5 launch --location=hsplit
# Create a new window splitting the space used by the existing one so that
# the two windows are placed side by side
map f6 launch --location=vsplit
# Create a new window splitting the space used by the existing one so that
# the two windows are placed side by side if the existing window is wide or
# one above the other if the existing window is tall.
map f4 launch --location=split
# Rotate the current split, chaging its split axis from vertical to
# horizontal or vice versa
map f7 layout_action rotate
# Move the active window in the indicated direction
map shift+up move_window up
map shift+left move_window left
map shift+right move_window right
map shift+down move_window down
# Switch focus to the neighboring window in the indicated direction
map ctrl+left neighboring_window left
map ctrl+right neighboring_window right
map ctrl+up neighboring_window up
map ctrl+down neighboring_window down
Now you can create horizontal and vertical splits by using :kbd:`F5` and
:kbd:`F6`. You can move them around using :kbd:`shift+arrow keys`
and you can move focus to neighboring windows using :kbd:`ctrl+arrow keys`.
You can switch an existing split from horizontal to vertical and vice versa
using :kbd:`F7`. Finally, windows can be resized using :ref:`window_resizing`.
Windows can be resized using :ref:`window_resizing`. You can swap the windows
in a split using the ``rotate`` action with an argument of ``180`` and rotate
and swap with an argument of ``270``.
This layout takes one option, ``split_axis`` that controls whether new windows
are placed into vertical or horizontal splits, by default::
are placed into vertical or horizontal splits when a :option:`--location <launch
--location>` is not specified. A value of ``horizontal`` (same as
``--location=vsplit``) means when a new split is created the two windows will be
placed side by side and a value of ``vertical`` (same as ``--location=hsplit``)
means the two windows will be placed one on top of the other. By default::
enabled_layouts splits:split_axis=horizontal
@@ -171,12 +200,14 @@ are placed into vertical or horizontal splits, by default::
│ │ │
└──────────────┴───────────────┘
.. versionadded:: 0.17.0
The Splits layout
The Horizontal Layout
------------------------
All windows are shown side by side. Has no options::
All windows are shown side by side. This layout has no options::
enabled_layouts horizontal
@@ -196,7 +227,7 @@ All windows are shown side by side. Has no options::
The Vertical Layout
-----------------------
All windows are shown one below the other. Has no options::
All windows are shown one below the other. This layout has no options::
enabled_layouts vertical
@@ -222,37 +253,38 @@ Resizing windows
You can resize windows inside layouts. Press :sc:`start_resizing_window` (also
:kbd:`⌘+r` on macOS) to enter resizing mode and follow the on-screen
instructions. In a given window layout only some operations may be possible
for a particular window. For example, in the Tall layout you can make the first
instructions. In a given window layout only some operations may be possible for
a particular window. For example, in the *Tall* layout you can make the first
window wider/narrower, but not taller/shorter. Note that what you are resizing
is actually not a window, but a row/column in the layout, all windows in that
row/column will be resized.
You can also define shortcuts in :file:`kitty.conf` to make the active window
wider, narrower, taller, or shorter by mapping to the ``resize_window``
wider, narrower, taller, or shorter by mapping to the :ac:`resize_window`
action, for example::
map ctrl+left resize_window narrower
map ctrl+right resize_window wider
map ctrl+up resize_window taller
map ctrl+down resize_window shorter 3
# reset all windows in the tab to default sizes
map ctrl+home resize_window reset
The ``resize_window`` action has a second, optional argument to control
The :ac:`resize_window` action has a second optional argument to control
the resizing increment (a positive integer that defaults to 1).
Some layouts take options to control their behavior. For example, the ``fat``
and ``tall`` layouts accept the ``bias`` and ``full_size`` options to control
how the available space is split up.
To specify the option, in :opt:`kitty.conf <enabled_layouts>` use::
Some layouts take options to control their behavior. For example, the *Fat*
and *Tall* layouts accept the ``bias`` and ``full_size`` options to control
how the available space is split up. To specify the option, in :opt:`kitty.conf
<enabled_layouts>` use::
enabled_layouts tall:bias=70;full_size=2
This will have ``2`` instead of a single tall window, that occupy ``70%``
instead of ``50%`` of available width. ``bias`` can be any number between 10
and 90.
instead of ``50%`` of available width. ``bias`` can be any number between ``10``
and ``90``.
Writing a new layout only requires about two hundred lines of code, so if there
is some layout you want, take a look at one of the existing layouts in the
`layout <https://github.com/kovidgoyal/kitty/tree/master/kitty/layout>`_
`layout <https://github.com/kovidgoyal/kitty/tree/master/kitty/layout>`__
package and submit a pull request!

View File

@@ -1,17 +1,20 @@
Marks
=================
Mark text on screen
---------------------
kitty has the ability to mark text on the screen based on regular expressions.
This can be useful to highlight words or phrases when browsing output from long
running programs or similar. Lets start with a few examples:
Suppose we want to be able to highlight the word ERROR in the current window.
Add the following to :file:`kitty.conf`::
Examples
----------
Suppose we want to be able to highlight the word :code:`ERROR` in the current
window. Add the following to :file:`kitty.conf`::
map f1 toggle_marker text 1 ERROR
Now when you press :kbd:`F1` all instances of the word :code:`ERROR` will be
Now when you press :kbd:`F1`, all instances of the word :code:`ERROR` will be
highlighted. To turn off the highlighting, press :kbd:`F1` again.
If you want to make it case-insensitive, use::
@@ -19,12 +22,12 @@ If you want to make it case-insensitive, use::
To make it match only complete words, use::
map f1 toggle_marker regex 1 \bERROR\b
map f1 toggle_marker regex 1 \\bERROR\\b
Suppose you want to highlight both :code:`ERROR` and :code:`WARNING`, case
insensitively::
map f1 toggle_marker iregex 1 \bERROR\b 2 \bWARNING\b
map f1 toggle_marker iregex 1 \\bERROR\\b 2 \\bWARNING\\b
kitty supports up to 3 mark groups (the numbers in the commands above). You
can control the colors used for these groups in :file:`kitty.conf` with::
@@ -36,41 +39,40 @@ can control the colors used for these groups in :file:`kitty.conf` with::
.. note::
For performance reasons, matching is done per line only, and only when that line is
altered in any way. So you cannot match text that stretches across multiple
lines.
For performance reasons, matching is done per line only, and only when that
line is altered in any way. So you cannot match text that stretches across
multiple lines.
Creating markers dynamically
---------------------------------
If you want to create markers dynamically rather than pre-defining them in
:file:`kitty.conf` you can do so as follows::
:file:`kitty.conf`, you can do so as follows::
map f1 create_marker
map f2 remove_marker
Then pressing :kbd:`F1` will allow you to enter the marker definition and set
it and pressing :kbd:`F2` will remove the marker. ``create_marker`` accepts
the same syntax as ``toggle_marker`` above. Note that while creating
markers, the prompt has history so you can easily re-use previous marker
expressions.
Then pressing :kbd:`F1` will allow you to enter the marker definition and set it
and pressing :kbd:`F2` will remove the marker. :ac:`create_marker` accepts the
same syntax as :ac:`toggle_marker` above. Note that while creating markers, the
prompt has history so you can easily re-use previous marker expressions.
You can also use the facilities for :doc:`remote-control` to dynamically
add/remove markers.
You can also use the facilities for :doc:`remote-control` to dynamically add or
remove markers.
Scrolling to marks
--------------------
kitty has an action to scroll to the next line that contains a mark. You can
use it by mapping it to some shortcut in :file:`kitty.conf`::
kitty has a :ac:`scroll_to_mark` action to scroll to the next line that contains
a mark. You can use it by mapping it to some shortcut in :file:`kitty.conf`::
map ctrl+p scroll_to_mark prev
map ctrl+n scroll_to_mark next
Then pressing :kbd:`ctrl+p` will scroll to the first line in the scrollback
buffer above the current top line that contains a mark. Pressing :kbd:`ctrl+n`
Then pressing :kbd:`Ctrl+P` will scroll to the first line in the scrollback
buffer above the current top line that contains a mark. Pressing :kbd:`Ctrl+N`
will scroll to show the first line below the current last line that contains
a mark. If you wish to jump to a mark of a specific type, you can add that to
the mapping::
@@ -83,27 +85,26 @@ Which will scroll only to marks of type 1.
The full syntax for creating marks
-------------------------------------
The syntax of the :code:`toggle_marker` command is::
The syntax of the :ac:`toggle_marker` action is::
toggle_marker <marker-type> <specification>
Here :code:`marker-type` is one of:
* :code:`text` - simple substring matching
* :code:`itext` - case-insensitive substring matching
* :code:`regex` - A python regular expression
* :code:`iregex` - A case-insensitive python regular expression
* :code:`function` - An arbitrary function defined in a python file, see
:ref:`marker_funcs`.
* :code:`text` - Simple substring matching
* :code:`itext` - Case-insensitive substring matching
* :code:`regex` - A Python regular expression
* :code:`iregex` - A case-insensitive Python regular expression
* :code:`function` - An arbitrary function defined in a Python file, see :ref:`marker_funcs`.
.. _marker_funcs:
Arbitrary marker functions
-----------------------------
You can create your own marker functions. Create a python file named
:file:`mymarker.py` and in it create a :code:`marker` function. This
function receives the text of the line as input and must yield three numbers,
You can create your own marker functions. Create a Python file named
:file:`mymarker.py` and in it create a :code:`marker` function. This function
receives the text of the line as input and must yield three numbers,
the starting character position, the ending character position and the mark
group (1-3). For example:
@@ -120,6 +121,7 @@ Save this file somewhere and in :file:`kitty.conf`, use::
map f1 toggle_marker function /path/to/mymarker.py
If you save the file in the kitty config directory, you can use::
If you save the file in the :ref:`kitty config directory <confloc>`, you can
use::
map f1 toggle_marker function mymarker.py

View File

@@ -1,14 +1,14 @@
Customizing the actions taken when clicking on links
Scripting the mouse click
======================================================
|kitty| has support for `terminal hyperlinks <https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda>`_. These
are generated by many terminal programs, such as ``ls``, ``gcc``, ``systemd``,
``mdcat``, etc. You can customize exactly what happens when clicking on these hyperlinks
in |kitty|.
|kitty| has support for :term:`terminal hyperlinks <hyperlinks>`. These are
generated by many terminal programs, such as ``ls``, ``gcc``, ``systemd``,
:ref:`tool_mdcat`, etc. You can customize exactly what happens when clicking on
these hyperlinks in |kitty|.
You can tell kitty to take arbitrarily many, complex actions
when a link is clicked. Let us illustrate with some examples, first. Create
the file :file:`~/.config/kitty/open-actions.conf` with the following:
You can tell kitty to take arbitrarily many, complex actions when a link is
clicked. Let us illustrate with some examples, first. Create the file
:file:`~/.config/kitty/open-actions.conf` with the following:
.. code:: conf
@@ -21,6 +21,13 @@ Now, run ``ls --hyperlink=auto`` in kitty and click on the filename of an
image, holding down :kbd:`ctrl+shift`. It will be opened over the current
window. Press any key to close it.
.. note::
The :program:`ls` comes with macOS does not support hyperlink, you need to
install `GNU Coreutils <https://www.gnu.org/software/coreutils/>`__. If you
install it via `Homebrew <https://formulae.brew.sh/formula/coreutils>`__, it
will be :program:`gls`.
Each entry in :file:`open-actions.conf` consists of one or more
:ref:`matching_criteria`, such as ``protocol`` and ``mime`` and one or more
``action`` entries. In the example above kitty uses the :doc:`launch <launch>`
@@ -28,8 +35,8 @@ action which can be used to run external programs. Entries are separated by
blank lines.
Actions are very powerful, anything that you can map to a key combination in
`kitty.conf` can be used as an action. You can specify more than one action per
entry if you like, for example:
:file:`kitty.conf` can be used as an action. You can specify more than one
action per entry if you like, for example:
.. code:: conf
@@ -57,20 +64,30 @@ some special variables, documented below:
``FRAGMENT``
The fragment (unquoted), if any of the URL or the empty string.
``URL_PATH``
The path, query and fragment portions of the URL, without any
unquoting.
.. note::
You can use the :opt:`action_alias` option just as in :file:`kitty.conf` to
define aliases for frequently used actions.
.. _matching_criteria:
Matching criteria
------------------
An entry in :file:`open-actions.conf` must have one or more matching criteria.
URLs that match all criteria for an entry will trigger that entries' actions.
URLs that match all criteria for an entry will trigger that entry's actions.
Processing stops at the first matching entry, so put more specific matching
criteria at the start of the list. Entries in the file are separated by blank
lines. The various available criteria are:
``protocol``
A comma separated list of protocols, for example: ``http, https``. If
absent, there is no constraint on protocol
absent, there is no constraint on protocol.
``url``
A regular expression that must match against the entire (unquoted) URL
@@ -81,11 +98,12 @@ lines. The various available criteria are:
``mime``
A comma separated list of MIME types, for example: ``text/*, image/*,
application/pdf``. You can add MIME types to kitty by creating the
:file:`mime.types` in the kitty configuration directory. Useful if your
system MIME database does not have definitions you need. This file is
in the standard format of one definition per line, like: ``text/plain rst
md``.
application/pdf``. You can add MIME types to kitty by creating a file named
:file:`mime.types` in the :ref:`kitty configuration directory <confloc>`.
Useful if your system MIME database does not have definitions you need. This
file is in the standard format of one definition per line, like:
``text/plain rst md``. Note that the MIME type for directories is
``inode/directory``.
``ext``
A comma separated list of file extensions, for example: ``jpeg, tar.gz``
@@ -93,3 +111,44 @@ lines. The various available criteria are:
``file``
A shell glob pattern that must match the filename, for example:
``image-??.png``
.. _launch_actions:
Scripting the opening of files with kitty on macOS
-------------------------------------------------------
On macOS you can use :guilabel:`Open With` in Finder or drag and drop files and
URLs onto the kitty dock icon to open them with kitty. The default actions are:
* Open text files in your editor and images using the icat kitten.
* Run shell scripts in a shell
* Open SSH urls using the ssh command
These actions can also be executed from the command line by running::
kitty +open file_or_url another_url ...
# macOS only
open -a kitty.app file_or_url another_url ...
Since macOS lacks an official interface to set default URL scheme handlers,
kitty has a command you can use for it. The first argument for is the URL
scheme, and the second optional argument is the bundle id of the app, which
defaults to kitty, if not specified. For example:
.. code-block:: sh
# Set kitty as the handler for ssh:// URLs
kitty +runpy 'from kitty.fast_data_types import cocoa_set_url_handler; import sys; cocoa_set_url_handler(*sys.argv[1:]); print("OK")' ssh
# Set someapp as the handler for xyz:// URLs
kitty +runpy 'from kitty.fast_data_types import cocoa_set_url_handler; import sys; cocoa_set_url_handler(*sys.argv[1:]); print("OK")' xyz someapp.bundle.identifier
You can customize these actions by creating a :file:`launch-actions.conf` file
in the :ref:`kitty config directory <confloc>`, just like the
:file:`open-actions.conf` file above. For example:
.. literalinclude:: ../kitty/open_actions.py
:language: conf
:start-at: # Open script files
:end-before: '''.splitlines()))

309
docs/overview.rst Normal file
View File

@@ -0,0 +1,309 @@
Overview
==============
Design philosophy
-------------------
|kitty| is designed for power keyboard users. To that end all its controls work
with the keyboard (although it fully supports mouse interactions as well). Its
configuration is a simple, human editable, single file for easy reproducibility
(I like to store configuration in source control).
The code in |kitty| is designed to be simple, modular and hackable. It is
written in a mix of C (for performance sensitive parts) and Python (for easy
hackability of the UI). It does not depend on any large and complex UI toolkit,
using only OpenGL for rendering everything.
Finally, |kitty| is designed from the ground up to support all modern terminal
features, such as Unicode, true color, bold/italic fonts, text formatting, etc.
It even extends existing text formatting escape codes, to add support for
features not available elsewhere, such as colored and styled (curly) underlines.
One of the design goals of |kitty| is to be easily extensible so that new
features can be added in the future with relatively little effort.
.. include:: basic.rst
Configuring kitty
-------------------
|kitty| is highly configurable, everything from keyboard shortcuts to painting
frames-per-second. Press :sc:`edit_config_file` in kitty to open its fully
commented sample config file in your text editor. For details see the
:doc:`configuration docs <conf>`.
.. toctree::
:hidden:
conf
.. _layouts:
Layouts
----------
A :term:`layout` is an arrangement of multiple :term:`kitty windows <window>`
inside a top-level :term:`OS window <os_window>`. The layout manages all its
windows automatically, resizing and moving them as needed. You can create a new
:term:`window` using the :sc:`new_window` key combination.
Currently, there are seven layouts available:
* **Fat** -- One (or optionally more) windows are shown full width on the top,
the rest of the windows are shown side-by-side on the bottom
* **Grid** -- All windows are shown in a grid
* **Horizontal** -- All windows are shown side-by-side
* **Splits** -- Windows arranged in arbitrary patterns created using horizontal
and vertical splits
* **Stack** -- Only a single maximized window is shown at a time
* **Tall** -- One (or optionally more) windows are shown full height on the
left, the rest of the windows are shown one below the other on the right
* **Vertical** -- All windows are shown one below the other
By default, all layouts are enabled and you can switch between layouts using
the :sc:`next_layout` key combination. You can also create shortcuts to select
particular layouts, and choose which layouts you want to enable, see
:ref:`conf-kitty-shortcuts.layout` for examples. The first layout listed in
:opt:`enabled_layouts` becomes the default layout.
For more details on the layouts and how to use them see :doc:`the documentation
<layouts>`.
.. toctree::
:hidden:
layouts
Extending kitty
------------------
kitty has a powerful framework for scripting. You can create small terminal
programs called :doc:`kittens <kittens_intro>`. These can used to add features
to kitty, for example, :doc:`editing remote files <kittens/remote_file>` or
:doc:`inputting Unicode characters <kittens/unicode_input>`. They can also be
used to create programs that leverage kitty's powerful features, for example,
:doc:`viewing images <kittens/icat>` or :doc:`diffing files with image support
<kittens/diff>`.
You can :doc:`create your own kittens to scratch your own itches
<kittens/custom>`.
For a list of all the builtin kittens, :ref:`see here <kittens>`.
.. toctree::
:hidden:
kittens_intro
Remote control
------------------
|kitty| has a very powerful system that allows you to control it from the
:doc:`shell prompt, even over SSH <remote-control>`. You can change colors,
fonts, open new :term:`windows <window>`, :term:`tabs <tab>`, set their titles,
change window layout, get text from one window and send text to another, etc.
The possibilities are endless. See the :doc:`tutorial <remote-control>` to get
started.
.. toctree::
:hidden:
remote-control
.. _sessions:
Startup Sessions
------------------
You can control the :term:`tabs <tab>`, :term:`kitty window <window>` layout,
working directory, startup programs, etc. by creating a *session* file and using
the :option:`kitty --session` command line flag or the :opt:`startup_session`
option in :file:`kitty.conf`. For example:
.. code-block:: session
# Set the layout for the current tab
layout tall
# Set the working directory for windows in the current tab
cd ~
# Create a window and run the specified command in it
launch zsh
# Create a window with some environment variables set and run vim in it
launch --env FOO=BAR vim
# Set the title for the next window
launch --title "Chat with x" irssi --profile x
# Create a new tab
# The part after new_tab is the optional tab title which will be displayed in
# the tab bar, if omitted, the title of the active window will be used instead.
new_tab my tab
cd ~/somewhere
# Set the layouts allowed in this tab
enabled_layouts tall,stack
# Set the current layout
layout stack
launch zsh
# Create a new OS window
# Any definitions specifed before the first new_os_window will apply to first OS window.
new_os_window
# Set new window size to 80x24 cells
os_window_size 80c 24c
# Set the --class for the new OS window
os_window_class mywindow
launch sh
# Resize the current window (see the resize_window action for details)
resize_window wider 2
# Make the current window the active (focused) window in its tab
focus
# Make the current OS Window the globally active window (not supported on Wayland)
focus_os_window
launch emacs
.. note::
The :doc:`launch <launch>` command when used in a session file cannot create
new OS windows, or tabs.
Creating tabs/windows
-------------------------------
kitty can be told to run arbitrary programs in new :term:`tabs <tab>`,
:term:`windows <window>` or :term:`overlays <overlay>` at a keypress.
To learn how to do this, see :doc:`here <launch>`.
.. toctree::
:hidden:
launch
Mouse features
-------------------
* You can click on a URL to open it in a browser.
* You can double click to select a word and then drag to select more words.
* You can triple click to select a line and then drag to select more lines.
* You can triple click while holding :kbd:`Ctrl+Alt` to select from clicked
point to end of line.
* You can right click to extend a previous selection.
* You can hold down :kbd:`Ctrl+Alt` and drag with the mouse to select in
columns.
* Selecting text automatically copies it to the primary clipboard (on platforms
with a primary clipboard).
* You can middle click to paste from the primary clipboard (on platforms with a
primary clipboard).
* You can right click while holding :kbd:`Ctrl+Shift` to open the output of the
clicked on command in a pager (requires :ref:`shell_integration`)
* You can select text with kitty even when a terminal program has grabbed the
mouse by holding down the :kbd:`Shift` key
All these actions can be customized in :file:`kitty.conf` as described
:ref:`here <conf-kitty-mouse.mousemap>`.
You can also customize what happens when clicking on :term:`hyperlinks` in
kitty, having it open files in your editor, download remote files, open things
in your browser, etc.
For details, see :doc:`here <open_actions>`.
.. toctree::
:hidden:
open_actions
Font control
-----------------
|kitty| has extremely flexible and powerful font selection features. You can
specify individual families for the regular, bold, italic and bold+italic fonts.
You can even specify specific font families for specific ranges of Unicode
characters. This allows precise control over text rendering. It can comein handy
for applications like powerline, without the need to use patched fonts. See the
various font related configuration directives in :ref:`conf-kitty-fonts`.
.. _scrollback:
The scrollback buffer
-----------------------
|kitty| supports scrolling back to view history, just like most terminals. You
can use either keyboard shortcuts or the mouse scroll wheel to do so. However,
|kitty| has an extra, neat feature. Sometimes you need to explore the scrollback
buffer in more detail, maybe search for some text or refer to it side-by-side
while typing in a follow-up command. |kitty| allows you to do this by pressing
the :sc:`show_scrollback` shortcut, which will open the scrollback buffer in
your favorite pager program (which is :program:`less` by default). Colors and
text formatting are preserved. You can explore the scrollback buffer comfortably
within the pager.
Additionally, you can pipe the contents of the scrollback buffer to an
arbitrary, command running in a new :term:`window`, :term:`tab` or
:term:`overlay`. For example::
map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting less +G -R
Would open the scrollback buffer in a new :term:`window` when you press the
:kbd:`F1` key. See :sc:`show_scrollback <show_scrollback>` for details.
If you want to use it with an editor such as :program:`vim` to get more powerful
features, you can see tips for doing so, in :iss:`this thread <719>`.
If you wish to store very large amounts of scrollback to view using the piping
or :sc:`show_scrollback <show_scrollback>` features, you can use the
:opt:`scrollback_pager_history_size` option.
Integration with shells
---------------------------------
kitty has the ability to integrate closely within common shells, such as `zsh
<https://www.zsh.org/>`__, `fish <https://fishshell.com>`__ and `bash
<https://www.gnu.org/software/bash/>`__ to enable features such as jumping to
previous prompts in the scrollback, viewing the output of the last command in
:program:`less`, using the mouse to move the cursor while editing prompts, etc.
See :doc:`shell-integration` for details.
.. toctree::
:hidden:
shell-integration
.. _cpbuf:
Multiple copy/paste buffers
-----------------------------
In addition to being able to copy/paste from the system clipboard, in |kitty|
you can also setup an arbitrary number of copy paste buffers. To do so, simply
add something like the following to your :file:`kitty.conf`::
map f1 copy_to_buffer a
map f2 paste_from_buffer a
This will allow you to press :kbd:`F1` to copy the current selection to an
internal buffer named ``a`` and :kbd:`F2` to paste from that buffer. The buffer
names are arbitrary strings, so you can define as many such buffers as you need.
Marks
-------------
kitty has the ability to mark text on the screen based on regular expressions.
This can be useful to highlight words or phrases when browsing output from long
running programs or similar. To learn how this feature works, see :doc:`marks`.
.. toctree::
:hidden:
marks

View File

@@ -1,31 +1,32 @@
|kitty| Performance
Performance
===================
The main goals for |kitty| performance are user perceived latency while typing
and "smoothness" while scrolling as well as CPU usage. |kitty| tries hard to find
an optimum balance for these. To that end it keeps a cache of each rendered
glyph in video RAM so that font rendering is not a bottleneck. Interaction
with child programs takes place in a separate thread from rendering, to improve
and "smoothness" while scrolling as well as CPU usage. |kitty| tries hard to
find an optimum balance for these. To that end it keeps a cache of each rendered
glyph in video RAM so that font rendering is not a bottleneck. Interaction with
child programs takes place in a separate thread from rendering, to improve
smoothness.
There are two parameters you can tune to adjust the performance. :opt:`repaint_delay`
and :opt:`input_delay`. These control the artificial delays introduced into the
render loop to reduce CPU usage. See :ref:`conf-kitty-performance` for details.
See also the :opt:`sync_to_monitor` option to further decrease latency at the cost
of some `tearing <https://en.wikipedia.org/wiki/Screen_tearing>`_ while scrolling.
There are two config options you can tune to adjust the performance,
:opt:`repaint_delay` and :opt:`input_delay`. These control the artificial delays
introduced into the render loop to reduce CPU usage. See
:ref:`conf-kitty-performance` for details. See also the :opt:`sync_to_monitor`
option to further decrease latency at the cost of some `screen tearing
<https://en.wikipedia.org/wiki/Screen_tearing>`__ while scrolling.
You can generate detailed per-function performance data using `gperftools
<https://github.com/gperftools/gperftools>`_. Build |kitty| with `make
profile`. Run kitty and perform the task you want to analyse, for example,
scrolling a large file with `less`. After you quit, function call statistics
will be printed to `stdout` and you can use tools like *kcachegrind* for more
detailed analysis.
You can generate detailed per-function performance data using
`gperftools <https://github.com/gperftools/gperftools>`__. Build |kitty| with
``make profile``. Run kitty and perform the task you want to analyse, for
example, scrolling a large file with :program:`less`. After you quit, function
call statistics will be printed to STDOUT and you can use tools like
*KCachegrind* for more detailed analysis.
Here are some CPU usage numbers for the task of scrolling a file continuously
in less. The CPU usage is for the terminal process and X together and is
measured using htop. The measurements are taken at the same font and window
size for all terminals on a ``Intel(R) Core(TM) i7-4820K CPU @ 3.70GHz`` CPU
with a ``Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde XT [Radeon HD
Here are some CPU usage numbers for the task of scrolling a file continuously in
:program:`less`. The CPU usage is for the terminal process and X together and is
measured using :program:`htop`. The measurements are taken at the same font and
window size for all terminals on a ``Intel(R) Core(TM) i7-4820K CPU @ 3.70GHz``
CPU with a ``Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde XT [Radeon HD
7770/8760 / R7 250X]`` GPU.
============== =========================
@@ -49,11 +50,11 @@ admittedly biased, eyes).
.. note::
Some people have asked why kitty does not perform better than terminal XXX in
the test of sinking large amounts of data, such as catting a large text
file. The answer is because this is not a goal for kitty. kitty
deliberately throttles input parsing and output rendering to minimize
resource usage while still being able to sink output faster than any real
world program can produce it. Reducing CPU usage, and hence battery drain
while achieving instant response times and smooth scrolling to a human eye
is a far more important goal.
Some people have asked why kitty does not perform better than terminal XXX
in the test of sinking large amounts of data, such as catting a large text
file. The answer is because this is not a goal for kitty. kitty deliberately
throttles input parsing and output rendering to minimize resource usage
while still being able to sink output faster than any real world program can
produce it. Reducing CPU usage, and hence battery drain while achieving
instant response times and smooth scrolling to a human eye is a far more
important goal.

View File

@@ -1,3 +1,5 @@
:orphan:
Working with the screen and history buffer contents
======================================================

18
docs/press-mentions.rst Normal file
View File

@@ -0,0 +1,18 @@
Press mentions of kitty
========================
`Python Bytes 272 <https://youtu.be/8HKliSbA-gQ?t=815>`__ (Feb 2022)
A podcast demoing some of kitty's coolness
`Console #88 <https://console.substack.com/p/console-88>`__ (Jan 2022)
An interview with Kovid about kitty
Video reviews
--------------
`Review (Jan 2021) <https://www.youtube.com/watch?v=TTzP2zYJn2k>`__
A kitty review by distrotube
`Review (Dec 2020) <https://www.youtube.com/watch?v=KUMkLhFeBrI>`__
A kitty review/intro by TechHut

View File

@@ -1,354 +1,34 @@
Extensions to the xterm protocol
Terminal protocol extensions
===================================
|kitty| has a few extensions to the xterm protocol, to enable advanced features.
These are typically in the form of new or re-purposed escape codes. While these
extensions are currently |kitty| specific, it would be nice to get some of them
adopted more broadly, to push the state of terminal emulators forward.
|kitty| has extensions to the legacy terminal protocol, to enable advanced
features. These are typically in the form of new or re-purposed escape codes.
While these extensions are currently |kitty| specific, it would be nice to get
some of them adopted more broadly, to push the state of terminal emulators
forward.
The goal of these extensions is to be as small and unobtrusive as possible,
while filling in some gaps in the existing xterm protocol. In particular, one
of the goals of this specification is explicitly not to "re-imagine" the tty.
The tty should remain what it is -- a device for efficiently processing text
while filling in some gaps in the existing xterm protocol. In particular, one of
the goals of this specification is explicitly not to "re-imagine" the TTY. The
TTY should remain what it is -- a device for efficiently processing text
received as a simple byte stream. Another objective is to only move the minimum
possible amount of extra functionality into the terminal program itself. This
is to make it as easy to implement these protocol extensions as possible,
thereby hopefully encouraging their widespread adoption.
If you wish to discuss these extensions, propose additions/changes to them
please do so by opening issues in the github bug tracker.
.. contents::
Colored and styled underlines
-------------------------------
|kitty| supports colored and styled (wavy) underlines. This is of particular
use in terminal editors such as vim and emacs to display red, wavy underlines
under mis-spelled words and/or syntax errors. This is done by re-purposing some
SGR escape codes that are not used in modern terminals (`CSI codes
<https://en.wikipedia.org/wiki/ANSI_escape_code#CSI_sequences>`_)
To set the underline style::
<ESC>[4:0m # this is no underline
<ESC>[4:1m # this is a straight underline
<ESC>[4:2m # this is a double underline
<ESC>[4:3m # this is a curly underline
<ESC>[4:4m # this is a dotted underline (not implemented in kitty)
<ESC>[4:5m # this is a dashed underline (not implemented in kitty)
<ESC>[4m # this is a straight underline (for backwards compat)
<ESC>[24m # this is no underline (for backwards compat)
To set the underline color (this is reserved and as far as I can tell not actually used for anything)::
<ESC>[58...m
This works exactly like the codes ``38, 48`` that are used to set foreground and
background color respectively.
To reset the underline color (also previously reserved and unused)::
<ESC>[59m
The underline color must remain the same under reverse video, if it has a
color, if not, it should follow the foreground color.
To detect support for this feature in a terminal emulator, query the terminfo database
for the ``Su`` boolean capability.
Graphics rendering
---------------------
See :doc:`/graphics-protocol` for a description
of this protocol to enable drawing of arbitrary raster images in the terminal.
.. _extended-key-protocol:
Keyboard handling
-------------------
There are various problems with the current state of keyboard handling. They
include:
* No way to use modifiers other than ``Ctrl`` and ``Alt``
* No way to reliably use multiple modifier keys, other than, ``Shift+Alt``.
* No way to handle different types of keyboard events, such as press, release or repeat
* No reliable way to distinguish single ``Esc`` keypresses from the start of a
escape sequence. Currently, client programs use fragile timing related hacks
for this, leading to bugs, for example:
`neovim #2035 <https://github.com/neovim/neovim/issues/2035>`_.
There are already two distinct keyboard handling modes, *normal mode* and
*application mode*. These modes generate different escape sequences for the
various special keys (arrow keys, function keys, home/end etc.) Most terminals
start out in normal mode, however, most shell programs like ``bash`` switch them to
application mode. We propose adding a third mode, named *full mode* that addresses
the shortcomings listed above.
Switching to the new *full mode* is accomplished using the standard private
mode DECSET escape sequence::
<ESC>[?2017h
and to leave *full mode*, use DECRST::
<ESC>[?2017l
The number ``2017`` above is not used for any existing modes, as far as I know.
Client programs can query if the terminal emulator is in *full mode* by using
the standard `DECRQM <https://vt100.net/docs/vt510-rm/DECRQM.html>`_ escape sequence.
The new mode works as follows:
* All printable key presses without modifier keys are sent just as in the
*normal mode*. This means all printable ASCII characters and in addition,
``Enter``, ``Space`` and ``Backspace``. Also any unicode characters generated by
platform specific extended input modes, such as using the ``AltGr`` key. This
is done so that client programs that are not aware of this mode can still
handle basic text entry, so if a *full mode* using program crashes and does
not reset, the user can still issue a ``reset`` command in the shell to restore
normal key handling. Note that this includes pressing the ``Shift`` modifier
and printable keys. Note that this means there are no repeat and release
events for these keys and also for the left and right shift keys.
* For non printable keys and key combinations including one or more modifiers,
an escape sequence encoding the key event is sent. For details on the
escape sequence, see below.
The escape sequence encodes the following properties:
* Type of event: ``press,repeat,release``
* Modifiers pressed at the time of the event
* The actual key being pressed
Schematically::
<ESC>_K<type><modifiers><key><ESC>\
Where ``<type>`` is one of ``p`` -- press, ``r`` -- release and ``t`` -- repeat.
Modifiers is a bitmask represented as a single base64 digit. Shift -- ``0x1``,
Alt -- ``0x2``, Control -- ``0x4`` and Super -- ``0x8``. ``<key>`` is a number
(encoded in base85) corresponding to the key pressed. The key name to number
mapping is defined in :doc:`this table <key-encoding>`.
Client programs must ignore events for keys they do not know. The mapping in
the above table is stable and will never change, however, new codes might be
added to it in the future, for new keys.
For example::
<ESC>_KpGp<ESC>\ is <Ctrl>+<Alt>+x (press)
<ESC>_KrP8<ESC>\ is <Ctrl>+<Alt>+<Shift>+<Super>+PageUp (release)
This encoding means each key event is represented by 8 or 9 printable ascii
only bytes, for maximum robustness.
To see the full mode in action, run::
kitty +kitten key_demo
Support for this mode is indicated by the ``fullkbd`` boolean capability
in the terminfo database, in case querying for it via DECQRM is inconvenient.
.. _ext_styles:
Setting text styles/colors in arbitrary regions of the screen
------------------------------------------------------------------
There already exists an escape code to set *some* text attributes in arbitrary
regions of the screen, `DECCARA
<https://vt100.net/docs/vt510-rm/DECCARA.html>`_. However, it is limited to
only a few attributes. |kitty| extends this to work with *all* SGR attributes.
So, for example, this can be used to set the background color in an arbitrary
region of the screen.
The motivation for this extension is the various problems with the existing
solution for erasing to background color, namely the *background color erase
(bce)* capability. See
`this discussion <https://github.com/kovidgoyal/kitty/issues/160#issuecomment-346470545>`_
and `this FAQ <https://invisible-island.net/ncurses/ncurses.faq.html#bce_mismatches>`_
for a summary of problems with *bce*.
For example, to set the background color to blue in a
rectangular region of the screen from (3, 4) to (10, 11), you use::
<ESC>[2*x<ESC>[4;3;11;10;44$r<ESC>[*x
Saving and restoring the default foreground/background/selection/cursor colors
---------------------------------------------------------------------------------
It is often useful for a full screen application with its own color themes
to set the default foreground, background, selection and cursor colors. This
allows for various performance optimizations when drawing the screen. The
problem is that if the user previously used the escape codes to change these
colors herself, then running the full screen application will lose her
changes even after it exits. To avoid this, kitty introduces a new pair of
*OSC* escape codes to push and pop the current color values from a stack::
<ESC>]30001<ESC>\ # push onto stack
<ESC>]30101<ESC>\ # pop from stack
These escape codes save/restore the so called *dynamic colors*, default
background, default foreground, selection background, selection foreground and
cursor color.
Pasting to clipboard
----------------------
|kitty| implements the OSC 52 escape code protocol to get/set the clipboard
contents (controlled via the :opt:`clipboard_control` setting). There is one
difference in kitty's implementation compared to some other terminal emulators.
|kitty| allows sending arbitrary amounts of text to the clipboard. It does so
by modifying the protocol slightly. Successive OSC 52 escape codes to set the
clipboard will concatenate, so::
<ESC>]52;c;<payload1><ESC>\
<ESC>]52;c;<payload2><ESC>\
will result in the clipboard having the contents ``payload1 + payload2``. To
send a new string to the clipboard send an OSC 52 sequence with an invalid payload
first, for example::
<ESC>]52;c;!<ESC>\
Here ``!`` is not valid base64 encoded text, so it clears the clipboard.
Further, since it is invalid, it should be ignored by terminal emulators
that do not support this extension, thereby making it safe to use, simply
always send it before starting a new OSC 52 paste, even if you aren't chunking
up large pastes, that way kitty won't concatenate your paste, and it will have
no ill-effects in other terminal emulators.
In case you're using software that can't be easily adapted to this
protocol extension, it can be disabled by specifying ``no-append`` to the
:opt:`clipboard_control` setting.
.. _desktop_notifications:
Desktop notifications
---------------------------------
|kitty| implements an extensible escape code (OSC 99) to show desktop
notifications. It is easy to use from shell scripts and fully extensible to
show title and body. Clicking on the notification can optionally focus the
window it came from, and/or send an escape code back to the application running
in that window.
The design of the escape code is partially based on the discussion in
the defunct
`terminal-wg <https://gitlab.freedesktop.org/terminal-wg/specifications/-/issues/13>`_
The escape code has the form::
<OSC> 99 ; metadata ; payload <terminator>
Here ``<OSC>`` is :code:`<ESC>]` and ``<terminator>`` is
:code:`<ESC><backslash>`. The metadata is a section of colon separated
:code:`key=value` pairs. Every key must be a single character from the set
:code:`a-zA-Z` and every value must be a word consisting of characters from
the set :code:`a-zA-Z0-9-_/\+.,(){}[]*&^%$#@!`~`. The payload must be
interpreted based on the metadata section. The two semi-colons *must* always be
present even when no metadata is present.
Before going into details, lets see how one can display a simple, single line
notification from a shell script::
printf '\x1b]99;;Hello world\x1b\\'
To show a message with a title and a body::
printf '\x1b]99;i=1:d=0;Hello world\x1b\\'
printf '\x1b]99;i=1:d=1:p=body;This is cool\x1b\\'
The most important key in the metadata is the ``p`` key, it controls how the
payload is interpreted. A value of ``title`` means the payload is setting the
title for the notification. A value of ``body`` means it is setting the body,
and so on, see the table below for full details.
The design of the escape code is fundamentally chunked, this is because
different terminal emulators have different limits on how large a single escape
code can be. Chunking is accomplished by the ``i`` and ``d`` keys. The ``i``
key is the *notification id* which can be any string containing the characters
``[a-zA-Z0-9_-+.]``. The ``d`` key stands for *done* and
can only take the values ``0`` and ``1``. A value of ``0`` means the
notification is not yet done and the terminal emulator should hold off
displaying it. A value of ``1`` means the notification is done, and should be
displayed. You can specify the title or body multiple times and the terminal
emulator will concatenate them, thereby allowing arbitrarily long text
(terminal emulators are free to impose a sensible limit to avoid
Denial-of-Service attacks).
Both the ``title`` and ``body`` payloads must be either UTF-8 encoded plain
text with no embedded escape codes, or UTF-8 text that is base64 encoded, in
which case there must be an ``e=1`` key in the metadata to indicate the payload
is base64 encoded.
When the user clicks the notification, a couple of things can happen, the
terminal emulator can focus the window from which the notification came, and/or
it can send back an escape code to the application indicating the notification
was activated. This is controlled by the ``a`` key which takes a comma
separated set of values, ``report`` and ``focus``. The value ``focus`` means
focus the window from which the notification was issued and is the default.
``report`` means send an escape code back to the application. The format of the
returned escape code is::
<OSC> 99 ; i=identifier ; <terminator>
The value of ``identifier`` comes from the ``i`` key in the escape code sent by
the application. If the application sends no identifier, then the terminal
*must* use ``i=0``. Actions can be preceded by a negative sign to turn them
off, so for example if you do not want any action, turn off the default
``focus`` action with::
a=-focus
Complete specification of all the metadata keys is in the table below. If a
terminal emulator encounters a key in the metadata it does not understand,
the key *must* be ignored, to allow for future extensibility of this escape
code. Similarly if values for known keys are unknown, the terminal emulator
*should* either ignore the entire escape code or perform a best guess effort
to display it based on what it does understand.
.. note::
It is possible to extend this escape code to allow specifying an icon for
the notification, however, given that some platforms, such as macOS, dont
allow displaying custom icons on a notification, at all, it was decided to
leave it out of the spec for the time being.
Similarly, features such as scheduled notifications could be added in future
revisions.
======= ==================== ========= =================
Key Value Default Description
======= ==================== ========= =================
``a`` Comma separated list ``focus`` What action to perform when the
of ``report``, notification is clicked
``focus``, with
optional leading
``-``
``d`` ``0`` or ``1`` ``1`` Indicates if the notification is
complete or not.
``e`` ``0`` or ``1`` ``0`` If set to ``1`` means the payload is base64 encoded UTF-8,
otherwise it is plain UTF-8 text with no C0 control codes in it
``i`` ``[a-zA-Z0-9-_+.]`` ``0`` Identifier for the notification
``p`` One of ``title`` or ``title`` Whether the payload is the notification title or body. If a
``body``. notification has no title, the body will be used as title.
======= ==================== ========= =================
.. note::
|kitty| also supports the legacy OSC 9 protocol developed by iTerm2 for
desktop notifications.
possible amount of extra functionality into the terminal program itself. This is
to make it as easy to implement these protocol extensions as possible, thereby
hopefully encouraging their widespread adoption.
If you wish to discuss these extensions, propose additions or changes to them,
please do so by opening issues in the `GitHub bug tracker
<https://github.com/kovidgoyal/kitty/issues>`__.
.. toctree::
:maxdepth: 1
underlines
graphics-protocol
keyboard-protocol
file-transfer-protocol
desktop-notifications
unscroll
color-stack
deccara

28
docs/quickstart.rst Normal file
View File

@@ -0,0 +1,28 @@
.. _quickstart:
Quickstart
===========
.. toctree::
:hidden:
binary
build
Pre-built binaries of |kitty| are available for both macOS and Linux. See the
:doc:`binary install instructions </binary>`. You can also :doc:`build from
source </build>`.
Additionally, you can use your favorite package manager to install the |kitty|
package, but note that some Linux distribution packages are woefully outdated.
|kitty| is available in a vast number of package repositories for macOS
and Linux.
.. image:: https://repology.org/badge/tiny-repos/kitty.svg
:target: https://repology.org/project/kitty/versions
:alt: Number of repositories kitty is available in
See :doc:`Configuring kitty <conf>` for help on configuring |kitty| and
:doc:`Invocation <invocation>` for the command line arguments |kitty| supports.
For a tour of kitty's design and features, see the :doc:`overview`.

View File

@@ -1,5 +1,5 @@
Documentation for the kitty remote control protocol
======================================================
The kitty remote control protocol
==================================
The kitty remote control protocol is a simple protocol that involves sending
data to kitty in the form of JSON. Any individual command of kitty has the
@@ -7,23 +7,74 @@ form::
<ESC>P@kitty-cmd<JSON object><ESC>\
Where ``<ESC>`` is the byte ``0x1b``. The JSON object has the form::
Where ``<ESC>`` is the byte ``0x1b``. The JSON object has the form:
.. code-block:: json
{
"cmd": "command name",
"version": <kitty version>,
"no_response": Optional Boolean,
"payload": <Optional JSON object>,
"version": "<kitty version>",
"no_response": "<Optional Boolean>",
"payload": "<Optional JSON object>"
}
The ``version`` above is an array of the form :code:`[0, 14, 2]`. If you are developing a
standalone client, use the kitty version that you are developing against. Using
a version greater than the version of the kitty instance you are talking to,
will cause a failure.
The ``version`` above is an array of the form :code:`[0, 14, 2]`. If you are
developing a standalone client, use the kitty version that you are developing
against. Using a version greater than the version of the kitty instance you are
talking to, will cause a failure.
Set ``no_response`` to ``true`` if you don't want a response from kitty.
The optional payload is a JSON object that is specific to the actual command being sent.
The fields in the object for every command are documented below.
The optional payload is a JSON object that is specific to the actual command
being sent. The fields in the object for every command are documented below.
As a quick example showing how easy to use this protocol is, we will implement
the ``@ ls`` command from the shell using only shell tools.
First, run kitty as::
kitty -o allow_remote_control=socket-only --listen-on unix:/tmp/test
Now, in a different terminal, you can get the pretty printed ``@ ls`` output
with the following command line::
echo -en '\eP@kitty-cmd{"cmd":"ls","version":[0,14,2]}\e\\' | socat - unix:/tmp/test | awk '{ print substr($0, 13, length($0) - 14) }' | jq -c '.data | fromjson' | jq .
.. _rc_crypto:
Encrypted communication
--------------------------
.. versionadded:: 0.26.0
When using the :opt:`remote_control_password` option communication to the
terminal is encrypted to keep the password secure. A public key is used from
the :envvar:`KITTY_PUBLIC_KEY` environment variable. Currently, only one
encryption protocol is supported. The protocol number is present in
:envvar:`KITTY_PUBLIC_KEY` as ``1``. The key data in this environment variable
is :rfc:`Base-85 <1924>` encoded. The algorithm used is `Elliptic Curve Diffie
Helman <https://en.wikipedia.org/wiki/Elliptic-curve_DiffieHellman>`__ with
the `X25519 curve <https://en.wikipedia.org/wiki/Curve25519>`__. A time based
nonce is used to minimise replay attacks. The original JSON command has the
fields: ``password`` and ``timestamp`` added. The timestamp is the number of
nanoseconds since the epoch, excluding leap seconds. Commands with a timestamp
more than 5 minutes from the current time are rejected. The command is then
encrypted using AES-256-GCM in authenticated encryption mode, with a symmetric
key that is derived from the ECDH key-pair by running the shared secret through
SHA-256 hashing, once. An IV of at least 96 bits of CSPRNG data is used. The
tag for authenticated encryption **must** be at least 128 bits long. The tag
**must** authenticate only the value of the ``encrypted`` field. A new command
is created and transmitted that contains the fields:
.. code-block:: json
{
"version": "<kitty version>",
"iv": "base85 encoded IV",
"tag": "base85 encoded AEAD tag",
"pubkey": "base85 encoded ECDH public key of sender",
"encrypted": "The original command encrypted and base85 encoded"
}
.. include:: generated/rc.rst

View File

@@ -1,65 +1,68 @@
:tocdepth: 2
Controlling kitty from scripts or the shell
==============================================
Control kitty from scripts
----------------------------
.. highlight:: sh
Tutorial
----------
|kitty| can be controlled from scripts or the shell prompt. You can open new
windows, send arbitrary text input to any window, name windows and tabs, etc.
windows, send arbitrary text input to any window, change the title of windows
and tabs, etc.
Let's walk through a few examples of controlling |kitty|.
Tutorial
------------
Start by running |kitty| as::
kitty -o allow_remote_control=yes -o enabled_layouts=tall
In order for control to work, :opt:`allow_remote_control` must be enabled in
:file:`kitty.conf`. Here we turn it on explicitly at the command line.
In order for control to work, :opt:`allow_remote_control` or
:opt:`remote_control_password` must be enabled in :file:`kitty.conf`. Here we
turn it on explicitly at the command line.
Now, in the new |kitty| window, enter the command::
kitty @ launch --title Output --keep-focus cat
This will open a new window, running the ``cat`` program that will appear next
to the current window.
This will open a new window, running the :program:`cat` program that will appear
next to the current window.
Let's send some text to this new window::
kitty @ send-text --match cmdline:cat Hello, World
This will make ``Hello, World`` show up in the window running the ``cat`` program.
The :option:`kitty @ send-text --match` option is very powerful, it allows selecting windows by their
titles, the command line of the program running in the window, the working
directory of the program running in the window, etc. See ``kitty @ send-text
--help`` for details.
This will make ``Hello, World`` show up in the window running the :program:`cat`
program. The :option:`kitty @ send-text --match` option is very powerful, it
allows selecting windows by their titles, the command line of the program
running in the window, the working directory of the program running in the
window, etc. See :ref:`kitty @ send-text --help <at-send-text>` for details.
More usefully, you can pipe the output of a command running in one window to
another window, for example::
ls | kitty @ send-text --match title:Output --stdin
ls | kitty @ send-text --match 'title:^Output' --stdin
This will show the output of ls in the output window instead of the current
window. You can use this technique to, for example, show the output of running
``make`` in your editor in a different window. The possibilities are endless.
This will show the output of :program:`ls` in the output window instead of the
current window. You can use this technique to, for example, show the output of
running :program:`make` in your editor in a different window. The possibilities
are endless.
You can even have things you type show up in a different window. Run::
kitty @ send-text --match title:Output --stdin
kitty @ send-text --match 'title:^Output' --stdin
And type some text, it will show up in the output window, instead of the current
window. Type ``Ctrl+D`` when you are ready to stop.
window. Type :kbd:`Ctrl+D` when you are ready to stop.
Now, let's open a new tab::
kitty @ launch --type=tab --tab-title "My Tab" --keep-focus bash
This will open a new tab running the bash shell with the title "My Tab".
We can change the title of the tab with::
We can change the title of the tab to "New Title" with::
kitty @ set-tab-title --match title:My New Title
kitty @ set-tab-title --match 'title:^My' New Title
Let's change the title of the current tab::
@@ -67,80 +70,199 @@ Let's change the title of the current tab::
Now lets switch to the newly opened tab::
kitty @ focus-tab --match title:New
kitty @ focus-tab --match 'title:^New'
Similarly, to focus the previously opened output window (which will also switch
back to the old tab, automatically)::
kitty @ focus-window --match title:Output
kitty @ focus-window --match 'title:^Output'
You can get a listing of available tabs and windows, by running::
kitty @ ls
This outputs a tree of data in JSON format. The top level of the tree is all
operating system kitty windows. Each OS window has an id and a list of tabs.
Each tab has its own id, a title and a list of windows. Each window has an id,
title, current working directory, process id (PID) and command-line of the
process running in the window. You can use this information with :option:`kitty @ focus-window --match`
to control individual windows.
:term:`OS windows <os_window>`. Each OS window has an id and a list of
:term:`tabs <tab>`. Each tab has its own id, a title and a list of :term:`kitty
windows <window>`. Each window has an id, title, current working directory,
process id (PID) and command-line of the process running in the window. You can
use this information with :option:`kitty @ focus-window --match` to control
individual windows.
As you can see, it is very easy to control |kitty| using the
``kitty @`` messaging system. This tutorial touches only the
surface of what is possible. See ``kitty @ --help`` for more details.
As you can see, it is very easy to control |kitty| using the ``kitty @``
messaging system. This tutorial touches only the surface of what is possible.
See ``kitty @ --help`` for more details.
Note that in the example's above, ``kitty @`` messaging works only when run inside a |kitty| window,
not anywhere. But, within a |kitty| window it even works over SSH. If you want to control
|kitty| from programs/scripts not running inside a |kitty| window, you have to implement a couple of
extra steps. First start |kitty| as::
In the example's above, ``kitty @`` messaging works only when run
inside a |kitty| window, not anywhere. But, within a |kitty| window it even
works over SSH. If you want to control |kitty| from programs/scripts not running
inside a |kitty| window, see the section on :ref:`using a socket for remote control <rc_via_socket>`
below.
Note that if all you want to do is run a single |kitty| "daemon" and have
subsequent |kitty| invocations appear as new top-level windows, you can use the
simpler :option:`kitty --single-instance` option, see ``kitty --help`` for that.
.. _rc_via_socket:
Remote control via a socket
--------------------------------
First, start |kitty| as::
kitty -o allow_remote_control=yes --listen-on unix:/tmp/mykitty
The :option:`kitty --listen-on` option tells |kitty| to listen for control messages at the
specified path. See ``kitty --help`` for details. Now you can control this
instance of |kitty| using the :option:`kitty @ --to` command line argument to ``kitty @``. For example::
The :option:`kitty --listen-on` option tells |kitty| to listen for control
messages at the specified UNIX-domain socket. See ``kitty --help`` for details.
Now you can control this instance of |kitty| using the :option:`kitty @ --to`
command line argument to ``kitty @``. For example::
kitty @ --to unix:/tmp/mykitty ls
Note that if all you want to do is run a single |kitty| "daemon" and have subsequent
|kitty| invocations appear as new top-level windows, you can use the simpler :option:`kitty --single-instance`
option, see ``kitty --help`` for that.
The builtin kitty shell
--------------------------
You can explore the |kitty| command language more easily using the builtin |kitty|
shell. Run ``kitty @`` with no arguments and you will be dropped into the |kitty|
shell with completion for |kitty| command names and options.
You can explore the |kitty| command language more easily using the builtin
|kitty| shell. Run ``kitty @`` with no arguments and you will be dropped into
the |kitty| shell with completion for |kitty| command names and options.
You can even open the |kitty| shell inside a running |kitty| using a simple
keyboard shortcut (:sc:`kitty_shell` by default).
.. note:: This has the added advantage that you don't need to use
``allow_remote_control`` to make it work.
:opt:`allow_remote_control` to make it work.
Allowing only some windows to control kitty
----------------------------------------------
If you do not want to allow all programs running in |kitty| to control it, you can selectively
enable remote control for only some |kitty| windows. Simply create a shortcut
such as::
If you do not want to allow all programs running in |kitty| to control it, you
can selectively enable remote control for only some |kitty| windows. Simply
create a shortcut such as::
map ctrl+k launch --allow-remote-control some_program
Then programs running in windows created with that shortcut can use ``kitty @``
to control kitty. Note that any program with the right level of permissions can
still write to the pipes of any other program on the same computer and
therefore can control |kitty|. It can, however, be useful to block programs
running on other computers (for example, over ssh) or as other users.
still write to the pipes of any other program on the same computer and therefore
can control |kitty|. It can, however, be useful to block programs running on
other computers (for example, over SSH) or as other users.
.. note:: You dont need ``allow_remote_control`` to make this work as it is
.. note:: You don't need :opt:`allow_remote_control` to make this work as it is
limited to only programs running in that specific window. Be careful with
what programs you run in such windows, since they can effectively control
kitty, as if you were running with ``allow_remote_control`` turned on.
kitty, as if you were running with :opt:`allow_remote_control` turned on.
You can further restrict what is allowed in these windows by using
:option:`kitty @ launch --remote-control-password`.
Fine grained permissions for remote control
----------------------------------------------
.. versionadded:: 0.26.0
The :opt:`allow_remote_control` option discussed so far is a blunt
instrument, granting the ability to any program running on your computer
or even on remote computers via SSH the ability to use remote control.
You can instead define remote control passwords that can be used to grant
different levels of control to different places. You can even write your
own script to decide which remote control requests are allowed. This is
done using the :opt:`remote_control_password` option in :file:`kitty.conf`.
Set :opt:`allow_remote_control` to :code:`password` to use this feature.
Let's see some examples:
.. code-block:: conf
remote_control_password "control colors" get-colors set-colors
Now, using this password, you can, in scripts run the command::
kitty @ --password="control colors" set-colors background=red
Any script with access to the password can now change colors in kitty using
remote control, but only that and nothing else. You can even supply the
password via the :envvar:`KITTY_RC_PASSWORD` environment variable, or the
file :file:`~/.config/kitty/rc-password` to avoid having to type it repeatedly.
See :option:`kitty @ --password-file` and :option:`kitty @ --password-env`.
The :opt:`remote_control_password` can be specified multiple times to create
different passwords with different capabilities. Run the following to get a
list of all action names::
kitty @ --help
You can even use glob patterns to match action names, for example:
.. code-block:: conf
remote_control_password "control colors" *-colors
If no action names are specified, all actions are allowed.
If ``kitty @`` is run with a password that is not present in
:file:`kitty.conf`, then kitty will interactively prompt the user to allow or
disallow the remote control request. The user can choose to allow or disallow
either just that request or all requests using that password. The user's
decision is remembered for the duration of that kitty instance.
.. note::
For password based authentication to work over SSH, you must pass the
:envvar:`KITTY_PUBLIC_KEY` environment variable to the remote host. The
:doc:`ssh kitten <kittens/ssh>` does this for you automatically. When
using a password, :ref:`rc_crypto` is used to ensure the password
is kept secure. This does mean that using password based authentication
is slower as the entire command is encrypted before transmission. This
can be noticeable when using a command like ``kitty @ set-background-image``
which transmits large amounts of image data. Also, the clock on the remote
system must match (within a few minutes) the clock on the local system.
kitty uses a time based nonce to minimise the potential for replay attacks.
.. _rc_custom_auth:
Customizing authorization with your own program
____________________________________________________________
If the ability to control access by action names is not fine grained enough,
you can define your own Python script to examine every remote control command
and allow/disallow it. To do so create a file in the kitty configuration
directory, :file:`~/.config/kitty/my_rc_auth.py` and add the following
to :file:`kitty.conf`:
.. code-block:: conf
remote_control_password "testing custom auth" my_rc_auth.py
:file:`my_rc_auth.py` should define a :code:`is_cmd_allowed` function
as shown below:
.. code-block:: py
def is_cmd_allowed(pcmd, window, from_socket, extra_data):
cmd_name = pcmd['cmd'] # the name of the command
cmd_payload = pcmd['payload'] # the arguments to the command
# examine the cmd_name and cmd_payload and return True to allow
# the command or False to disallow it. Return None to have no
# effect on the command.
# The command payload will vary from command to command, see
# the rc protocol docs for details. Below is an example of
# restricting the launch command to allow only running the
# default shell.
if cmd_name != 'launch':
return None
if cmd_payload.get('args') or cmd_payload.get('env') or cmd_payload.get('copy_cmdline') or cmd_payload.get('copy_env'):
return False
# prints in this function go to the parent kitty process STDOUT
print('Allowing launch command:', cmd_payload)
return True
.. _rc_mapping:
Mapping key presses to remote control commands
--------------------------------------------------
@@ -148,15 +270,21 @@ Mapping key presses to remote control commands
If you wish to trigger a remote control command easily with just a keypress,
you can map it in :file:`kitty.conf`. For example::
map F1 remote_control set-spacing margin=30
map f1 remote_control set-spacing margin=30
Then pressing the :kbd:`F1` key will set the active window margins to 30.
The syntax for what follows :code:`remote_control` is exactly the same
Then pressing the :kbd:`F1` key will set the active window margins to
:code:`30`. The syntax for what follows :ac:`remote_control` is exactly the same
as the syntax for what follows :code:`kitty @` above.
.. note:: You do not need ``allow_remote_control`` to use these mappings,
as they are not actual remote programs, but are simply a way to resuse
the remote control infrastructure via keybings.
If you wish to ignore errors from the command, prefix the command with an
``!``. For example, the following will not return an error when no windows
are matched::
map f1 remote_control !focus-window --match XXXXXX
.. note:: You do not need :opt:`allow_remote_control` to use these mappings,
as they are not actual remote programs, but are simply a way to resuse the
remote control infrastructure via keybings.
Broadcasting what you type to all kitty windows
@@ -166,16 +294,40 @@ As a simple illustration of the power of remote control, lets
have what we type sent to all open kitty windows. To do that define the
following mapping in :file:`kitty.conf`::
map F1 launch --allow-remote-control kitty +kitten broadcast
map f1 launch --allow-remote-control kitty +kitten broadcast
Now press, F1 and start typing, what you type will be sent to all windows,
Now press :kbd:`F1` and start typing, what you type will be sent to all windows,
live, as you type it.
Documentation for the remote control protocol
The remote control protocol
-----------------------------------------------
If you wish to develop your own client to talk to |kitty|, you
can use the :doc:`rc_protocol`.
If you wish to develop your own client to talk to |kitty|, you can use the
:doc:`remote control protocol specification <rc_protocol>`.
.. _search_syntax:
Matching windows and tabs
----------------------------
Many remote control operations operate on windows or tabs. To select these, the
:code:`--match` option is often used. This allows matching using various
sophisticated criteria such as title, ids, cmdlines, etc. These criteria are
expressions of the form :code:`field:query`. Where :italic:`field` is the field
against which to match and :italic:`query` is the expression to match. They can
be further combined using Boolean operators, best illustrated with some
examples::
title:"My special window" or id:43
title:bash and env:USER=kovid
not id:1
(id:2 or id:3) and title:something
.. toctree::
:hidden:
rc_protocol
.. include:: generated/cli-kitty-at.rst

5
docs/requirements.txt Normal file
View File

@@ -0,0 +1,5 @@
sphinx
furo
sphinx-copybutton
sphinxext-opengraph
sphinx-inline-tabs

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 958 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 40 KiB

BIN
docs/screenshots/themes.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

385
docs/shell-integration.rst Normal file
View File

@@ -0,0 +1,385 @@
.. _shell_integration:
Shell integration
-------------------
kitty has the ability to integrate closely within common shells, such as `zsh
<https://www.zsh.org/>`__, `fish <https://fishshell.com>`__ and `bash
<https://www.gnu.org/software/bash/>`__ to enable features such as jumping to
previous prompts in the scrollback, viewing the output of the last command in
:program:`less`, using the mouse to move the cursor while editing prompts, etc.
.. versionadded:: 0.24.0
Features
-------------
* Open the output of the last command in a pager such as :program:`less`
(:sc:`show_last_command_output`)
* Jump to the previous/next prompt in the scrollback
(:sc:`scroll_to_previous_prompt` / :sc:`scroll_to_next_prompt`)
* Click with the mouse anywhere in the current command to move the cursor there
* Hold :kbd:`Ctrl+Shift` and right-click on any command output in the scrollback
to view it in a pager
* The current working directory or the command being executed are automatically
displayed in the kitty window titlebar/tab title
* The text cursor is changed to a bar when editing commands at the shell prompt
* :ref:`clone_shell` with all environment variables and the working directory
copied
* :ref:`Edit files in new kitty windows <edit_file>` even over SSH
* Glitch free window resizing even with complex prompts. Achieved by erasing
the prompt on resize and allowing the shell to redraw it cleanly.
* Sophisticated completion for the :program:`kitty` command in the shell.
* When confirming a quit command if a window is sitting at a shell prompt,
it is not counted (for details, see :opt:`confirm_os_window_close`)
Configuration
---------------
Shell integration is controlled by the :opt:`shell_integration` option. By
default, all integration features are enabled. Individual features can be turned
off or it can be disabled entirely as well. The :opt:`shell_integration` option
takes a space separated list of keywords:
disabled
Turn off all shell integration. The shell's launch environment is not
modified and :envvar:`KITTY_SHELL_INTEGRATION` is not set. Useful for
:ref:`manual integration <manual_shell_integration>`.
no-rc
Do not modify the shell's launch environment to enable integration. Useful
if you prefer to load the kitty shell integration code yourself, either as
part of :ref:`manually integration <manual_shell_integration>` or because
you have some other software that sets up shell integration.
This will still set the :envvar:`KITTY_SHELL_INTEGRATION` environment
variable when kitty runs the shell.
no-cursor
Turn off changing of the text cursor to a bar when editing shell command
line.
no-title
Turn off setting the kitty window/tab title based on shell state.
Note that for the fish shell kitty relies on fish's native title setting
functionality instead.
no-cwd
Turn off reporting the current working directory. This is used to allow
:ac:`new_window_with_cwd` and similar to open windows logged into remote
machines using the :doc:`ssh kitten <kittens/ssh>` automatically with the
same working directory as the current window.
Note that for the fish shell this will not disable its built-in current
working directory reporting.
no-prompt-mark
Turn off marking of prompts. This disables jumping to prompt, browsing
output of last command and click to move cursor functionality.
no-complete
Turn off completion for the kitty command.
Note that for the fish shell this does not take effect, since fish already
comes with a kitty completion script.
More ways to browse command output
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You can add further key and mouse bindings to browse the output of commands
easily. For example to select the output of a command by right clicking the
mouse on the output, define the following in :file:`kitty.conf`:
.. code:: conf
mouse_map right press ungrabbed mouse_select_command_output
Now, when you right click on the output, the entire output is selected, ready
to be copied.
The feature to jump to previous prompts (
:sc:`scroll_to_previous_prompt` and :sc:`scroll_to_next_prompt`) and mouse
actions (:ac:`mouse_select_command_output` and :ac:`mouse_show_command_output`)
can be integrated with browsing command output as well. For example, define the
following mapping in :file:`kitty.conf`:
.. code:: conf
map f1 show_last_visited_command_output
Now, pressing :kbd:`F1` will cause the output of the last jumped to command or
the last mouse clicked command output to be opened in a pager for easy browsing.
In addition, You can define shortcut to get the first command output on screen.
For example, define the following in :file:`kitty.conf`:
.. code:: conf
map f1 show_first_command_output_on_screen
Now, pressing :kbd:`F1` will cause the output of the first command output on
screen to be opened in a pager.
You can also add shortcut to scroll to the last jumped position. For example,
define the following in :file:`kitty.conf`:
.. code:: conf
map f1 scroll_to_prompt 0
How it works
-----------------
At startup, kitty detects if the shell you have configured (either system wide
or the :opt:`shell` option in :file:`kitty.conf`) is a supported shell. If so,
kitty injects some shell specific code into the shell, to enable shell
integration. How it does so varies for different shells.
.. tab:: zsh
For zsh, kitty sets the :envvar:`ZDOTDIR` environment variable to make zsh
load kitty's :file:`.zshenv` which restores the original value of
:envvar:`ZDOTDIR` and sources the original :file:`.zshenv`. It then loads
the shell integration code. The remainder of zsh's startup process proceeds
as normal.
.. tab:: fish
For fish, to make it automatically load the integration code provided by
kitty, the integration script directory path is prepended to the
:envvar:`XDG_DATA_DIRS` environment variable. This is only applied to the
fish process and will be cleaned up by the integration script after startup.
No files are added or modified.
.. tab:: bash
For bash, kitty starts bash in POSIX mode, using the environment variable
:envvar:`ENV` to load the shell integration script. This prevents bash from
loading any startup files itself. The loading of the startup files is done
by the integration script, after disabling POSIX mode. From the perspective
of those scripts there should be no difference to running vanilla bash.
Then, when launching the shell, kitty sets the environment variable
:envvar:`KITTY_SHELL_INTEGRATION` to the value of the :opt:`shell_integration`
option. The shell integration code reads the environment variable, turns on the
specified integration functionality and then unsets the variable so as to not
pollute the system.
The actual shell integration code uses hooks provided by each shell to send
special escape codes to kitty, to perform the various tasks. You can see the
code used for each shell below:
.. raw:: html
<details>
<summary>Click to toggle shell integration code</summary>
.. tab:: zsh
.. literalinclude:: ../shell-integration/zsh/kitty-integration
:language: zsh
.. tab:: fish
.. literalinclude:: ../shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish
:language: fish
:force:
.. tab:: bash
.. literalinclude:: ../shell-integration/bash/kitty.bash
:language: bash
.. raw:: html
</details>
Shell integration over SSH
----------------------------
The easiest way to have shell integration work when SSHing into remote systems
is to use the :doc:`ssh kitten <kittens/ssh>`. Simply run::
kitty +kitten ssh hostname
And, by magic, you will be logged into the remote system with fully functional
shell integration. Alternately, you can :ref:`setup shell integration manually
<manual_shell_integration>`, by copying the kitty shell integration scripts to
the remote server and editing the shell rc files there, as described below.
.. _clone_shell:
Clone the current shell into a new window
-----------------------------------------------
You can clone the current shell into a new kitty window by simply running the
:command:`clone-in-kitty` command, for example:
.. code-block:: sh
clone-in-kitty
clone-in-kitty --type=tab
clone-in-kitty --title "I am a clone"
This will open a new window running a new shell instance but with all
environment variables and the current working directory copied. This even works
over SSH when using :doc:`kittens/ssh`.
The :command:`clone-in-kitty` command takes almost all the same arguments as the
:doc:`launch <launch>` command, so you can open a new tab instead or a new OS
window, etc. Arguments of launch that can cause code execution or that don't
make sense when cloning are ignored. Most prominently, the following options are
ignored: :option:`--allow-remote-control <launch --allow-remote-control>`,
:option:`--copy-cmdline <launch --copy-cmdline>`, :option:`--copy-env <launch
--copy-env>`, :option:`--stdin-source <launch --stdin-source>`,
:option:`--marker <launch --marker>` and :option:`--watcher <launch --watcher>`.
:command:`clone-in-kitty` can be configured to source arbitrary code in the
cloned window using environment variables. It will automatically clone virtual
environments created by the :link:`Python venv module
<https://docs.python.org/3/library/venv.html>` or :link:`Conda
<https://conda.io/>`. In addition, setting the
env var :envvar:`KITTY_CLONE_SOURCE_CODE` to some shell code will cause that
code to be run in the cloned window with :code:`eval`. Similarly, setting
:envvar:`KITTY_CLONE_SOURCE_PATH` to the path of a file will cause that file to
be sourced in the cloned window. This can be controlled by
:opt:`clone_source_strategies`.
:command:`clone-in-kitty` works by asking the shell to serialize its internal
state (mainly CWD and env vars) and this state is transmitted to kitty and
restored by the shell integration scripts in the cloned window.
.. _edit_file:
Edit files in new kitty windows even over SSH
------------------------------------------------
.. code-block:: sh
edit-in-kitty myfile.txt
edit-in-kitty --type tab --title "Editing My File" myfile.txt
# open myfile.txt at line 75 (works with vim, neovim, emacs, nano, micro)
edit-in-kitty +75 myfile.txt
The :command:`edit-in-kitty` command allows you to seamlessly edit files
in your default :opt:`editor` in new kitty windows. This works even over
SSH (if you use the :doc:`ssh kitten <kittens/ssh>`), allowing you
to easily edit remote files in your local editor with all its bells and
whistles.
The :command:`edit-in-kitty` command takes almost all the same arguments as the
:doc:`launch <launch>` command, so you can open a new tab instead or a new OS
window, etc. Not all arguments are supported, see the discussion in the
:ref:`clone_shell` section above.
In order to avoid remote code execution, kitty will only execute the configured
editor and pass the file path to edit to it.
.. _manual_shell_integration:
Manual shell integration
----------------------------
The automatic shell integration is designed to be minimally intrusive, as such
it wont work for sub-shells, terminal multiplexers, containers, etc.
For such systems, you should setup manual shell integration by adding some code
to your shells startup files to load the shell integration script.
First, in :file:`kitty.conf` set:
.. code-block:: conf
shell_integration disabled
Then in your shell's rc file, add the lines:
.. tab:: zsh
.. code-block:: sh
if test -n "$KITTY_INSTALLATION_DIR"; then
export KITTY_SHELL_INTEGRATION="enabled"
autoload -Uz -- "$KITTY_INSTALLATION_DIR"/shell-integration/zsh/kitty-integration
kitty-integration
unfunction kitty-integration
fi
.. tab:: fish
.. code-block:: fish
if set -q KITTY_INSTALLATION_DIR
set --global KITTY_SHELL_INTEGRATION enabled
source "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish"
set --prepend fish_complete_path "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_completions.d"
end
.. tab:: bash
.. code-block:: sh
if test -n "$KITTY_INSTALLATION_DIR"; then
export KITTY_SHELL_INTEGRATION="enabled"
source "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash"
fi
The value of :envvar:`KITTY_SHELL_INTEGRATION` is the same as that for
:opt:`shell_integration`, except if you want to disable shell integration
completely, in which case simply do not set the
:envvar:`KITTY_SHELL_INTEGRATION` variable at all.
In a container, you will need to install the kitty shell integration scripts
and make sure the :envvar:`KITTY_INSTALLATION_DIR` environment variable is set
to point to the location of the scripts.
Integration with other shells
-------------------------------
There exist third-party integrations to use these features for various other
shells:
* Jupyter console and IPython via a patch (:iss:`4475`)
* `xonsh <https://github.com/xonsh/xonsh/issues/4623>`__
Notes for shell developers
-----------------------------
The protocol used for marking the prompt is very simple. You should consider
adding it to your shell as a builtin. Many modern terminals make use of it, for
example: kitty, iTerm2, WezTerm, DomTerm
Just before starting to draw the PS1 prompt send the escape code::
<OSC>133;A<ST>
Just before starting to draw the PS2 prompt send the escape code::
<OSC>133;A;k=s<ST>
Just before running a command/program, send the escape code::
<OSC>133;C<ST>
Here ``<OSC>`` is the bytes ``0x1b 0x5d`` and ``<ST>`` is the bytes ``0x1b
0x5c``. This is exactly what is needed for shell integration in kitty. For the
full protocol, that also marks the command region, see `the iTerm2 docs
<https://iterm2.com/documentation-escape-codes.html>`_.

View File

@@ -1,7 +1,12 @@
<style>
#support-buttons {
display: flex;
flex-wrap: wrap;
}
.support-button {
box-sizing: border-box;
border-radius: 6px;
box-shadow: rgb(255, 246, 175) 0px 1px 0px 0px;
display: inline-block;
cursor: pointer;
color: rgb(51, 51, 51);
@@ -10,15 +15,16 @@
font-weight: bold;
padding: 8px 24px;
text-decoration: none;
margin-left: 1em;
outline: 0;
border-width: 0;
}
.support-button:hover {
transform: scale(1.5);
transform: scale(1.2);
border: solid 1px rgb(92, 184, 92);
}
.support-button {
outline: 0;
}
.support-button:visited {
color: rgb(51, 51, 51);
outline: 0;
@@ -30,28 +36,34 @@
}
#paypal input[type=submit] {
background: linear-gradient(rgb(255, 236, 100) 5%, rgb(255, 171, 35) 100%) rgb(255, 236, 100);
border: 1px solid rgb(255, 171, 35);
background: linear-gradient(rgb(92, 184, 92) 5%, rgb(62, 142, 62) 100%) rgb(92, 184, 92);
padding-top: 10px; padding-bottom: 10px;
color: rgb(51, 51, 51);
border: 1px solid rgb(92, 184, 92);
}
#liberapay a {
a.support-button {
background: linear-gradient(rgb(92, 184, 92) 5%, rgb(62, 142, 62) 100%) rgb(92, 184, 92);
border: 1px solid rgb(62, 142, 62);
color: rgb(51, 51, 51);
}
#patreon a {
background: linear-gradient(rgb(11, 100, 163) 5%, rgb(5, 45, 73) 100%) rgb(11, 100, 163);
border: 1px solid rgb(5, 45, 73);
color: #eee;
}
</style>
<div id="support-buttons">
<div id="github">
<a class="support-button" href="https://github.com/sponsors/kovidgoyal">Patronage via GitHub</a>
</div>
<div id="patreon">
<a class="support-button" href="https://www.patreon.com/bePatron?u=917933">Patronage via Patreon</a>
</div>
<div id="liberapay">
<a class="support-button" href="https://liberapay.com/kovidgoyal/donate">Patronage via Liberapay</a>
</div>
<div>
<form id="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" title="Contribute to support calibre development">
<input type="hidden" name="cmd" value="_s-xclick" />
@@ -61,9 +73,5 @@
</form>
</div>
<div id="liberapay">
<a class="support-button" href="https://liberapay.com/kovidgoyal/donate">Patronage via Liberapay</a>
</div>
</div>

View File

@@ -1,5 +1,5 @@
Support kitty development
===========================
Support kitty development ❤️
==============================
My goal with |kitty| is to move the stagnant terminal ecosystem forward. To that
end kitty has many foundational features, such as: :doc:`image support
@@ -7,7 +7,7 @@ end kitty has many foundational features, such as: :doc:`image support
:doc:`various enhancements to the terminal protocol <protocol-extensions>`,
etc. These features allow the development of rich terminal applications, such
as :doc:`Side-by-side diff <kittens/diff>` and :doc:`Unicode input
<kittens/unicode-input>`.
<kittens/unicode_input>`.
If you wish to support this mission and see the terminal ecosystem evolve,
consider donating so that I can devote more time to |kitty| development.
@@ -15,8 +15,7 @@ I have personally written `almost all kitty code
<https://github.com/kovidgoyal/kitty/graphs/contributors>`_.
You can choose to make either a one-time payment via PayPal or become a
*patron* of kitty development via the Patreon or Liberapay services
below:
*patron* of kitty development via one of the services below:
.. raw:: html

Some files were not shown because too many files have changed in this diff Show More