Kovid Goyal
8931062a70
hints kitten: Workaround for some broken light color themes that make the hints text color too low contrast to read
...
Fixes #7330
2025-01-17 20:22:10 +05:30
Kovid Goyal
0ffaaff8a7
Fix #8220
2025-01-16 13:21:31 +05:30
Kovid Goyal
334adf9c1a
Ensure temp files and other resources are cleaned up even if kitty crashes or is SIGKILLed
2025-01-05 12:51:59 +05:30
Kovid Goyal
f3db7e7554
diff kitten: Automatically change colors on terminal color scheme change
2025-01-05 06:00:24 +05:30
Kovid Goyal
af8605dabf
bump unicode version to 16
2024-11-10 09:03:52 +05:30
Kovid Goyal
31aa4bc96d
Dont ignore err in close on atomicwrite
2024-09-10 21:53:49 +05:30
Kovid Goyal
8eb0b556b7
diff kitten: Fix a regression that broke diffing against remote files
...
Fixes #7797
2024-08-28 11:00:42 +05:30
Kovid Goyal
7e7050d30e
DRYer
2024-07-23 13:53:02 +05:30
Kovid Goyal
cb84f56ef8
Insist on specifying an output format
2024-07-23 13:47:36 +05:30
Kovid Goyal
8201f0dd0e
Move caching implementation to Python
...
Less code, more performant since the cache is used from Python.
And we can make the Go code a pure image format conversion filter.
2024-07-23 13:37:53 +05:30
Kovid Goyal
eaf71d1ccf
Allow specifying permissions when creating anonymous temp files
2024-07-23 07:28:10 +05:30
Kovid Goyal
d08dcd92c7
Python wrapper to use image to RGBA Go code
2024-07-22 22:39:12 +05:30
Kovid Goyal
fb20c4acb6
Code to convert image at path into cached RGBA data
2024-07-22 21:39:38 +05:30
Kovid Goyal
1b6f74da65
fsync before rename for atomic write
2024-07-22 20:04:13 +05:30
Kovid Goyal
c906314974
change the atomic write functions to work with readers
2024-07-22 15:01:19 +05:30
Kovid Goyal
e45d518082
Remove use of syscall package for flock
...
It is provided by unix package these days
2024-07-09 08:24:57 +05:30
Kovid Goyal
b017cc0c1e
Handle variable fonts like cascadia code that dont have a postfix variation prefix name for some of their faces
2024-06-24 07:54:17 +05:30
Kovid Goyal
802ed976a9
Start work on faces panel
2024-06-24 07:54:15 +05:30
Kovid Goyal
314b2444c7
Use KITTY_PID to find kitty exe when possible
2024-06-24 07:54:14 +05:30
Kovid Goyal
96f8dbbbeb
Get clicking on family names functional
2024-06-24 07:54:13 +05:30
Kovid Goyal
405f5ce148
Use stdlib maps/slices
2024-06-24 07:54:13 +05:30
Kovid Goyal
51472e1e88
Infrastructure for simple internal hyperlink handling
2024-06-24 07:54:13 +05:30
Kovid Goyal
3d98b33076
...
2024-04-09 08:39:42 +05:30
Kovid Goyal
a444b5eccb
Only use raw monotonic time on Linux and macOS
2024-04-09 08:21:20 +05:30
Kovid Goyal
6c64428be9
CLOCK_MONOTONIC_RAW support for Go
2024-04-09 08:04:15 +05:30
Kovid Goyal
55feef8663
Linter fixes
2024-03-22 11:16:02 +05:30
Kovid Goyal
3b74fcb88c
switch to a maintained fork of imaging
2024-03-22 10:38:22 +05:30
Kovid Goyal
e818f01ff2
Ensure palette is large enough to avoid panics with invalid images that have pixels refering to colors not in the palette
2024-03-22 10:01:20 +05:30
Kovid Goyal
e11081ac09
Use exiffix rather than imaging to handle EXIF rotation
...
exiffix works for more formats than just JPEG
2024-03-22 09:35:39 +05:30
Kovid Goyal
210c417d96
...
2024-03-06 10:41:39 +05:30
Kovid Goyal
16d36c46fe
Update to using math/rand/v2
2024-02-25 09:57:43 +05:30
Kovid Goyal
777fd5350b
Add a test for Go flock implementation
2024-02-09 11:54:51 +05:30
Kovid Goyal
a1f2a7df4d
Port new shlex code to Go
2023-12-04 14:14:11 +05:30
Kovid Goyal
314fe4fe4a
Allow launched background process to work with --allow-remote-control
...
Use a dedicated socketpair for such processes. Fixes #6712
2023-10-18 19:56:58 +05:30
Kovid Goyal
c280a28155
Dont use os.Remove on failures in syscall_shm
...
Use shm_unlink instead
2023-09-23 11:16:30 +05:30
Kovid Goyal
24598b846c
...
2023-09-23 11:09:51 +05:30
Kovid Goyal
dc43f0d42f
...
2023-09-23 11:08:55 +05:30
Kovid Goyal
5fede41205
Always use fallocate() on Linux for SHM creation
2023-09-23 10:55:15 +05:30
Kovid Goyal
6619bf33b0
Using fcntl() based fallocate on darwin doesnt work with file descriptors returned by shm_open
2023-09-23 10:39:10 +05:30
Kovid Goyal
38bac98c12
Fix build of fallocate_darwin.go
2023-09-23 10:08:04 +05:30
Kovid Goyal
2e4f3dab41
Use fallocate() rather than truncate() when creating SHM memory
...
With truncate() the OS might not actually allocate the space leading to
a SIGBUS if /dev/shm runs out of space when actually using the mmap.
By using fallocate we ensure that once the SHM mmap is created it wont
fail
2023-09-23 09:53:17 +05:30
Kovid Goyal
7faf216f9e
More linter fixes
2023-09-18 20:59:47 +05:30
Kovid Goyal
863adb3e8d
Go: Fix parsing of nullable colors
...
Fixes #6629
2023-09-15 20:36:24 +05:30
Kovid Goyal
5c4efc0fd7
...
2023-09-14 08:24:43 +05:30
Kovid Goyal
93618842ae
Make a couple of other Set API functions nil-safe
2023-09-12 15:37:24 +05:30
Kovid Goyal
2d7bbf60cc
Fix #6615
2023-09-12 15:34:09 +05:30
Kovid Goyal
d1d888ce19
Remove unnecessary copy of the decoder array
2023-09-04 22:28:18 +05:30
Kovid Goyal
1f4386fd08
...
2023-09-04 21:44:46 +05:30
Kovid Goyal
34e5c7f8aa
Ensure efficient conversion for base85 string API
2023-09-04 21:39:03 +05:30
Kovid Goyal
541c0cdde4
Do not build decode table for base85 until it is actually needed
...
Also make the tests actual tests
2023-09-04 21:32:25 +05:30
Kovid Goyal
0107d1cb89
Import base85.go into tree
...
Upstream is not maintained last commit was six years ago and there
are various improvements to be had in the code
2023-09-04 20:29:20 +05:30
Kovid Goyal
4f72bb9894
Replace utils.Once with stdlib sync.OnceValue
2023-08-09 12:08:42 +05:30
Kovid Goyal
49ea26968c
Bump go version to 1.21
...
Allows us to use the much faster builtin min/max functions
for two variable min/max
2023-08-09 11:58:16 +05:30
Kovid Goyal
341d845b9a
Port calls to slices.Sort functions since they now need a cmp() function rather than a less() function
...
Also rename os.SEEK_* to io.Seek* as the former has been deprecated
2023-08-04 22:50:13 +05:30
Kovid Goyal
ca485cc0f7
Make getting function name a utility function
2023-07-30 19:49:46 +05:30
Kovid Goyal
5881041fcd
Ensure shortduration is no more than 8 chars
2023-07-30 19:49:46 +05:30
Kovid Goyal
b60d15fe75
Make short duration formatter re-useable
2023-07-30 19:49:46 +05:30
Kovid Goyal
b3819d3226
Ensure output.Write is not called outside of the stream decompressor function
2023-07-30 19:49:45 +05:30
Kovid Goyal
301f309444
...
2023-07-30 19:49:45 +05:30
Kovid Goyal
42c9f30618
Change receive code to use new streaming decomp infra
2023-07-30 19:49:45 +05:30
Kovid Goyal
b4d8eaa0fe
...
2023-07-30 19:49:45 +05:30
Kovid Goyal
a210e0c977
Simplify stream decompressor
2023-07-30 19:49:45 +05:30
Kovid Goyal
73ee5b32c9
A better way to wrap go's zlib into a streaming decompressor
2023-07-30 19:49:44 +05:30
Kovid Goyal
08e3dbb8e7
Patcher signature generation implemented
2023-07-30 19:49:42 +05:30
Kovid Goyal
74e0fa3f1d
Show invocation line for failing test
2023-07-30 19:49:40 +05:30
Kovid Goyal
ed6e3dfe2c
Speedup Memset for single val
2023-07-30 19:49:40 +05:30
Kovid Goyal
26c22f0086
Work on creating tests for rsync api
2023-07-30 19:49:40 +05:30
Kovid Goyal
10362c3121
DRYer
2023-07-30 19:49:39 +05:30
Kovid Goyal
dee6210de5
Utility function to initialize struct based on default tags
2023-07-30 19:49:39 +05:30
Kovid Goyal
5d361757a2
more work on the transfer kitten
2023-07-30 19:49:38 +05:30
Kovid Goyal
ff3232547d
More work on transfer kitten porting
2023-07-30 19:49:38 +05:30
Kovid Goyal
55bbf175c6
Port send file mapping tests
2023-07-30 19:49:37 +05:30
Kovid Goyal
be7f276d3e
More work on the transfer kitten
2023-07-30 19:49:37 +05:30
Kovid Goyal
58312fffee
Also detect makefiles as plain text files
2023-07-24 10:53:39 +05:30
Kovid Goyal
51aaea03bf
Go code to get the shell of the current user
2023-06-25 13:12:35 +05:30
Kovid Goyal
2787f305f3
Generic helper to concatenate arbitrary numbers of slices
2023-06-24 09:13:20 +05:30
Kovid Goyal
e59e42a6c2
simplify API of utils.Once
2023-05-26 22:42:07 +05:30
Kovid Goyal
d89c1426d5
Dont use non-writeable locations containing kitty.conf as the config dir
2023-05-26 08:40:47 +05:30
Kovid Goyal
b966013a2b
Make Samefile interface a bit nicer for working with paths
2023-04-17 08:35:50 +05:30
Kovid Goyal
266746c96e
Implement the trim_whitespace option
...
Needed for help text formatting
2023-03-29 21:28:47 +05:30
Kovid Goyal
34526517de
Allow passing multiple options to control how wrapping is done
2023-03-29 20:56:24 +05:30
Kovid Goyal
cb99fbd83c
Dont remove leading and trailing spaces when wrapping
...
Without this we lose some spaces and also there was a case where the
line could end up longer than the specified width.
2023-03-29 20:47:31 +05:30
Kovid Goyal
3f9579d61d
Port the removed walk test to Go
2023-03-27 12:34:31 +05:30
Kovid Goyal
d66da811db
More work on getting images to display in diff
2023-03-27 07:53:57 +05:30
Kovid Goyal
cece795b16
More work on image support for diff
2023-03-27 07:53:57 +05:30
Kovid Goyal
508a61bd1c
More work on diffing images
2023-03-27 07:53:57 +05:30
Kovid Goyal
c745961f47
Nicer error messages for failure to load with Magick
2023-03-27 07:53:57 +05:30
Kovid Goyal
be886f9bf9
Make code for loading images with ImageMagick re-useable
2023-03-27 07:53:57 +05:30
Kovid Goyal
404a775f4b
Start work on image support for new diff kitten
2023-03-27 07:53:57 +05:30
Kovid Goyal
e774deaef1
Fix tabs and carriage returns being incorrectly sanitized
2023-03-27 07:53:56 +05:30
Kovid Goyal
09c6a68804
Fix syntax highlighting of multiline tokens
2023-03-27 07:53:56 +05:30
Kovid Goyal
4c9efb6ff2
Fix bold/dim handling when wrapping
2023-03-27 07:53:56 +05:30
Kovid Goyal
4bc9cf84a3
Micro-optimization
2023-03-27 07:53:56 +05:30
Kovid Goyal
88bd3ee9ca
New SGR codes to turn off bold/dim independently
...
Allows for robust patching of formatting into already formatted
text. Without this it is not possible to turn off bold without
affecting existing dim and vice versa.
2023-03-27 07:53:55 +05:30
Kovid Goyal
c2e549b79c
Implement syntax highlighting
2023-03-27 07:53:55 +05:30
Kovid Goyal
924cd4cadd
Do not add a trailing newline when wrapping
2023-03-27 07:53:55 +05:30
Kovid Goyal
e42b4fd9a6
Decrease allocs when wrapping
2023-03-27 07:53:54 +05:30
Kovid Goyal
18b58c5cf9
Ensure wrapping never results in lines longer than the specified word
2023-03-27 07:53:54 +05:30
Kovid Goyal
648925e83a
More work on porting diff kitten
2023-03-27 07:53:54 +05:30
Kovid Goyal
1c7d1094d4
More work on porting diff kitten
2023-03-27 07:53:54 +05:30
Kovid Goyal
5d8b5ab720
More work on porting diff kitten
2023-03-27 07:53:54 +05:30
Kovid Goyal
e4d936b5ed
More work on porting the diff kitten
2023-03-27 07:53:54 +05:30
Kovid Goyal
293c0ab845
More work on porting the diff kitten
2023-03-27 07:53:54 +05:30
Kovid Goyal
bf1f0c00f4
Port full MIME type guessing to Go
2023-03-27 07:53:54 +05:30
Kovid Goyal
3c550bcd28
More work on porting diff kitten
2023-03-27 07:53:54 +05:30
Kovid Goyal
d208670172
Abstract typical config file loading with path and cli overrides
2023-03-27 07:53:54 +05:30
Kovid Goyal
e2fda5d1c4
...
2023-03-15 15:32:04 +05:30
Kovid Goyal
3803d7e3c2
Use maps package for generic keys/values functions
2023-03-14 22:49:40 +05:30
Kovid Goyal
7ce83e7fd0
Use the generic contains/index from slices instead of our custom one
2023-03-14 22:40:20 +05:30
Kovid Goyal
0c20a4d980
Fix sort with key implementations
2023-03-14 12:54:35 +05:30
Kovid Goyal
c4731771ac
Make style cache thread safe
2023-03-14 12:29:44 +05:30
Kovid Goyal
29dd2438c9
Port the subseq matcher to Go
2023-03-14 12:29:44 +05:30
Kovid Goyal
b088ab91cf
Make code to convert rune offsets to byte offsets re-useable
2023-03-14 12:29:44 +05:30
Kovid Goyal
74c5692b78
Default permission for atomicupdate should be 0644
2023-03-11 10:04:43 +05:30
Kovid Goyal
b76b0c61ed
Port custom processor for hints
2023-03-10 10:45:37 +05:30
Kovid Goyal
0e5ed29d83
Fix generation of url regex for Go
2023-03-09 19:00:56 +05:30
Kovid Goyal
09ceb3c0be
Start work on porting hints kitten to Go
2023-03-09 19:00:56 +05:30
Kovid Goyal
f42090766a
Use the new string scanner everywhere
2023-03-08 13:31:27 +05:30
Kovid Goyal
b8ce441453
A new string scanner thats faster than bufio.Scanner and has zero-allocation
2023-03-08 13:24:20 +05:30
Kovid Goyal
5c87d7f84f
Cleanup ring buffer implementation
2023-03-07 07:43:53 +05:30
Kovid Goyal
716a048e6c
...
2023-03-05 14:02:19 +05:30
Kovid Goyal
a0d30f4dd8
DRYer
2023-03-05 13:41:36 +05:30
Kovid Goyal
c88a171b28
Map should use same order of arguments as pythons map
2023-03-05 12:19:03 +05:30
Kovid Goyal
a2887bb9e0
get rid of utils.Cut since we can now rely on strings.Cut instead
2023-03-04 13:37:55 +05:30
Kovid Goyal
5b160ea599
Use Once for CachedHostname
2023-03-03 15:20:35 +05:30
Kovid Goyal
1bf911a81b
Generate the rowcol diacrticis for Go as well
2023-03-03 14:39:38 +05:30
Kovid Goyal
5b46d990a2
Add Read/Write to the MMap interface
2023-02-28 19:01:15 +05:30
Kovid Goyal
944e036611
DRYer
2023-02-28 15:48:04 +05:30
Kovid Goyal
1b2fe90ed1
Fix askpass.go on shm_syscall based systems
2023-02-28 14:11:27 +05:30
Kovid Goyal
ba1ce996bb
Fix WriteWithSize() on shm_syscall
2023-02-28 13:50:06 +05:30
Kovid Goyal
ce12fd3515
Fix ReadWithSizeAndUnlink on systems that have syscall based mmap
2023-02-28 13:44:09 +05:30
Kovid Goyal
3558d1c274
Finish porting support for color schemes to SSH kitten
2023-02-28 12:08:55 +05:30
Kovid Goyal
c877b2a5cb
Code to dump basic colors from a theme as escape codes
2023-02-27 08:02:22 +05:30
Kovid Goyal
0b09d18b36
Port theme loading code to Go
2023-02-26 20:40:59 +05:30
Kovid Goyal
c113ad6f56
Code to parse ISO8601 timestamps at least semi-robustly
2023-02-26 13:32:35 +05:30
Kovid Goyal
9870c94007
More work on porting the SSH kitten
2023-02-26 08:01:03 +05:30
Kovid Goyal
6b71b58997
Add write API to shm objects
2023-02-26 08:01:03 +05:30
Kovid Goyal
43bcb41a2a
Nicer Set constructor
2023-02-26 08:01:03 +05:30
Kovid Goyal
1df3ef648c
Clean up getting runtime dir on darwin
2023-02-26 08:01:03 +05:30
Kovid Goyal
4d8ccd8e94
...
2023-02-26 08:01:03 +05:30
Kovid Goyal
f40380b05a
More useful Set methods
2023-02-26 08:01:03 +05:30
Kovid Goyal
3703b4dbef
API to conveniently generate secure tokens
2023-02-26 08:01:03 +05:30
Kovid Goyal
0614c63966
Handle XDG_CONFIG_DIRS in Go as well
2023-02-26 08:01:03 +05:30
Kovid Goyal
a84b688038
Embed the data files needed for the ssh kitten into the Go binary
2023-02-26 08:01:03 +05:30
Kovid Goyal
b4b8943e64
Replace some more uses of sync.Once
2023-02-26 08:01:03 +05:30
Kovid Goyal
587d06b295
Replace use of sync.Once
2023-02-26 08:01:03 +05:30
Kovid Goyal
d656017f27
Move SSH askpass implementation into kitten
2023-02-26 08:01:02 +05:30
Kovid Goyal
6f4d89045a
A nicer implementation of sync.Once
...
Doesnt require storing the result of the function in a dedicated global
variable with a dedicated getter function
2023-02-26 08:01:02 +05:30
Kovid Goyal
fbaaca1be9
Function to create symlinks atomically
2023-02-26 08:01:02 +05:30
Kovid Goyal
88077fdbcd
Allow Stat() for MMap objects
2023-02-26 08:01:02 +05:30