Kovid Goyal
1d45cf4f91
Use crypto/rand rather than math/rand
...
Who knows how random math/rand actually is
2023-02-02 06:04:17 +05:30
pagedown
8fe936882d
Docs: Improve usage and help documents for kitten
2023-02-01 17:14:54 +08:00
Kovid Goyal
5eaa935ede
icat: Dont try to further compress PNG images when using stream based transmission
2023-02-01 11:45:01 +05:30
Kovid Goyal
092dc3d01f
...
2023-02-01 11:28:52 +05:30
Kovid Goyal
5c0d477a18
icat kitten: Fix transmission of frame data in direct mode
...
Sometimes frame data is > 2048 but does not compress smaller, which
broke the if statement checking for first loop.
Fixes #5958
2023-02-01 10:51:59 +05:30
Kovid Goyal
414ca86e3f
Remaining fixes from #5962
...
Fixes #5962
2023-02-01 10:26:53 +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
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
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
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
1f00c27097
Also create an automatic text/plain alias when reading from clipboard
2023-01-22 22:04:53 +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
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
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
26ca3f9bad
Simplify code
2023-01-18 16:16:11 +05:30
Kovid Goyal
bf7d27691c
Also add the EINTR fix from previous commit to writing to loop
2023-01-18 16:09:19 +05:30
Kovid Goyal
22532b4805
kitten @: Fix occasional hang until key is pressed while waiting for response from terminal
...
Fixes #5890
2023-01-18 16:07:42 +05:30
Kovid Goyal
2d846f53a1
...
2023-01-18 14:44:40 +05:30
Kovid Goyal
63077e5432
Dont do extremely small reads
2023-01-18 10:13:07 +05:30
Kovid Goyal
5edb1e2d6b
micro-optimization
2023-01-18 09:58:29 +05:30
Kovid Goyal
821f52a748
...
2023-01-17 12:39:41 +05:30
Kovid Goyal
750f2fa4d0
Use go 1.20 facilities for unsafe string <-> bytes
2023-01-17 12:38:54 +05:30
Kovid Goyal
ce161e610f
...
2023-01-17 11:52:06 +05:30
Kovid Goyal
dd5cfe38b7
Update README
2023-01-14 15:56:03 +05:30
Kovid Goyal
6b8e5ea225
Rename kitty-tool to kitten
...
It's easier to type, and cuter.
Also, most, if not all of the TUI parts of
kitty's kittens will eventually be re-written into kitten.
The only downside I can see is that we cant tab complete kitty
anymore, but hopefully there will be less reason to run kitty
from the shell as command line tools migrate to kitten.
Meowrrrr!!!
2023-01-14 15:44:52 +05:30
Kovid Goyal
397ac36011
Also mention terminal multiplxers can cause graphics to fail
2023-01-06 16:36:39 +05:30
Kovid Goyal
02063a5a6a
Make some variables local no need for them to be global
2023-01-06 16:35:17 +05:30
Kovid Goyal
b3926ae9e7
Remove unused code
2023-01-06 16:32:04 +05:30
Kovid Goyal
3743ae50e7
Simplify icat code and write to STDOUT rather than the terminal device
...
The terminal device is now used only for detection.
2023-01-06 16:16:15 +05:30
Kovid Goyal
ddf36383b4
Dont need to fetch the current version since GitHub provides a redirecting constant download URL
2023-01-05 20:09:32 +05:30
Kovid Goyal
a2c68a927e
icat: When using --place ensure screen doesnt scroll by leaving cursor at top-left corner of image.
2023-01-05 19:15:13 +05:30
Kovid Goyal
cab7856495
Finish resize handling for the magick engine
2023-01-05 19:15:13 +05:30
Kovid Goyal
c317c934f3
More work on ImageMagick
2023-01-05 19:15:13 +05:30
Kovid Goyal
4d21be9eb5
Port python's shutil.which()
2023-01-05 19:15:13 +05:30
Kovid Goyal
fd71d2035d
Start work on rendering with ImageMagick
2023-01-05 19:15:13 +05:30
Kovid Goyal
7ebb281855
Allow controlling num of CPUs for images operations
2023-01-05 19:15:13 +05:30
Kovid Goyal
2d3da1db6d
Dont scan all pixels of JPEG images when EXIF rotated to check for opacity
2023-01-05 19:15:13 +05:30
Kovid Goyal
458adf967a
Dont use extra memory for mirror operations
2023-01-05 19:15:13 +05:30
Kovid Goyal
eec4c6b802
Dont transmit animation control commands for non-animated images
2023-01-05 19:15:13 +05:30
Kovid Goyal
0b9b207513
Implement scaling for GIF as well
2023-01-05 19:15:13 +05:30
Kovid Goyal
7e8017604e
Copy comment explaining min gap and set it to the correct value
2023-01-05 19:15:13 +05:30
Kovid Goyal
9cb83a6ec2
...
2023-01-05 19:15:12 +05:30
Kovid Goyal
7c2317d301
Fix divide by zero
2023-01-05 19:15:12 +05:30
Kovid Goyal
7237e5cf9c
Get GIF basically working
2023-01-05 19:15:12 +05:30
Kovid Goyal
cd5dab581b
DRYer
2023-01-05 19:15:12 +05:30
Kovid Goyal
481cebbd29
Transmission format should be per frame
2023-01-05 19:15:12 +05:30
Kovid Goyal
4623f580b9
Get 24 bit RGB transmission working
2023-01-05 19:15:12 +05:30
Kovid Goyal
6291d0d400
Code to check if an image is Opaque
2023-01-05 19:15:12 +05:30
Kovid Goyal
36d82267bb
...
2023-01-05 19:15:12 +05:30
Kovid Goyal
f9feb4954a
Wire up pasting to RGB
2023-01-05 19:15:12 +05:30
Kovid Goyal
d192dcb0d7
Code to convert images to NRGB
2023-01-05 19:15:12 +05:30
Kovid Goyal
143fd6e4dd
Start work on transmitting RGB images
2023-01-05 19:15:12 +05:30
Kovid Goyal
df06578c2d
Implement --scale-up and --place
2023-01-05 19:15:12 +05:30
Kovid Goyal
73a055fe12
Fix failing test
2023-01-05 19:15:12 +05:30
Kovid Goyal
1fa1a478d9
Get --background working
2023-01-05 19:15:12 +05:30
Kovid Goyal
5a3a547c65
Work on adding support for rendering transforms
2023-01-05 19:15:12 +05:30
Kovid Goyal
373ab95f14
Basic go based rendering
2023-01-05 19:15:11 +05:30
Kovid Goyal
7f866b2b1f
Start work on rendering images with Go
2023-01-05 19:15:11 +05:30
Kovid Goyal
24db38ba7e
Set data size for SHM transmission as on some platforms the actual SHM size is not equal to the requested size
2023-01-05 19:15:11 +05:30
Kovid Goyal
efdfaaec30
...
2023-01-05 19:15:11 +05:30
Kovid Goyal
d694f48c91
Get the other two transmission modes working as well
2023-01-05 19:15:11 +05:30
Kovid Goyal
5562a4d52f
Get file mode transmission working for unmodified PNG
2023-01-05 19:15:11 +05:30
Kovid Goyal
ce4c71c465
Start work on the transmit backend
2023-01-05 19:15:11 +05:30
Kovid Goyal
31df90a64e
Dont allow abort while waiting for query response
2023-01-05 19:15:11 +05:30
Kovid Goyal
22d69d24d0
Fix panic when no timers are left after dispatch
2023-01-05 19:15:11 +05:30
Kovid Goyal
d76e0850ae
More work on porting icat
2023-01-05 19:15:11 +05:30
Kovid Goyal
b520882b62
...
2023-01-05 19:15:11 +05:30
Kovid Goyal
79acab1547
More work on porting icat
2023-01-05 19:15:11 +05:30
Kovid Goyal
4690f3c7c0
...
2023-01-05 19:15:11 +05:30
Kovid Goyal
cf1d9eb303
Parse more icat cli flags
2023-01-05 19:15:11 +05:30
Kovid Goyal
ba2a3f228d
Implement --detect-timeout
2023-01-05 19:15:11 +05:30
Kovid Goyal
a757587ea2
Fix SHM on OpenBSD
2023-01-05 19:15:10 +05:30
Kovid Goyal
ea756db544
Get transmission medium detection working
2023-01-05 19:15:10 +05:30
Kovid Goyal
2d1a2c30bf
MMap.Name() should return the SHM name not the full filesystem path
2023-01-05 19:15:10 +05:30
Kovid Goyal
6ace082bc2
Add openbsd and dragonfly support to shm
2023-01-05 19:15:10 +05:30
Kovid Goyal
7e161ea94b
Get syscall based SHM working
2023-01-05 19:15:10 +05:30
Kovid Goyal
d01d5297b8
Start work on a SHM implementation in Go
2023-01-05 19:15:10 +05:30
Kovid Goyal
7a1140cd03
Start work on porting icat to Go
2023-01-05 19:15:10 +05:30
Kovid Goyal
779a7b7deb
...
2023-01-04 11:15:47 +05:30
Kovid Goyal
c83a8b0773
zsh completion; Fix leading ~ in filenames being quoted on insertion into commandline
2023-01-04 11:07:56 +05:30
Kovid Goyal
456af90ad2
Remote control: Allow matching for self window even over sockets when run inside a kitty window
...
Have kitty-tool send the value of KITTY_WINDOW_ID if present.
2022-12-30 12:17:31 +05:30
Kovid Goyal
0f24ce60f8
Fix @ send-text --stdin always assuming STDIN is a tty
2022-12-30 08:29:30 +05:30
Kovid Goyal
e673747ef4
readline: add alt+arrow to move by word default binding. Common on macOS
2022-12-27 10:59:13 +05:30
Kovid Goyal
2e81d00c92
make go fmt happy
2022-12-24 10:53:17 +05:30
Kovid Goyal
cd92d50a0d
Keyboard protocol: Remove CSI R from the allowed encodings of the F3 key as it conflicts with the *Cursor Position Report* escape code
2022-12-24 10:32:28 +05:30
Kovid Goyal
a2c2d81373
Cleanup readline prompt rendering
2022-12-23 15:23:42 +05:30
Kovid Goyal
40093a4702
Add tests for GraphicsCommand serialization
2022-12-18 11:56:30 +05:30
Kovid Goyal
3815cba8f3
Add stringer interface to GraphicsCommand
2022-12-17 15:34:43 +05:30
Kovid Goyal
7410cd62f9
remove unused code
2022-12-17 09:00:44 +05:30
Kovid Goyal
ae0a8e73d2
...
2022-12-17 08:59:56 +05:30
Kovid Goyal
8f3a8c828f
Add an APC to GraphicsCommand parser
2022-12-16 21:05:17 +05:30
Kovid Goyal
bb33f6c0ac
Start work on graphics support in kitty-tool
2022-12-16 18:06:52 +05:30
Kovid Goyal
928becece4
Fix #5773
2022-12-14 15:45:43 +05:30
Kovid Goyal
2b66775f45
explicitly ignore a few errors
2022-12-13 16:19:46 +05:30
Kovid Goyal
d235b673d1
also test \ is escaped
2022-12-13 10:21:19 +05:30
Kovid Goyal
0ab618c2dc
Fix #5767
2022-12-13 10:20:02 +05:30
Kovid Goyal
902373ed20
Also make lists and dicts of strings escape code safe
2022-12-12 19:24:44 +05:30
Kovid Goyal
aac57550c9
rc protocol: Encode strings values in an escape code safe way
...
Go emits UTF-8 encoded JSON not ascii encoded JSON. Still need to fix
lists and dicts of strings
2022-12-12 18:48:54 +05:30
Kovid Goyal
95e05ce9ec
Fix #5761
2022-12-12 16:49:18 +05:30
Kovid Goyal
94410f2866
Handle EBUSY as well
2022-12-06 12:20:20 +05:30
Kovid Goyal
f35ee1bb40
Fix using primary selection with the extended protocol
2022-12-06 11:15:52 +05:30
Kovid Goyal
fe53555dba
Document the additions to the clipboard kitten
2022-12-04 11:37:02 +05:30
Kovid Goyal
b644a42a48
Allow using wildcard mime types when copying from clipboard
2022-12-03 14:06:16 +05:30
Kovid Goyal
6422b323c6
Implement MIME aliases for clipboard
2022-12-03 12:20:03 +05:30
Kovid Goyal
a622a149f6
Allow arbitrary bytes in the mime metadata key
2022-12-03 09:21:36 +05:30
Kovid Goyal
26e8a5186a
Avoid extra roundtrip when only reading clipboard mime types
2022-12-03 08:06:48 +05:30
Kovid Goyal
bde737fa38
Finish implementation of clipboard writing
2022-12-03 08:02:27 +05:30
Kovid Goyal
71e09ba1fb
Fix show_key kitten showing incorrect CSI encoding for F3
2022-12-01 23:33:08 +05:30
Kovid Goyal
f5d2c35755
Move implementation of +hold to Go
...
No need to pay python interpreter startup cost for --hold
2022-12-01 22:34:56 +05:30
Kovid Goyal
38a7fa73e3
Simplify filter mode operation
...
Dont need channels and goroutines as writing in the loop is already
asnychronous
2022-12-01 19:54:57 +05:30
Kovid Goyal
fe75493c37
Better error messages
2022-12-01 18:17:53 +05:30
Kovid Goyal
e187265d04
Dont truncate the output file just to get tis permission bits
2022-12-01 14:13:28 +05:30
Kovid Goyal
0a985134e2
Ensure permissions are correct when using atomic writes
2022-12-01 14:04:52 +05:30
Kovid Goyal
e555d963b1
DRYer
2022-12-01 13:58:06 +05:30
Kovid Goyal
3601488b26
Add a generic Values()
2022-12-01 13:47:06 +05:30
Kovid Goyal
f29ce19097
Reading arbitrary MIME from clipboard now works
2022-12-01 13:35:44 +05:30
Kovid Goyal
3cf874f6e9
Work on implementing read support in the clipboard kitten
2022-11-29 22:07:51 +05:30
Kovid Goyal
8d45f5011b
Add support for the 🔗 role to prettify
2022-11-26 15:34:20 +05:30
Kovid Goyal
b3f096b03b
kitty shell: Fix pressing enter while cursor is not at end of line causes line to be truncated visually
2022-11-26 15:30:49 +05:30
Kovid Goyal
a721ffeb7d
Finish porting clipboard kitten to Go
2022-11-26 15:15:30 +05:30
Kovid Goyal
63a08dc6cc
kitty-tool @: Fix extra newline being printed when a command returns no response
2022-11-26 05:02:32 +05:30
Kovid Goyal
4969611bdb
Handle backslash escapes in :code: blocks
2022-11-25 22:03:13 +05:30
Kovid Goyal
15a7aeff4d
Fix kitty-tool @ send-text not processing ANSI escapes
2022-11-25 21:09:51 +05:30
Kovid Goyal
f9a22d0bc7
Port ANSI escape code parser to Go
2022-11-25 21:03:09 +05:30
Kovid Goyal
4d3f3b5e91
Start moving clipboard kitten to kitty-tool
2022-11-25 12:58:10 +05:30
Kovid Goyal
4fc91dcc03
There should be no trailing space when completing directories for a file match based on patterns
2022-11-21 11:05:36 +05:30
Kovid Goyal
a9bb341e43
Add an option to control max file size for edit-in-kitty
2022-11-18 10:24:38 +05:30
Kovid Goyal
e5e8cc72c6
Make the Unicode database version used available
2022-11-17 20:11:50 +05:30
Kovid Goyal
0af48a4d05
Start work on implementing edit-in-kitty in kitty-tool
2022-11-17 17:05:25 +05:30
Kovid Goyal
5ad2ac259b
When truncating descriptions for completion truncate at word boundaries
2022-11-17 08:29:01 +05:30
Kovid Goyal
a2f022d166
Add support for the repeat escape code to TruncatetoVisualLength()
2022-11-17 08:17:11 +05:30
Kovid Goyal
9db1d581f7
DRYer
2022-11-16 22:37:27 +05:30
Kovid Goyal
b3bc5a5565
...
2022-11-16 22:35:59 +05:30
Kovid Goyal
fc20e8d04b
Fix spurious EOF error when select for reading from the tty fails with a temporary error
2022-11-16 22:32:35 +05:30
Kovid Goyal
86af1d5c16
Wrap EOF errors when doing terminal I/O
2022-11-16 22:23:00 +05:30
Kovid Goyal
d8574f8f85
Fix another bug in readline cursor position tracking
2022-11-16 21:28:36 +05:30
Kovid Goyal
bdd04f37d6
Better error message for kitty shell when running unknown command
2022-11-16 20:53:08 +05:30
Kovid Goyal
a4e43b3925
Use a pager for the help interactive command as well
2022-11-16 20:44:13 +05:30
Kovid Goyal
5e880b92f5
Ensure active hyperlink is cleared when truncating output for completion descriptions
2022-11-16 20:32:42 +05:30
Kovid Goyal
d4c103e53e
zsh breaks when there are escape codes in completion descriptions
2022-11-16 19:32:16 +05:30
Kovid Goyal
e31587ec1e
Ensure auto-generated entries such as --help are present for completion by calling Validate()
2022-11-16 18:05:27 +05:30
Kovid Goyal
81916d0f02
Finish implementation of update-self
2022-11-16 17:44:21 +05:30
Kovid Goyal
ae93d95bbe
Get progress bar rendering working
2022-11-16 16:35:15 +05:30
Kovid Goyal
dd1fcf6855
Support the repeat prev char escape code when calculating the width of a string
2022-11-16 16:25:16 +05:30
Kovid Goyal
463c9debe7
More work on update-self
2022-11-16 13:41:58 +05:30
Kovid Goyal
e70c021371
Some basic TUI widgets ported to Go
2022-11-16 12:48:47 +05:30
Kovid Goyal
0c0b9e6b9c
Fix deadlock in update-self
2022-11-15 22:33:23 +05:30
Kovid Goyal
d54fe3c16a
Start work on a command to self update kitty-tool
2022-11-15 21:29:11 +05:30
Kovid Goyal
36dd5b2d00
More minor loop API additions
2022-11-15 21:00:19 +05:30
Kovid Goyal
87108a18ef
Add a callback for wakeups
2022-11-15 18:01:21 +05:30
Kovid Goyal
234274c1df
...
2022-11-15 16:54:14 +05:30
Kovid Goyal
b42677b343
Utility function to download a URL to a file path with progress reporting
2022-11-15 16:53:43 +05:30
Kovid Goyal
c7d47a59f1
When running kitty-tool without arguments show usage
2022-11-14 16:36:05 +05:30
Kovid Goyal
7eae176b88
Code to build static versions of kitty-tool
2022-11-14 16:27:19 +05:30
Kovid Goyal
1881f4582e
...
2022-11-14 15:42:09 +05:30
Kovid Goyal
a5d05a2954
...
2022-11-14 15:42:09 +05:30
Kovid Goyal
59b43ee844
prettify :option:--xyz> better
2022-11-14 15:42:09 +05:30
Kovid Goyal
29bde6c72c
Improve formatting of completion entries with descriptions
2022-11-14 15:42:09 +05:30
Kovid Goyal
a7ce642a00
Fix rendering in cells
2022-11-14 15:42:08 +05:30
Kovid Goyal
723a9c91b5
Get completion basically working
2022-11-14 15:42:08 +05:30
Kovid Goyal
9e2c96653f
More work on readline completion
2022-11-14 15:42:08 +05:30
Kovid Goyal
4974219e0f
Add function to shlex for completion
...
Also remove the google header since we have diverged from
the original a fair bit. Add a link to the original for credit.
2022-11-14 15:42:08 +05:30
Kovid Goyal
a4de4b7c6f
Report stream start position for tokens
2022-11-14 15:42:08 +05:30
Kovid Goyal
eae4899df4
Use a string builder instead of appending to a slice
2022-11-14 15:42:08 +05:30
Kovid Goyal
87b4800fdf
Get rid of comment parsing from shlex
...
POSIX does not define comments
2022-11-14 15:42:08 +05:30
Kovid Goyal
64156fd6e6
Have the shlex tokenizer return space tokens as well
2022-11-14 15:42:08 +05:30
Kovid Goyal
1485981b11
Have the shlex tokenizer track position in stream and return defined error types
2022-11-14 15:42:08 +05:30
Kovid Goyal
8d76cf8d32
Import the google shlex package as we need more sophisticated parsing
2022-11-14 15:42:08 +05:30
Kovid Goyal
7c23536bfe
Start work on readline completions
2022-11-14 15:42:08 +05:30
Kovid Goyal
f919efcd42
Move basic multi key shortcut handling into its own package
2022-11-14 15:42:08 +05:30
Kovid Goyal
dc787a6529
Allow pretty printing members of the Action enum
2022-11-14 15:42:08 +05:30
Kovid Goyal
cfb6d93dc0
Move cursor to end of input when traversing history list
2022-11-14 15:42:08 +05:30
Kovid Goyal
1523fef000
tests for history searching
2022-11-14 15:42:08 +05:30
Kovid Goyal
31dcb13836
cursor_y should be zero when resetting
2022-11-14 15:42:07 +05:30
Kovid Goyal
0c82832356
more work on history search
2022-11-14 15:42:07 +05:30
Kovid Goyal
ffea66357a
Start work on incremental history search
2022-11-14 15:42:07 +05:30
Kovid Goyal
6b48624b81
Reset keyboard state when resetting text
2022-11-14 15:42:07 +05:30
Kovid Goyal
5a425ccaad
Implement number args for repeats
2022-11-14 15:42:07 +05:30
Kovid Goyal
2f2dbfb45f
Cleanup prompt handling
2022-11-14 15:42:07 +05:30
Kovid Goyal
13a266aa42
Map ctrl+c to abort the current line
2022-11-14 15:42:07 +05:30
Kovid Goyal
8ad55f7562
Add some tests for history
2022-11-14 15:42:07 +05:30
Kovid Goyal
e1ab2383b3
Add basic history operations
2022-11-14 15:42:07 +05:30
Kovid Goyal
8574e136cd
Store cwd in history
2022-11-14 15:42:07 +05:30
Kovid Goyal
c8e8cb5ad5
Add some tests for yanking
2022-11-14 15:42:07 +05:30
Kovid Goyal
22f7145e34
Add yank actions
2022-11-14 15:42:07 +05:30
Kovid Goyal
3237db00fc
Implement word killing actions
2022-11-14 15:42:06 +05:30
Kovid Goyal
ea583f60b3
Start work on kill ring
2022-11-14 15:42:06 +05:30
Kovid Goyal
b7816d26be
Implement clear screen c-l binding
2022-11-14 15:42:06 +05:30
Kovid Goyal
19bf07abd9
Use the more efficient cell iterator api for single char horizontal cursor movement as well
2022-11-14 15:42:06 +05:30
Kovid Goyal
a008c627e3
Implement bindings for moving by simple word
2022-11-14 15:42:06 +05:30
Kovid Goyal
0068ae8f66
An easy to use iterator to iterate over the cells in a string
2022-11-14 15:42:06 +05:30
Kovid Goyal
5436408463
Fix the escape code parser not preserving complete utf-8 state between calls to ParseBytes()
...
Also allow it to be driven byte-by-byte
2022-11-14 15:42:06 +05:30
Kovid Goyal
d260d2f480
Add some test for vertical movement
2022-11-14 15:42:06 +05:30
Kovid Goyal
00ef9c1955
Implement vertical cursor movement
2022-11-14 15:42:06 +05:30
Kovid Goyal
5509673ff3
More tests
2022-11-14 15:42:06 +05:30
Kovid Goyal
3c4a411cad
Rewrite the readline redraw code to make the screen lines explicit
2022-11-14 15:42:06 +05:30
Kovid Goyal
260249491d
Avoid Querying screen size on every resize
2022-11-14 15:42:05 +05:30
Kovid Goyal
595a78c956
DRYer
2022-11-14 15:42:05 +05:30
Kovid Goyal
cbbf8a2d34
Port output of active window and tab ids at shell startup
2022-11-14 15:42:05 +05:30
Kovid Goyal
88567f69b2
Start work on history support for readline
2022-11-14 15:42:05 +05:30
Kovid Goyal
fe91af5e09
Go stdlib doesnt even have a way to lock files
2022-11-14 15:42:05 +05:30
Kovid Goyal
5e2255591c
Dont send invalid kitty-cmd escape code over tty
2022-11-14 15:42:05 +05:30
Kovid Goyal
b89dfc6d1d
Actually run the remote control commands from the shell
2022-11-14 15:42:05 +05:30
Kovid Goyal
59edf1d349
Code to show help
2022-11-14 15:42:05 +05:30
Kovid Goyal
9419fbc77c
Fix rendering when line wraps
2022-11-14 15:42:05 +05:30
Kovid Goyal
834385baff
Improve performance when pasting large amounts of text into readline by not redrawing on every char
2022-11-14 15:42:05 +05:30
Kovid Goyal
c0f17c279e
Add a generic ring buffer
...
Go's stdlib is very anemic
2022-11-14 15:42:05 +05:30
Kovid Goyal
7264bea8c9
Fix selector incorrectly marking fd as ready on EINTR
2022-11-14 15:42:04 +05:30
Kovid Goyal
1058c999c8
...
2022-11-14 15:42:04 +05:30
Kovid Goyal
bf7dd1c369
Fix multiline prompts
2022-11-14 15:42:04 +05:30
Kovid Goyal
936a7a5f97
Dont write escape code for zero movement
2022-11-14 15:42:04 +05:30
Kovid Goyal
350060e0f6
...
2022-11-14 15:42:04 +05:30
Kovid Goyal
430bd23870
Fix decoding of letter trailer CSI key event
2022-11-14 15:42:04 +05:30
Kovid Goyal
9f2b2eac85
More work on shell
2022-11-14 15:42:04 +05:30
Kovid Goyal
fd36435262
Add some default readline bindings
2022-11-14 15:42:04 +05:30
Kovid Goyal
27418eed88
Beep when action could not be performed
2022-11-14 15:42:04 +05:30
Kovid Goyal
48f1690913
Wire up key event handling
2022-11-14 15:42:04 +05:30
Kovid Goyal
eff239a195
Code to erase character ranges
2022-11-14 15:42:04 +05:30
Kovid Goyal
5e5cae8391
Code to move cursor right
2022-11-14 15:42:04 +05:30
Kovid Goyal
57310a772a
Code to move cursor left
2022-11-14 15:42:04 +05:30
Kovid Goyal
066465bce7
Some tests for add_text
2022-11-14 15:42:04 +05:30
Kovid Goyal
1792c2268a
Start writing tests for readline internal functions
2022-11-14 15:42:04 +05:30
Kovid Goyal
32059dba7e
More work on readline
2022-11-14 15:42:03 +05:30
Kovid Goyal
c8296a44eb
More work on readline
2022-11-14 15:42:03 +05:30
Kovid Goyal
565526624f
Start work on porting kitty shell to Go
2022-11-14 15:42:03 +05:30
Kovid Goyal
e536ef7844
Suggestions for sub command names as well
2022-11-14 15:42:03 +05:30
Kovid Goyal
0dab006733
Allow un-ambiguous prefixes for command names
2022-11-14 15:42:03 +05:30
Kovid Goyal
75ead358a2
Show suggestions for options based on levenshtein distance
2022-11-14 15:42:03 +05:30
Kovid Goyal
654bd23109
DRYer
2022-11-14 15:42:03 +05:30
Kovid Goyal
6b04c42730
update wcswidth go version to match unicode 15 update in master
2022-11-14 15:42:03 +05:30
Kovid Goyal
74b1cac344
Allow using unabiguous long option prefixes
2022-11-14 15:42:03 +05:30
Kovid Goyal
2633356842
No need to use a map
2022-11-14 15:42:02 +05:30
Kovid Goyal
3bd4fd999a
All completion tests pass again
2022-11-14 15:42:02 +05:30
Kovid Goyal
262e2fb7a3
Various fixes from the completion merge
2022-11-14 15:42:02 +05:30
Kovid Goyal
97716fea8b
More work on merging completions with parse tree
2022-11-14 15:42:02 +05:30
Kovid Goyal
bf74413c1f
Work on merging completion tree with parse tree
2022-11-14 15:42:02 +05:30
Kovid Goyal
79ca0408e7
split up types.go
2022-11-14 15:42:02 +05:30
Kovid Goyal
97acb60981
Move completion package into cli
2022-11-14 15:42:02 +05:30
Kovid Goyal
e608a945de
Output version information at bottom of help
2022-11-14 15:42:02 +05:30
Kovid Goyal
5771bd0c01
Make adding subcommands a bit nicer
2022-11-14 15:42:02 +05:30
Kovid Goyal
4396dede85
Get rid of the cobra dependency
2022-11-14 15:42:02 +05:30
Kovid Goyal
90c1745976
Fix parsing of list options
2022-11-14 15:42:02 +05:30
Kovid Goyal
c4ab964d09
Tests for CLI parsing
2022-11-14 15:42:02 +05:30
Kovid Goyal
04022ed363
Various fixes to CLI parsing
2022-11-14 15:42:02 +05:30
Kovid Goyal
79cfc1e70a
Move kitty-tool __complete__ to use the new CLI framework
2022-11-14 15:42:01 +05:30
Kovid Goyal
e7c14c78d0
Work on outputting help for commands
2022-11-14 15:42:01 +05:30
Kovid Goyal
cb2389efa5
Use the standard library deque
...
Drops a dependency
2022-11-14 15:42:01 +05:30
Kovid Goyal
4316018966
...
2022-11-14 15:42:01 +05:30
Kovid Goyal
a0bf6177e2
Use a LRUCache rather than an Unbounded one
2022-11-14 15:42:01 +05:30
Kovid Goyal
3078b9074a
Also report submatch positions
2022-11-14 15:42:01 +05:30
Kovid Goyal
dffb87ced9
Make the cache re-useable
2022-11-14 15:42:01 +05:30
Kovid Goyal
4adea5b7fe
Make ReplaceAll re-useable
2022-11-14 15:42:01 +05:30
Kovid Goyal
317b108497
Allow using :role:'payload' in addition to :role:payload as the former can be used in Go `` string literals
2022-11-14 15:42:01 +05:30
Kovid Goyal
7c41737370
Couple more errors found by linting
2022-11-14 15:42:01 +05:30
Kovid Goyal
8221713995
Allow defining options using a struct
2022-11-14 15:42:01 +05:30
Kovid Goyal
ef49634353
Fix some issues reported by staticcheck
2022-11-14 15:42:01 +05:30
Kovid Goyal
b1e08adbce
Utility function to sort with key
2022-11-14 15:42:00 +05:30
Kovid Goyal
e7f38929d9
DRYer
2022-11-14 15:42:00 +05:30
Kovid Goyal
2cacd7a64a
get rid of interface{} since we now require Go 1.18
2022-11-14 15:42:00 +05:30
Kovid Goyal
a44c89504b
More convenient interface for sorting
2022-11-14 15:42:00 +05:30
Kovid Goyal
8807f6d539
Code to get exe name for usage message
2022-11-14 15:42:00 +05:30
Kovid Goyal
2f83bbdc85
command validation
2022-11-14 15:42:00 +05:30
Kovid Goyal
41a841c83d
Validate string slice fields
2022-11-14 15:42:00 +05:30
Kovid Goyal
0cf8876f8a
Validate count struct fields
2022-11-14 15:42:00 +05:30
Kovid Goyal
a3a89b3e21
More efficient multi line scanning
2022-11-14 15:42:00 +05:30
Kovid Goyal
2ddbe2a2bc
Automatically camel-case destination
2022-11-14 15:42:00 +05:30
Kovid Goyal
707963b694
Code to conveniently read option values into a struct
2022-11-14 15:42:00 +05:30
Kovid Goyal
1811949706
Implement cloning of commands
2022-11-14 15:42:00 +05:30
Kovid Goyal
bc38bd75fd
Start work on getting rid of the cobra dependency
...
Command line parsing is easy and I can do it better.
2022-11-14 15:42:00 +05:30
Kovid Goyal
54ec486d3a
Now completion for hyperlinked_grep is automatic thanks to delegation
...
Also fix delegation for zsh when the command being completed differs
from the current command.
2022-11-14 15:42:00 +05:30
Kovid Goyal
5666b1b0fd
Implement completion for fish
2022-11-14 15:41:59 +05:30
Kovid Goyal
ef9b765f81
Dont count bash's idiotic option equals as arguments
2022-11-14 15:41:59 +05:30
Kovid Goyal
a2bb360eec
Dont output escape strings in descriptions
2022-11-14 15:41:59 +05:30
Kovid Goyal
7cf9b21fc0
Show local executables for kityt command completion even without ./
2022-11-14 15:41:59 +05:30
Kovid Goyal
454c2e32e7
...
2022-11-14 15:41:59 +05:30
Kovid Goyal
53dc079c10
Use compopt to manage files and spaces
2022-11-14 15:41:59 +05:30
Kovid Goyal
08c697e99a
Get delegate based completion working for bash
2022-11-14 15:41:59 +05:30
Kovid Goyal
1dce092ac0
Add trailing spaces for bash completion
2022-11-14 15:41:59 +05:30
Kovid Goyal
24c2d27eea
handle bash splitting completion cmdline on equals
2022-11-14 15:41:59 +05:30
Kovid Goyal
b04b483b3f
Remove common prefix for bash as well
2022-11-14 15:41:59 +05:30
Kovid Goyal
a7c997c6ef
Add a debug function to print to parent kitty stdout
2022-11-14 15:41:59 +05:30
Kovid Goyal
266e51310c
Basic BASH completion
2022-11-14 15:41:59 +05:30
Kovid Goyal
928a4db817
Implement delegate based completion fof the ssh and hyperlinked_grep kittens
2022-11-14 15:41:59 +05:30
Kovid Goyal
dc403156a9
Delegate based completion for kitty cmd
2022-11-14 15:41:59 +05:30
Kovid Goyal
2cc359ccc8
Get zsh completion working apart from delegation
2022-11-14 15:41:58 +05:30
Kovid Goyal
cbbda23e01
Utility code to find longest common prefix/suffix and to quote strings for various shells
2022-11-14 15:41:58 +05:30
Kovid Goyal
1ff4f2df4f
Refactor the CLI markup code to make it re-useable
2022-11-14 15:41:58 +05:30
Kovid Goyal
8796168469
Port code to truncate strings to visual width to Go
2022-11-14 15:41:58 +05:30
Kovid Goyal
d16ad40bbf
avoid extra string copy in Stringwidth
2022-11-14 15:41:58 +05:30
Kovid Goyal
5c0858d6b7
Start work on zsh completion serialization
2022-11-14 15:41:58 +05:30
Kovid Goyal
a32a8d096d
Allow commands to customize argument parsing
2022-11-14 15:41:58 +05:30
Kovid Goyal
7737369fc9
Add completion for the kittens
2022-11-14 15:41:58 +05:30
Kovid Goyal
25a7ec9a07
Extra completion for some kitty options
2022-11-14 15:41:58 +05:30
Kovid Goyal
c2a2b4c087
Add various special purpose entry points
2022-11-14 15:41:58 +05:30
Kovid Goyal
3a8bab90dc
Get rid of WordPrefix
2022-11-14 15:41:58 +05:30
Kovid Goyal
0ff2446a1a
More completion work
2022-11-14 15:41:58 +05:30
Kovid Goyal
946d44c43f
Implement completespec in go
2022-11-14 15:41:58 +05:30
Kovid Goyal
f657e6e916
Allow using a base directory other than the cwd when completing files
2022-11-14 15:41:57 +05:30
Kovid Goyal
c5afceb4cb
Basic completion for options
2022-11-14 15:41:57 +05:30
Kovid Goyal
18c3e46ac6
When completing on patterns exclude directories that only contain files that dont match
2022-11-14 15:41:57 +05:30
Kovid Goyal
3c29ce936b
Dont recurse for file completion
...
We could potentially end up recursing over the entire file system. And
for completion we only present the candidates in the immediate directory
anyway.
2022-11-14 15:41:57 +05:30
Kovid Goyal
c9d986f9a8
args completion for rc commands
2022-11-14 15:41:57 +05:30
Kovid Goyal
6faa908733
And more corner cases
2022-11-14 15:41:57 +05:30
Kovid Goyal
ced741b247
More corner cases
2022-11-14 15:41:57 +05:30
Kovid Goyal
c47ccc8a59
...
2022-11-14 15:41:57 +05:30
Kovid Goyal
3326e9ef49
Move code to walk with symlinks to the utils module
2022-11-14 15:41:57 +05:30
Kovid Goyal
134fce8507
Allow completing paths with ~ prefix
2022-11-14 15:41:57 +05:30
Kovid Goyal
5d89a6c3c4
Work on completion of file args
2022-11-14 15:41:57 +05:30
Kovid Goyal
8c6b391eda
...
2022-11-14 15:41:57 +05:30
Kovid Goyal
8c2e435793
Code to complete executables in PATH
2022-11-14 15:41:57 +05:30
Kovid Goyal
10cf7f06c6
Code to get file/dir completion candidates for a prefix
2022-11-14 15:41:56 +05:30
Kovid Goyal
d679ea2cdf
Allow generating completions for multiple command lines for more efficient testing
2022-11-14 15:41:56 +05:30
Kovid Goyal
54378de52b
More work on command completion
2022-11-14 15:41:56 +05:30
Kovid Goyal
63287e4115
More work on completions
2022-11-14 15:41:56 +05:30
Kovid Goyal
d703cb51cd
...
2022-11-14 15:41:56 +05:30
Kovid Goyal
005a9c7090
Add an entry point for the completion tool
2022-11-14 15:41:56 +05:30
Kovid Goyal
f4de6d2a10
More work on completions
2022-11-14 15:41:56 +05:30
Kovid Goyal
e60b331152
start work on porting completion to Go
2022-11-14 15:41:56 +05:30
Kovid Goyal
3d79eb5730
more tests for indent and wrap
2022-11-14 15:41:56 +05:30
Kovid Goyal
af7f4e97cf
More work on the new formatter
2022-11-14 15:41:56 +05:30
Kovid Goyal
aad8cb3d1e
Use the new formatter for CLI help output
2022-11-14 15:41:56 +05:30
Kovid Goyal
40a9ab8929
Allow ignoring lines containing a sentinel
2022-11-14 15:41:56 +05:30
Kovid Goyal
e433b90297
Dont drop trailing escape codes when stripping trailing whitespace
2022-11-14 15:41:56 +05:30
Kovid Goyal
1ac7d9c10d
Basic wrap is working
2022-11-14 15:41:56 +05:30
Kovid Goyal
ef5f0025e1
Start work on more sophisticated indent+wrap implementation
2022-11-14 15:41:56 +05:30
Kovid Goyal
32804f01b2
Allow parsing strings with escape code parser
2022-11-14 15:41:55 +05:30
Kovid Goyal
7ecc1b7950
Remove markup from ref_hyperlink text
2022-11-14 15:41:55 +05:30
Kovid Goyal
a7f6105393
Use Unsafe rather than Dangerous to be consistent
2022-11-14 15:41:55 +05:30
Kovid Goyal
081390b5a2
Utility functions to allow using string/[]byte interchangeably without copies
2022-11-14 15:41:55 +05:30
Kovid Goyal
61094c6bfb
Add strikethrough formatting
2022-11-14 15:41:55 +05:30
Kovid Goyal
6672904e64
Fix spurious error message when setting image to none
2022-11-14 15:41:55 +05:30
Kovid Goyal
905c4d641c
Allow using many image formats in RC commands
2022-11-14 15:41:55 +05:30
Kovid Goyal
fa7a6dfd4a
Implement stdin echo loop for socket i/o as well
2022-11-14 15:41:55 +05:30
Kovid Goyal
cb452ba9fc
Implement sen text from stdin for the tty backend
2022-11-14 15:41:55 +05:30
Kovid Goyal
85169c989f
...
2022-11-14 15:41:55 +05:30
Kovid Goyal
e8a321d097
Port code to serialize key events as CSI to Go
2022-11-14 15:41:55 +05:30
Kovid Goyal
3a198833da
Simplify escape code wrapping
2022-11-14 15:41:55 +05:30
Kovid Goyal
ea8fb10c05
Password input: Handle SIGTSTP
2022-11-14 15:41:55 +05:30
Kovid Goyal
67115530b4
Make the loop API a thin wrapper around internal methods
2022-11-14 15:41:55 +05:30
Kovid Goyal
f86ce03d3b
Fix set-colors
2022-11-14 15:41:55 +05:30
Kovid Goyal
5cf10023c9
Nicer API for setting loop options
2022-11-14 15:41:55 +05:30
Kovid Goyal
7f77f7e408
Only send cancel async if there is an async id
2022-11-14 15:41:54 +05:30
Kovid Goyal
65c3630099
send_text other than from stdin works
2022-11-14 15:41:54 +05:30
Kovid Goyal
457aab7c41
Simplify timer removal
2022-11-14 15:41:54 +05:30
Kovid Goyal
dcec926590
Do not allow adding timers before loop is run
2022-11-14 15:41:54 +05:30
Kovid Goyal
0a2455c8be
Get scroll_window working
2022-11-14 15:41:54 +05:30
Kovid Goyal
bacca88213
Get set_font_size working
2022-11-14 15:41:54 +05:30
Kovid Goyal
bd1b3d9f6e
Implement streaming mode for socket IO
2022-11-14 15:41:54 +05:30
Kovid Goyal
364533b1ed
Work on supporting streaming remote commands with passwords
2022-11-14 15:41:54 +05:30
Kovid Goyal
d7985689c9
Allow debugprintln to controlling tty easily
2022-11-14 15:41:54 +05:30
Kovid Goyal
6d6bba4a4c
debugprintln should be in-band for the loop
2022-11-14 15:41:54 +05:30
Kovid Goyal
5cc5759f3e
flush_pending_writes must be non-blocking
2022-11-14 15:41:54 +05:30
Kovid Goyal
a388a658ce
Fix payload update code in multi send commands
2022-11-14 15:41:54 +05:30
Kovid Goyal
b5e2871aa0
Remove not needed chunking code
2022-11-14 15:41:54 +05:30
Kovid Goyal
a4b2e2a196
more work on porting command parsing to Go
2022-11-14 15:41:54 +05:30
Kovid Goyal
6f4968305a
more work on porting rc command parsing to Go
2022-11-14 15:41:54 +05:30
Kovid Goyal
79c8862d4c
Work on conversion of args parsing to go code
2022-11-14 15:41:53 +05:30
Kovid Goyal
ef71b071db
Automap a bunch of json fields from identically named options
2022-11-14 15:41:53 +05:30
Kovid Goyal
249df69ac9
Use the new styling API for CLI infra
2022-11-14 15:41:53 +05:30
Kovid Goyal
4a4500d56b
Dont make urls part of styling, instead have a dedicated UrlFunc API
...
Since urls can potentially change a lot, caching them makes no sense
2022-11-14 15:41:53 +05:30
Kovid Goyal
be22f49012
Fix usage of numbered colors for underlines
2022-11-14 15:41:53 +05:30
Kovid Goyal
f9695a7947
Add url support to styling
2022-11-14 15:41:53 +05:30
Kovid Goyal
29d9b70f0c
More ansi styling tests
2022-11-14 15:41:53 +05:30
Kovid Goyal
42a8ca0842
Write some tests for the style wrapper
2022-11-14 15:41:53 +05:30
Kovid Goyal
91c61478dd
Start work on easily generating ANSI formatted strings
2022-11-14 15:41:53 +05:30
Kovid Goyal
9c58cb3f41
...
2022-11-14 15:41:52 +05:30
Kovid Goyal
b2e610f9b1
Implement socket I/O
2022-11-14 15:41:52 +05:30
Kovid Goyal
a960937095
Simplify serialization code and avoid extra copy
2022-11-14 15:41:52 +05:30
Kovid Goyal
0cda5d43a6
Fix final write detection
2022-11-14 15:41:52 +05:30
Kovid Goyal
a75d59643c
Use one less channel
2022-11-14 15:41:52 +05:30
Kovid Goyal
bf35817d73
No need to store most channels on self
2022-11-14 15:41:52 +05:30
Kovid Goyal
1b90c03304
Refactor loop code into its own package
2022-11-14 15:41:52 +05:30
Kovid Goyal
b1f9139ca5
Use a fully random async_id rather than a uuid
2022-11-14 15:41:52 +05:30
Kovid Goyal
4a49c3940a
Switch to using goroutines rather than a select()
...
More complex code since now we have to synchronize between threads,
but a good way to teach myself more about goroutines.
2022-11-14 15:41:52 +05:30
Kovid Goyal
ee12349a50
Use Go's os.File this allows us to implement WriteString without using unsafe
2022-11-14 15:41:52 +05:30
Kovid Goyal
69c847a48f
Fix failing test
2022-11-14 15:41:51 +05:30
Kovid Goyal
03705cbec0
Fix transmission of async rc commands
2022-11-14 15:41:51 +05:30
Kovid Goyal
ff2ff9c04f
Port short uuid code to Go
2022-11-14 15:41:51 +05:30
Kovid Goyal
a22ba9f739
Fix failing test
2022-11-14 15:41:51 +05:30
Kovid Goyal
c86f8a698c
@ ls works phew
2022-11-14 15:41:51 +05:30
Kovid Goyal
fa4711bd04
Give the kill signal time to be delivered
2022-11-14 15:41:51 +05:30
Kovid Goyal
174bc25afb
Make timeout checking more efficient
2022-11-14 15:41:51 +05:30
Kovid Goyal
2ffba1c422
Work on implementing ttyio via TUI
2022-11-14 15:41:51 +05:30
Kovid Goyal
0913b64c6b
Dont vendor base85
2022-11-14 15:41:51 +05:30
Kovid Goyal
32e59257d2
Refactor io in preparation for using tui
2022-11-14 15:41:51 +05:30
Kovid Goyal
6f8c884bb5
Also handle SIGPIPE as the Go runtime does funky things with this signal
2022-11-14 15:41:51 +05:30
Kovid Goyal
80c5ac891d
Add license info to Go files
2022-11-14 15:41:51 +05:30
Kovid Goyal
6a2393299b
Add a write completed callback
2022-11-14 15:41:51 +05:30
Kovid Goyal
ab66b3f4c0
Add timer infra to the loop
2022-11-14 15:41:51 +05:30
Kovid Goyal
c8292d77f1
Re-use the escape code parser for wcswidth calculation
2022-11-14 15:41:51 +05:30
Kovid Goyal
7280c712d6
Move escape code parser into wcswidth package
2022-11-14 15:41:50 +05:30
Kovid Goyal
9be2247081
Dont use the syscall package
2022-11-14 15:41:50 +05:30
Kovid Goyal
e68b5fa504
Add callback for screen resize handling
2022-11-14 15:41:50 +05:30
Kovid Goyal
c2ef6c986b
Password input now works
2022-11-14 15:41:50 +05:30
Kovid Goyal
619fcb0681
Allow debug printing
2022-11-14 15:41:50 +05:30
Kovid Goyal
10a39d3757
Fix reset mode incorrectly setting mode instead
2022-11-14 15:41:50 +05:30
Kovid Goyal
d2a15a2009
Make using alternate screen the default
2022-11-14 15:41:50 +05:30
Kovid Goyal
235eb868b2
More misc fixes for TUI
2022-11-14 15:41:50 +05:30
Kovid Goyal
5703a3370e
Move wcswidth into its own package as it is very slow to build
2022-11-14 15:41:50 +05:30
Kovid Goyal
5dca2a1a25
Fix stringifying mods
2022-11-14 15:41:50 +05:30
Kovid Goyal
4b18b575cd
Misc fixes for TUI
2022-11-14 15:41:50 +05:30
Kovid Goyal
818f68ec53
Initialize various maps
2022-11-14 15:41:50 +05:30
Kovid Goyal
cd54fefa99
Ignore more types of temporary errors
2022-11-14 15:41:50 +05:30
Kovid Goyal
4ab5456ead
Less layering
2022-11-14 15:41:49 +05:30
Kovid Goyal
10d11bc749
Drop another dependency
2022-11-14 15:41:49 +05:30
Kovid Goyal
19ffbc6f3d
Implement wcswidth() for Go
2022-11-14 15:41:49 +05:30
Kovid Goyal
79b1af28b4
Fix errors reported by compiler
2022-11-14 15:41:49 +05:30
Kovid Goyal
05d768d8df
Generate a wcwidth for Go as well
2022-11-14 15:41:49 +05:30
Kovid Goyal
7bb310d3af
Port recent changes from cli.py to Go
2022-11-14 15:41:49 +05:30
Kovid Goyal
9d56f8eed2
Use TUI to build a nice password read control
2022-11-14 15:41:49 +05:30
Kovid Goyal
42a5129553
Wire up key handling
2022-11-14 15:41:49 +05:30
Kovid Goyal
d6ed20323b
Implement key event parsing and matching
2022-11-14 15:41:49 +05:30
Kovid Goyal
63fdbd3fa0
Start work on decoding key events in Go
2022-11-14 15:41:49 +05:30
Kovid Goyal
99fde8723a
Wire up the signal handlers
2022-11-14 15:41:49 +05:30
Kovid Goyal
526a331f47
Wire up a bunch of callbacks
2022-11-14 15:41:49 +05:30
Kovid Goyal
e18b6638bb
Allow propagating errors from the escape code handlers
2022-11-14 15:41:49 +05:30
Kovid Goyal
3c3e7b7f70
Start work on proper TUI support
2022-11-14 15:41:49 +05:30
Kovid Goyal
67f03621ae
Handle EINTR in IsTerminal
2022-11-14 15:41:49 +05:30
Kovid Goyal
10cef16210
DRYer
2022-11-14 15:41:49 +05:30
Kovid Goyal
6a79b450f7
Drop another dependency and get a better read password function
2022-11-14 15:41:48 +05:30
Kovid Goyal
eb4ee13f73
Drop another dependency
2022-11-14 15:41:48 +05:30
Kovid Goyal
cf287015de
...
2022-11-14 15:41:48 +05:30
Kovid Goyal
246277e7af
Refactor tty code into its own package
2022-11-14 15:41:48 +05:30
Kovid Goyal
13758e9600
Drop one dependency
2022-11-14 15:41:48 +05:30
Kovid Goyal
73e4deb1c2
Show suggestions based on levenshtein distance
2022-11-14 15:41:48 +05:30
Kovid Goyal
68d589826a
...
2022-11-14 15:41:48 +05:30
Kovid Goyal
7457746d65
Fix @command form not supporting global options
2022-11-14 15:41:48 +05:30
Kovid Goyal
eec8f04e93
fix reading from tty
2022-11-14 15:41:48 +05:30
Kovid Goyal
3a7d26a3ef
Work on reading command responses
2022-11-14 15:41:48 +05:30
Kovid Goyal
91b15d1a90
Fix incorrect err handling
2022-11-14 15:41:48 +05:30
Kovid Goyal
12b0f632bd
Allow OSC to be terminated by BEL
...
Also prevent changing streaming state unless in reset state
2022-11-14 15:41:48 +05:30
Kovid Goyal
84cb2638d6
Work on an escape code parser
2022-11-14 15:41:48 +05:30
Kovid Goyal
ce3062cbde
UTF-8 decode/encode for Go
...
The builtin utf-8 package has semantics not suitable for us
2022-11-14 15:41:48 +05:30
Kovid Goyal
e599a2c87f
The stupid term package is not EINTR safe
2022-11-14 15:41:48 +05:30
Kovid Goyal
15e1f376a4
EINTR safe function to get tty size
2022-11-14 15:41:48 +05:30
Kovid Goyal
82d0bd9364
Use the term package to get tty size since it has a function for it
2022-11-14 15:41:47 +05:30