Commit graph

231 commits

Author SHA1 Message Date
Kovid Goyal
d8b524c692
Cache parsing of command line specifications
Change option specification from dict to tuple for better performance
and immutability and better type checking.
2025-09-29 12:31:10 +05:30
Kovid Goyal
0d15c6f7c7
Also escape choices 2025-09-28 23:12:35 +05:30
Kovid Goyal
f0b79f9f64
Fix #9028 2025-09-28 23:11:56 +05:30
alex-huff
0daab6ab43 resize-os-window: fix '--incremental' option of 'os-panel' action
This commit addresses a few issues with the implementation of
'--incremental':
    - Unspecified settings are reset to their default value, which
      defeats the purpose of the option.
    - It is assumed that the names of options in 'LayerCLIOptions' map
      one to one with the names of fields in 'LayerShellConfig' but this
      isn't true. For example: The 'margin_top' cli option sets the
      'requested_top_margin' layer shell config.
    - When some options are set to a certain value, they force other
      options to be some value. The current implementation doesn't
      account for this.
    - The documentation is contradictory.
2025-09-22 00:10:42 -05:00
Kovid Goyal
508ca700d8
Fix #8998 2025-09-21 10:10:51 +05:30
Kovid Goyal
0fb1835af1
Cache parsed save as session options spec 2025-08-16 09:57:00 +05:30
Kovid Goyal
4c8f9f9e26
Cleanup previous PR
Fixes #8601
2025-05-12 22:18:41 +05:30
Shane Ciardelli
5c49e2aab4
remembers window position after quit
added position flag

added window geometry caching

Restores window given --position command

moved position flag to last listed flag

fixed formatting - working version

fixed git problems and formatting issues

fixing some caching mistakes

trailing whitespace

remove .dmypy.json for git
2025-05-12 22:18:41 +05:30
Kovid Goyal
24aa1f171c
Make AsCommandLine() more parsimonious 2025-04-29 09:37:36 +05:30
Kovid Goyal
44cca80a0c
DRYer 2025-04-29 08:43:21 +05:30
Kovid Goyal
5683314784
Start work on quick-access-terminal kitten 2025-04-28 19:52:04 +05:30
Kovid Goyal
b0ae88ada9
Wire up the codegen C cli parser 2025-04-28 09:20:11 +05:30
Kovid Goyal
1413d8fb85
Fix handling of --help and --version 2025-04-28 09:20:11 +05:30
Kovid Goyal
27c5b6aac5
Generate option parser in C for kitty CLI 2025-04-28 09:20:10 +05:30
Kovid Goyal
d548a6fcf4
rename typing module to avoid conflicts with stdlib typing 2025-04-28 09:20:10 +05:30
Kovid Goyal
e42d410ee4
Move cli spec parsing code into simple module 2025-04-28 09:20:10 +05:30
Kovid Goyal
62699f6799
Get basic C cli parsing working 2025-04-28 09:20:10 +05:30
Kovid Goyal
9b433a598d
Add to help text indicating bool options can be explicity specified 2025-04-26 09:21:22 +05:30
Kovid Goyal
3f00dc1c9e
Work on improving CLI parsing
Can now set bool values explicitly with =
Handle multi short flag args like -abc
Add unit tests for CLI parsing
Generate go code to serialize CLI options as a cmdline

TODO: Implement setting of bool vals in C and Go parsing code
TODO: Help/rst output should somehow indicate this feature
2025-04-26 09:01:54 +05:30
Kovid Goyal
9296bc3060
Speed up --detach
Also DRYer as well as more robust since single instance cleanup, binding
etc. happen in single process.
2025-04-24 08:13:58 +05:30
Kovid Goyal
c1b6b4494a
Implement starting kitty hidden
Fixes #3466
2025-04-23 08:50:02 +05:30
Kovid Goyal
8b6a210ac1
Allow specifying --listen-on for panel kitten 2025-04-22 14:29:32 +05:30
Kovid Goyal
da1626090a
Update codebase to Python 3.10 using pyupgrade 2025-02-03 10:56:50 +05:30
Kovid Goyal
f1d0d0949b
Run pyupgrade to update the codebase to python 3.9
Gets rid of a lot of typing ugliness by using type annotations on
builtin types
2024-07-31 07:55:27 +05:30
Kovid Goyal
5d5f3ff1b5
Add --app-id as alias for --class
On Wayland we have application ids instead of WM_CLASS. Bloody dumb.
2024-03-26 19:59:59 +05:30
Kovid Goyal
9ea0dde469
Add a note that startup_session prevents processing of cli args 2024-03-07 08:55:44 +05:30
Kovid Goyal
065b17ddbd
kitten @ load-config: Allow (re)loading kitty.conf via remote control 2024-02-07 11:08:55 +05:30
Kovid Goyal
d9903f5283
Add a note for what to do instead of --detach on macOS 2023-12-18 12:04:23 +05:30
Kovid Goyal
3c4f2aa1b8
shlex.split -> shlex_split 2023-12-02 15:17:08 +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
5ea9700c82
More kitty @ -> kitten @ 2023-10-18 20:40:39 +05:30
Kovid Goyal
bde4a41ed4
Remote control: Allow using a random TCP socket as the remote control socket and also allow using TCP sockets in kitty.conf 2023-08-04 11:12:31 +05:30
Kovid Goyal
0fb1f17af9
Have --hold wait at a shell prompt 2023-06-26 11:21:57 +05:30
Kovid Goyal
4f5fc1000d
Allow multiple specifications of kwds,ext,mime in completion specs 2023-03-27 07:53:54 +05:30
Kovid Goyal
5ff1dadf0d
Allow using --session=none to override startup_session
Fixes #6131
2023-03-25 10:44:34 +05:30
Kovid Goyal
7dd20d4c79
Dont output empty brackets for release versions which dont have KITTY_VCS_REV 2023-02-24 20:11:09 +05:30
Kovid Goyal
df45a4e759
Add a note that --detach is not available on macOS 2023-01-31 17:52:36 +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
60791bb57b
Session files: Expand environment variables 2023-01-23 17:34:53 +05:30
Kovid Goyal
7fe5d7b58f
Replace isort with ruff 2023-01-09 16:47:42 +05:30
pagedown
6a1b456bac
DRYer: Get hostname 2022-11-26 16:08:40 +08:00
Kovid Goyal
f57832f501
Fix spurious rebuilds of generated go code 2022-11-14 15:42:03 +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
4396dede85
Get rid of the cobra dependency 2022-11-14 15:42:02 +05:30
Kovid Goyal
7737369fc9
Add completion for the kittens 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
26d4f5bcc9
Use the new completionspec for rc cmds 2022-11-14 15:41:58 +05:30
Kovid Goyal
c5afceb4cb
Basic completion for options 2022-11-14 15:41:57 +05:30