Commit Graph

43 Commits

Author SHA1 Message Date
Kovid Goyal
5de8734ce3 choose-files kitten: Output a trailing newline when writing to a tty in text format
Fixes #9982
2026-05-07 08:53:09 +05:30
Павел Мешалкин
8ffdf7d7ee feat: add per-mapping --allow-fallback for layout-independent shortcuts
Add --allow-fallback option to the map command that controls shifted
and ascii (alternate_key) fallback for individual key mappings.

For non-Latin keyboard layouts, when the current layout key is
non-ascii (codepoint > 127 and < 0xE000), the alternate_key from
the base layout is used for matching if the mapping opts in via
--allow-fallback=shifted,ascii.

Default kitty bindings use --allow-fallback=shifted,ascii so they
work out of the box with non-Latin layouts. User custom mappings
default to --allow-fallback=shifted (preserving existing shifted_key
behavior without ascii fallback).

--allow-fallback=none disables all fallback for a mapping.

Python side: parse_options_for_map() in options/utils.py handles flag
parsing, ShortcutMapping uses it in __init__. get_shortcut() filters
candidates by per-mapping allow_fallback.

Go side: ParseMap() handles --allow-fallback, KeyAction stores
AllowFallback, ShortcutTracker.Match passes it to matching.
MatchesParsedShortcut defaults to shifted,ascii for hardcoded shortcuts.

Migrated kittens (themes, command_palette, diff, choose_files) to
use ShortcutTracker with configurable map entries.

Tests added for Python (5 test methods) and Go (ParseMap + key matching).
2026-03-25 19:34:13 +03:00
Kovid Goyal
a5433b8994 kitten choose-files: Add a new binding of Alt+Enter to modify the name of an existing file when choosing a save file name
Fixes #9387
2026-01-26 11:50:08 +05:30
Kovid Goyal
c815e580ea Fix warning when generating docs 2025-12-05 20:11:23 +05:30
Kovid Goyal
772805b8ec choose files: Add arbitrary command based previews
Needs testing. Someday.
2025-12-05 19:54:21 +05:30
Kovid Goyal
438114d880 DRYer 2025-11-26 21:22:47 +05:30
Kovid Goyal
222bf3cb0b Handle multiple results when invoked from mapping 2025-11-26 21:19:30 +05:30
Kovid Goyal
8c17b1bc2f ... 2025-11-26 21:16:48 +05:30
Kovid Goyal
f8db2702db choose files: Add a few more output formats 2025-11-26 21:13:57 +05:30
Kovid Goyal
e2092d5e60 ... 2025-11-23 18:37:26 +05:30
Kovid Goyal
aef9988c62 Allow configuring how video previews are generated 2025-11-23 18:28:59 +05:30
Kovid Goyal
fae50137a9 Add a clear cache action 2025-11-23 12:15:29 +05:30
Kovid Goyal
37da04aad6 choose files: Add default mappings to choose a file and insert it into the terminal 2025-11-23 11:41:21 +05:30
Kevin Klement
d979be915c Update main.py
Fix misspellings of "within"
2025-11-11 08:33:05 -05:00
Kovid Goyal
4af95b3c51 choose_files: start work on image previews 2025-10-07 11:11:42 +05:30
Kovid Goyal
0f67ff37df Allow accepting the currently displayed parent directory by pressing ctrl+enter 2025-07-24 08:20:43 +05:30
Kovid Goyal
bd0f55531f Implement previews for plain text files 2025-07-20 19:24:17 +05:30
Kovid Goyal
2e92d610d5 Implement metadata based previews in choose-files 2025-07-20 09:31:17 +05:30
Kovid Goyal
fbe982e1aa choose files: Option to display title at top when OS titlebar is not available 2025-07-16 19:41:30 +05:30
Kovid Goyal
966f2cb700 Basic documentation for the choose files kitten 2025-07-16 13:15:27 +05:30
Kovid Goyal
c8a20dbe58 Start documenting the choose-files kitten 2025-07-16 06:16:38 +05:30
Kovid Goyal
8ce7346616 mapping to switch to typing a save file name 2025-07-11 21:09:38 +05:30
Kovid Goyal
ecdeea930b Implement bindings to move current to first/last 2025-07-11 10:59:29 +05:30
Kovid Goyal
513fd720eb Implement mouse interaction with result list 2025-07-11 10:36:20 +05:30
Kovid Goyal
3134941a84 Add keyboard shortcuts for toggling scan settings 2025-07-11 07:14:07 +05:30
Kovid Goyal
3469e1b044 Make the keyboard shortcuts configurable 2025-07-10 16:20:45 +05:30
Kovid Goyal
6f511ae66a Add a bunch of settings to control filesystem scanning 2025-07-10 10:30:48 +05:30
Kovid Goyal
76d0991b76 Work on filter support 2025-07-04 13:37:56 +05:30
Kovid Goyal
28b2f0c819 Support window title 2025-07-03 09:08:19 +05:30
Kovid Goyal
599f2956ce Finish up code to run file chooser 2025-07-03 08:50:03 +05:30
Kovid Goyal
7375ee5e52 More work on choose files integration 2025-07-02 14:49:24 +05:30
Kovid Goyal
9de6bfbbd7 More work on choose files kitten 2025-06-19 11:43:12 +05:30
Kovid Goyal
6880ecaa28 Work on save file name mode 2025-06-03 20:27:14 +05:30
Kovid Goyal
a16ad78de8 ... 2025-06-02 08:56:28 +05:30
Kovid Goyal
7ab37116d7 Implement only dir selection mode 2025-06-02 08:35:35 +05:30
Kovid Goyal
8d3b3f527c Let the user control recursion using the search pattern 2025-06-01 12:23:18 +05:30
Kovid Goyal
4d77c8739e Prefer lowercase entries
Also recurse to depth 1 by default. This matches behavior of GUI file
select dialogs and prevents perf problems
2025-06-01 09:01:43 +05:30
Kovid Goyal
a3ef734c83 ... 2025-05-25 13:56:37 +05:30
Kovid Goyal
96436f10f7 Allow modifying the score of matches using a regex 2025-05-23 11:31:50 +05:30
Kovid Goyal
aec8a6b0b4 Use a regular expression for exclusion 2025-05-22 23:06:28 +05:30
Kovid Goyal
68e3dd6f34 ... 2025-05-22 14:51:51 +05:30
Kovid Goyal
8e61758064 Work on setting up choose-files.conf 2025-05-22 14:19:50 +05:30
Kovid Goyal
fbfdb38260 Start work on choose files kitten 2025-05-20 12:32:43 +05:30