11593 Commits

Author SHA1 Message Date
Kovid Goyal
5338fcdc1e
Add a note about why we play with file descriptors 2023-01-26 21:50:10 +05:30
Kovid Goyal
f8991ce3c8
ask kitten: Get readline to work even when stdout is redirected 2023-01-26 21:47:43 +05:30
Kovid Goyal
b408abe304
Move compile_commands.json to build directory 2023-01-26 14:25:22 +05:30
Kovid Goyal
084671b26e
Also preread STDIN when using /dev/stdin as the source 2023-01-26 12:57:12 +05:30
Kovid Goyal
1cc69b3edd
Move pre-read code into a separate function for clarity 2023-01-26 12:49:21 +05:30
Kovid Goyal
d88105319d
clipboard kitten: Allow STDIN to be connected to a program that itself uses the tty directly
Read in STDIN first, and only then start terminal IO, hopefully allowing
the other program to finish its terminal IO before we start.

Fixes #5934
2023-01-26 12:40:08 +05:30
Kovid Goyal
eb50fac8de
Add a test for creation of anonymous tempfiles 2023-01-26 11:51:02 +05:30
Kovid Goyal
4185e30d73
Code to more securely create anonymous temp files on Linux 2023-01-26 11:41:01 +05:30
Kovid Goyal
3a126ffa9d
Restore permissions check on pwfile
just use RW instead of R as the expected mode
2023-01-26 08:48:35 +05:30
Kovid Goyal
4f5e3f6cf1
Fix ruff invocation in ALE 2023-01-26 08:44:16 +05:30
Kovid Goyal
dd6e206f9b
Remove unused import 2023-01-26 08:29:37 +05:30
Kovid Goyal
ea920ffdf9
Merge branch 'master' of https://github.com/schlomie/kitty 2023-01-26 08:21:16 +05:30
Loren Schlomer
366d65f592
Fixes the ssh kitten
kovidgoyal@5e645a7 fixes the password file creation, allowing it to be
unlinked, but read_data_from_shared_memory/1 rejects the shared object
if it is not read only, and will break the ssh kitten for all
platforms.

This change removes the read only check, relying only on the file
ownership check.

This fully fixes #5928

Signed-off-by: Loren Schlomer <me@schlomie.com>
2023-01-25 11:14:12 -08:00
Kovid Goyal
5e645a7be7
Fix ssh kitten not working on FreeBSD
Apparently on FreeBSD one cannot unlink shared mem if it is not created
with write permissions.

Adding IWRITE to the permissions when creating the shared memory is
harmless. It means any process running as the user can either write to
the file or delete it. Deleting was already possible except on FreeBSD.
As for writing, it's needed on FreeBSD for shared memory to be useable
at all, and since processes running as the user can already completely
access all their data, kitty config files, tty pipes, etc. allowing them
to write to the SHM used here doesnt grant any significant new
capability, since they could just write to ssh.conf in the kitty config
folder to get the ssh kitten to do whatever they like.

