The dialog was drawn by writing newlines and relying on the terminal to
wrap long lines, recording clickable ranges assuming nothing scrolled or
wrapped. When the content was taller than the window, the screen
scrolled and every clickable range was off by the scroll amount.
Now the full layout is computed up front, with clickable ranges relative
to it, and rows are drawn with absolute cursor positioning and line
wrapping disabled, so the terminal never scrolls or wraps. The boxed
choice layout is used only if it fits entirely, otherwise the compact
one is used, and if even that does not fit, the content is bottom
aligned so the choices remain visible. Choices too wide for the screen
are truncated with an ellipsis.
Also fix:
- The hidden text placeholder not being clickable when it wraps over
multiple lines, its clickable range going stale after a resize, and
its range including one cell too many.
- Compact choice ranges being computed by iterating over a map, putting
them in random order when several choices share a line.
- An empty box row or compact row being output when the first choice is
wider than the screen.
- truncate_at_space using a cell width as a byte offset, splitting
multi-byte characters, and looping forever when a character is wider
than the available width.
Closes#10883
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
This prevents accidental execution of script files via MIME type
association from programs that unconditionally "open"
attachments/downloaded files via MIME type associations.
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
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
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.
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