Kovid Goyal
6205fb32fd
Refactor VT parser for more speed
...
No longer copy bytes into a separate buffer, instead parse them in place
in the read buffer
2024-02-25 09:57:23 +05:30
Kovid Goyal
23bb2e1b67
Fast function to replace c0 codes
2024-02-25 09:57:23 +05:30
Kovid Goyal
8cc2cad4d9
Use list of legal chars in URL from the WHATWG standard
...
Notably this excludes some ASCII chars: <>{}[]`|
See https://url.spec.whatwg.org/#url-code-points
Fixes #7095
2024-02-05 13:27:22 +05:30
Kovid Goyal
b0ba4b4a42
Fast and robust implementation of shlex.split
...
Also returns position of words in src string which we will need for
keymap parsing.
2023-12-02 14:57:02 +05:30
Kovid Goyal
77292a16d6
Make shebangs consistent
...
Follow PEP 0394 and use /usr/bin/env python so that the python in the
users venv is respected. Not that the kitty python files are meant to be
executed standalone anyway, but, whatever.
Fixes #6810
2023-11-11 08:32:05 +05:30
Kovid Goyal
defa2e29ac
Always ask for confirmation when pasting text with control codes in it
2023-10-20 13:02:28 +05:30
Kovid Goyal
56963c693e
When pasting in bracketed paste mode and the cursor is at a shell prompt, strip out C0 control codes
...
Some shells incorrectly interpret these allowing escape from bracketed paste mode. Thanks to David Leadbetter for discovering.
2023-10-20 12:17:13 +05:30
Kovid Goyal
750018e5fe
...
2023-05-25 12:25:46 +05:30
Kovid Goyal
cb936c1b5b
Use /dev/null rather than /dev/tty for the test
2023-05-25 12:24:59 +05:30
Kovid Goyal
624007c7aa
Refuse to read image files in /proc /sys and /dev
...
Also, open the image file with O_NONBLOCK to ensure we dont hang opening
a FIFO
2023-05-25 12:17:03 +05:30
Kovid Goyal
7fe5d7b58f
Replace isort with ruff
2023-01-09 16:47:42 +05:30
Kovid Goyal
306f9e5735
Prettify URLs before displaying them to the user
2022-12-29 17:04:02 +05:30
Kovid Goyal
68cf9f7514
Switch to tracking linewrap on the last cell in a line
...
This allows us to have newline not affect the wrap status of a line.
Now a lines wrapping status is changed only when the last cell
in the line is changed. This actually matches the behavior of many other
terminal emulators so is probably a good thing from a ecosystem
compatibility perspective.
The fish shell expects this weird behavior of newline not changing
wrapping status, for unknown reasons, which is the actual motivation for
doing all this work.
Fixes #5766
2022-12-26 20:26:21 +05:30
Kovid Goyal
c6360537e5
Try to fix tests failing on Python 3.11
2022-12-16 10:05:05 +05:30
Kovid Goyal
f9a22d0bc7
Port ANSI escape code parser to Go
2022-11-25 21:03:09 +05:30
Kovid Goyal
cfc6bd4da5
Native code implementation for expanding ANSI escape codes
2022-11-25 17:33:41 +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
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
26b8ab9adf
Use a regex for bracketed paste sanitization
2022-09-23 22:18:03 +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
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
c982f24faf
Add some tests for hashing and __eq__
2022-08-12 12:02:22 +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
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
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
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
62dbc1129c
When setting the OS Window title strip out CSI escape codes
...
Fixes #4325
2021-12-08 16:04:23 +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
6546c1da9b
run pyupgrade to upgrade the codebase to python3.6
2021-10-21 12:43:55 +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
780e526143
Use a union for cell attributes
...
Cleaner code, no performance impact
2021-08-18 10:06:08 +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
444080f320
Make wcswidth useable in a streaming fashion
2020-09-21 15:55:22 +05:30
Kovid Goyal
6461dccbdc
Make wcswidth ignore more escape codes
...
Needed to ignore OSC 8 hyperlinks since we will
eventually have to send those with SGR formatting to the hints
kitten.
2020-09-17 20:16:17 +05:30
Kovid Goyal
0862e85577
Rewrite wcswidth as a state machine
2020-04-07 10:10:30 +05:30
Kovid Goyal
6357f7b811
Update wcswidth() to match new country flag rendering
2020-04-06 22:56:34 +05:30
Kovid Goyal
12f37bcfad
Dont strip trailing punctuation from end of URL if next line startswith url characters
2020-03-15 08:47:52 +05:30
Kovid Goyal
e86c712424
Dont strip :code:& and :code:- from the end of URLs
...
Fixes #2436
2020-03-15 08:29:56 +05:30
Kovid Goyal
645890ccc8
Make the set of URL prefixes that are recognized while hovering with the mouse configurable
...
Fixes #2416
2020-03-08 13:16:34 +05:30
Kovid Goyal
43326c9bd0
Fix URL detection not working for urls of the form scheme:///url
...
Fixes #2292
2020-01-17 07:49:01 +05:30
Luflosi
2751dbdb94
Fix test_url_at
...
`lspace_test()` has a parameter called scheme with the default value `http`. It
is called in a nested for loop, but the scheme from the inner for loop is
just ignored.
2019-06-05 18:32:23 +02:00
Luflosi
a792c94ccf
Use python3 shebang for all python scripts
...
Fixes #1624 .
Use python3 shebang for all python scripts as python still defaults to python2 on many systems.
2019-05-20 14:44:24 +02:00
Kovid Goyal
fe882dad15
Add support for Vs-15 to wcswidth
2019-05-13 19:50:49 +05:30
Kovid Goyal
d20c65ef80
Graphics protocol: Only delete temporary image-data files if they are in a known temporary file location
2018-12-11 10:00:43 +05:30
Kovid Goyal
47ec372c30
Fix hover detection of URLs not working when hovering over the first colon and slash characters in short URLs
...
Fixes #1201
2018-12-04 06:52:26 +05:30
Dominique Martinet
c421d3bb59
line_as_ansi: don't reset SGR at start of line
...
less does not carry the mode over from the previous line anyway, let's
save a few bytes for every line
2018-09-22 19:10:09 +09:00