Fixes #5928
2023-01-25 23:34:31 +05:30
Kovid Goyal
e3040a9c91
Make the various path finding functions thread safe and cache their results 2023-01-25 16:24:27 +05:30
Kovid Goyal
a01d68ed85
... 2023-01-25 16:12:47 +05:30
Kovid Goyal
f070b17fee
Also load ~/.config/kitty/mime.types in Go code 2023-01-25 16:08:12 +05:30
Kovid Goyal
22d562ca41
DRYer 2023-01-25 15:38:23 +05:30
Kovid Goyal
102197fabe
Merge branch 'mime-types' of https://github.com/page-down/kitty 2023-01-25 15:28:40 +05:30
pagedown
83f505e209
Update known textual mimes to Python
Also add default aliases for JavaScript and XML in Go.
2023-01-25 16:42:15 +08:00
Kovid Goyal
5a86bc2411
Add default aliases for YAML and TOML 2023-01-25 11:54:09 +05:30
Kovid Goyal
b9c324586e
Also recognize a few well known MIME types as being textual 2023-01-24 18:30:46 +05:30
Kovid Goyal
41fb3c79c5
DRYer 2023-01-24 18:26:01 +05:30
Kovid Goyal
5066623089
better fix for file completion in Go
When neither extensions for mime are specified assume we want to match
all files.
2023-01-23 18:01:17 +05:30
Kovid Goyal
8e98b4123e
Fix completion for --password-file not completing file names 2023-01-23 17:58:31 +05:30
Kovid Goyal
8f88aab9d2
remove unused code 2023-01-23 17:51:10 +05:30
Kovid Goyal
d8bbb16d5e
Make the single instance data type checked 2023-01-23 17:45:11 +05:30
Kovid Goyal
60791bb57b
Session files: Expand environment variables 2023-01-23 17:34:53 +05:30
Kovid Goyal
11f98592f7
We still need full keyboard protocol for @ send-text 2023-01-23 16:33:08 +05:30
Kovid Goyal
97467acb1f
kitten @ cmd: Dont generate key release events
We dont need them and they sometimes can spill over into the prompt if
the command is very fast.
2023-01-23 16:18:46 +05:30
Kovid Goyal
cc1f0bc3fe
Function to drain controlling tty 2023-01-23 16:07:00 +05:30
Kovid Goyal
a009d6b258
kitty shell: Add completion for help and exit commands 2023-01-23 15:34:45 +05:30
Kovid Goyal
0903ae7b4d
Do not use prewarming for wrapped kittens 2023-01-23 15:21:04 +05:30
Kovid Goyal
35c1ebd3f9
Merge branch 'fix-open-actions-shell' of https://github.com/page-down/kitty 2023-01-23 14:03:54 +05:30
pagedown
352f940010
Fix SHELL env var in open-actions.conf and launch-actions.conf
Only the executable path is used when expanding `$SHELL`.
Also fix the non-working example `{SHELL}` in the documentation.
2023-01-23 14:15:27 +08:00
Kovid Goyal
1f00c27097
Also create an automatic text/plain alias when reading from clipboard 2023-01-22 22:04:53 +05:30
Kovid Goyal
6b2d37366f
Add trailing newline when printing available MIME types 2023-01-22 21:57:17 +05:30
Kovid Goyal
a4075ff041
X11: Fix a crash when listing clipboard MIME types and the clipboard is owned by self
Fixes #5920
2023-01-22 21:19:03 +05:30
Kovid Goyal
7a526d9588
clipboard kitten: When copying, automatically add a text/plain alias if there is at least one text/* MIME and no actual text/plain MIME 2023-01-22 20:41:37 +05:30
Kovid Goyal
5b4e4f032d
ask kitten: Output JSON when used standalone 2023-01-22 11:48:51 +05:30
Kovid Goyal
0a1b399447
... 2023-01-22 08:58:14 +05:30
Kovid Goyal
6a64df1afb
Abort show_error kitten if stdin is a tty 2023-01-22 08:48:55 +05:30
Kovid Goyal
dc1851acdb
Add some messages to kitten help for kittens that are not meant to be run by end users. 2023-01-22 08:46:29 +05:30
Kovid Goyal
096c1e328e
Improve progress printout 2023-01-22 08:41:38 +05:30
Kovid Goyal
1a44c2117b
GitHub requires a User-Agent 2023-01-22 08:00:29 +05:30
Kovid Goyal
bd13238d9b
Should only return ENOTSUPP if SHM_DIR doesnt exist, not the fil we are trying to open 2023-01-21 17:46:37 +05:30
Kovid Goyal
b1c27d4c2f
... 2023-01-21 17:42:50 +05:30
Kovid Goyal
dc0093cb51
SHM FS: Return a not supported error if SHM_DIR does not exist 2023-01-21 17:40:59 +05:30
Kovid Goyal
b1934ce267
kitten: When guessing MIME types use a builtin list as a fallback, generated from the MIME type definitions available on the build system 2023-01-21 17:35:41 +05:30
Kovid Goyal
16f767de7e
Remove unneeded code 2023-01-21 13:20:29 +05:30