39 Commits

Author SHA1 Message Date
Kovid Goyal
0dd3ee0046 Add some more command to replay commands 2025-02-05 08:48:16 +05:30
Kovid Goyal
4a0086b241 Fix vertical_align serialization 2025-02-03 10:56:45 +05:30
Kovid Goyal
5c2c88858b Implement reporting of multicell commands 2025-02-03 10:56:45 +05:30
Kovid Goyal
1c3d3ad9be Fix report_device_attributes 2024-04-10 08:24:39 +05:30
Kovid Goyal
e66b8a47d4 Add support for screen_erase_characters ECH 2024-04-10 08:04:56 +05:30
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
a4193a1b02 Fix dumping of bytes/commands 2024-02-25 09:57:23 +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
7fe5d7b58f Replace isort with ruff 2023-01-09 16:47:42 +05:30
pagedown
4110074580 Refactor: More f-string for kitty client.py 2022-01-29 20:22:44 +08:00
Kovid Goyal
6546c1da9b run pyupgrade to upgrade the codebase to python3.6 2021-10-21 12:43:55 +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
aa739cdfd4 Add shell_prompt_marking to client 2021-08-18 10:06:09 +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
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
bc8a351558 Add repeat character to client.py 2021-01-02 12:49:33 +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
e48e166584 And another 2020-12-17 08:41:58 +05:30
Kovid Goyal
e7675e8bab Add some more commands to the client 2020-12-17 08:37:55 +05:30
Kovid Goyal
f0c3641ebd Some more commands for replay commands 2020-06-29 13:04:10 +05:30
Kovid Goyal
025f6d7701 Add keypad mode support to replay commands
Also name the constants correctly
2020-06-29 12:46:34 +05:30
Kovid Goyal
5e48ae8bac pep8 2020-05-12 22:54:08 +05:30
Kovid Goyal
d3f37eeba4 more typing work 2020-03-14 11:42:05 +05:30
Kovid Goyal
8a34fede55 More typing work 2020-03-06 08:35:23 +05:30
Luflosi
5f855ce547 Use context managers to open files
Inspired by d50a6ddc1b.
2019-08-01 13:21:26 -05:00
Luflosi
2b095f720e Use "with suppress()" to suppress python exceptions
Using
```Python
with suppress(OSError):
    os.remove('somefile.tmp')
```
instead of
```Python
try:
    os.remove('somefile.tmp')
except OSError:
    pass
```
makes the code more compact and more readable IMO.

This pattern was recommended by Raymond Hettinger, a Python Core
Developer in his talk "Transforming Code into Beautiful, Idiomatic Python" at https://www.youtube.com/watch?v=OSGv2VnC0go. The transcript is available at https://github.com/JeffPaine/beautiful_idiomatic_python
2019-06-03 12:27:43 +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
3067103b18 Implement window title stack
Used by new versions of vim
2018-08-29 09:56:52 +05:30
Kovid Goyal
59430c1c14 Add missing screen_delete_lines to client 2018-06-11 09:12:30 +05:30
Kovid Goyal
5d4e968f50 Allow commenting lines in command logs 2018-05-19 07:33:29 +05:30
Kovid Goyal
6ae58e6882 Add a couple more functions to --replay-commands 2018-05-17 20:15:59 +05:30
Kovid Goyal
e4668c1aff Replay set_dynamic_color and set_color_table_color 2017-08-04 20:47:59 +05:30
Kovid Goyal
e9b5963610 Fix incorrect replay of screen cursor down 2017-05-26 13:21:16 +05:30
Kovid Goyal
fafd710ce3 Clean exit for client on EOF/interrupt 2017-05-26 12:36:36 +05:30
Kovid Goyal
cd1ba334c1 Forgot to change test 2017-05-19 15:54:34 +05:30
Kovid Goyal
1cff4f9d29 ... 2017-05-19 15:45:07 +05:30
Kovid Goyal
d180601711 More command replaying 2017-05-19 15:43:15 +05:30
Kovid Goyal
15c4b1961e Add a few missing commands to replay 2017-04-04 23:51:20 +05:30
Kovid Goyal
a388681524 Code to replay dumped commands 2016-11-30 21:21:23 +05:30