55 Commits

Author SHA1 Message Date
Kovid Goyal
018811c96c
Remove unused code
Completion and remote control have moved into kitty-tool
2022-11-14 15:42:09 +05:30
Kovid Goyal
fca0999814
Eureka! Figured out why libedit is breaking in prewarm on macOS via launchd
The prewarm zygote imports the world. shell.py had a top level import
for readline. Which means readline was being imported pre-fork. And of
course as is traditional with Apple libedit is not fork safe. Probably
because it initializes its internal IO routines based on the stdio
handles at time of import which are the handles kitty gets from launchd
2022-08-30 19:35:17 +05:30
Kovid Goyal
d8e43a3412
macOS: Fix regression in 0.26.0 that caused asking the user for a line of input such as for set_tab_title to not work
Apparently libedit doesn't work in the forked process when the parent
process is run via Launch Services. I cant be bothered to investigate
why, given that libedit is closed source. macOS users will just have to
live without history/completion in the ask kitten until I get around to
writing a replacement for readline/libedit.

And on a personal note, macOS >> Necrotizing fasciitis

Fixes #5447
2022-08-30 16:45:14 +05:30
Kovid Goyal
bfcd324993
ask kitten: allow having hidden text in the message 2022-08-16 13:57:58 +05:30
Kovid Goyal
6961845167
ask kitten: fix button click area offset vertically 2022-08-16 10:35:51 +05:30
Kovid Goyal
cd3eeb7a95
Center choice message correctly when it is multi-line
Also fix button wrap calculation. It was not taking the borders into
account.
2022-08-10 20:34:25 +05:30
Kovid Goyal
7be6b28011
Preserve blanks lines and per line formatting in the ask kitten for the message with choices 2022-08-10 20:10:17 +05:30
pagedown
510022c3c1
Docs: Improve the documentation for kittens
Add more text roles and links.
Add an example that broadcasts only to other windows in the current tab.
Initial capitalization of the key names in the kbd text role.
Add Python type hints for custom kittens.
Note about hyperlink support for ls on macOS.
Add description text for show_key.
2022-04-27 16:14:54 +08:00
Kovid Goyal
d5c48ddb94
Allow inputting fingerprint check 2022-03-12 08:23:10 +05:30
Kovid Goyal
14e0b01b40
Echo asterisks when inputting the password 2022-03-11 16:44:08 +05:30
Kovid Goyal
5bb6b29ca3
Allow controlling the prompt used to input the password 2022-03-11 16:44:08 +05:30
Kovid Goyal
61558d518e
Get askpass basically working 2022-03-11 16:44:08 +05:30
Kovid Goyal
0a3acd9738
ask kitten: Use buttons for choices as well 2022-01-22 13:57:25 +05:30
Kovid Goyal
d4e7587686
use underline instead of color for default choice 2022-01-22 12:35:43 +05:30
Kovid Goyal
32e31a3c6b
Cancelling the choice kitten should return the empty response 2022-01-22 12:13:32 +05:30
Kovid Goyal
9419125387
Highlight the default choice in yellow 2022-01-22 11:45:01 +05:30
Kovid Goyal
1bbab217d0
ask kitten: Always have a default choice 2022-01-22 11:39:54 +05:30
Kovid Goyal
05d648d411
ask kitten: Draw yes/no buttons 2022-01-22 11:32:26 +05:30
Kovid Goyal
5c832d3190
Allow multiple clickable ranges 2022-01-22 10:52:44 +05:30
Kovid Goyal
0d33380e6a
Cleanup previous PR
yesno default should be yes.
Pressing q to quit is undiscoverable
Clicking empty cells should not trigger buttons as that is
undiscoverable and possibly surprising
2022-01-22 10:44:01 +05:30
Kovid Goyal
9944b895a6
Merge branch 'kitten-ask' of https://github.com/page-down/kitty 2022-01-22 10:06:52 +05:30
Kovid Goyal
fe7045dd2f
Ask kitten: Fix rendering of multiline messages 2022-01-22 09:40:05 +05:30
pagedown
4fe10fadb0
... 2022-01-22 09:45:32 +08:00
pagedown
88ee5e95fc
Add default choices for features that use ask kitten 2022-01-22 03:21:59 +08:00
pagedown
9a119255fe
ask kitten: Use the default value as input text
Prefill the current value when changing the tab title.
2022-01-22 03:11:39 +08:00
pagedown
7ce11050cd
ask kitten: Esc to abort and Enter to confirm the default choice 2022-01-22 02:50:50 +08:00
pagedown
9b4d1219b8
Add default choice option for ask kitten 2022-01-22 02:46:37 +08:00
pagedown
4dd29c726a
Make the clickable range of No the same as Yes
Since the two options are treated equally, the same amount of mouse
clickable range are given.
2022-01-22 02:41:52 +08:00
Kovid Goyal
17e31565e2
Get it working even with 2 row windows assuming they are wide enough to fit the title on a single line 2022-01-21 21:46:27 +05:30
Kovid Goyal
dd72deb546
Allow ask kitten to function in a 3 line window 2022-01-21 21:43:25 +05:30
Kovid Goyal
cd0ca95877
Improve the UI of the ask kitten
Center the text in the window and allow pressing enter/esc when doing a
yes/no question

Fixes #4545
2022-01-21 20:02: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
b1375e5ed1
ask kitten: Allow clicking on a choice to select it
Fixes #4071
2021-09-28 20:13:11 +05:30
Kovid Goyal
0f9d6a1e4a
Forgot to clear screen before drawing 2021-09-28 12:56:19 +05:30
Kovid Goyal
276696414e
Use a full handler for choices in the ask kitten 2021-09-28 09:14:34 +05:30
Kovid Goyal
7f1c5d8534
DRYer 2021-08-21 17:32:55 +05:30
Kovid Goyal
d60020f5ac
Allow copying hyperlink URL to clipboard 2020-09-15 13:23:31 +05:30
Kovid Goyal
437efe5473
Allow using the ask kitten to pick a choice 2020-09-15 12:39:07 +05:30
Kovid Goyal
e6839b45e3
typo 2020-09-10 11:57:41 +05:30
Kovid Goyal
5768cc98b6
... 2020-05-15 13:31:35 +05:30
Kovid Goyal
da1cc6c1c5
Add a yes/no mode to the ask kitten 2020-05-15 13:16:14 +05:30
Kovid Goyal
382c31ddf2
Use a stub rather than TYPE_CHECKING 2020-03-15 13:27:40 +05:30
Kovid Goyal
149ae2866a
more typing work 2020-03-12 08:10:51 +05:30
Kovid Goyal
afec07b124
More typing work 2020-03-06 14:19:46 +05:30
Kovid Goyal
f05890719d
Add type checking for the various CLI options objects 2020-03-05 15:47:12 +05:30
Kovid Goyal
a4cc10c41b
More typing work 2020-03-04 06:10:57 +05:30
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
66a52ac588
Also ignore failure to read readline history in the ask kitten 2018-06-22 17:23:55 +05:30
Kovid Goyal
f68f8bf9c9
macOS: Fix changing tab title and kitty shell not working
I forgot that Apple has its own special snowflake readline variant.
Fixes #494
2018-04-27 15:16:26 +05:30