Skip to content

Commit

Permalink
When mapping a custom kitten allow using shell escaping for the kitte…
Browse files Browse the repository at this point in the history
…n path

Fixes #8178
  • Loading branch information
kovidgoyal committed Dec 31, 2024
1 parent dac6f88 commit 909bccb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ consumption to do the same tasks.
Detailed list of changes
-------------------------------------

0.38.2 [future]

- When mapping a custom kitten allow using shell escaping for the kitten path (:iss:`8178`)

0.38.1 [2024-12-26]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
8 changes: 3 additions & 5 deletions kitty/options/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,10 @@ def send_key(func: str, rest: str) -> FuncArgsType:

@func_with_args('run_kitten', 'run_simple_kitten', 'kitten')
def kitten_parse(func: str, rest: str) -> FuncArgsType:
parts = to_cmdline(rest)
if func == 'kitten':
args = rest.split(maxsplit=1)
else:
args = rest.split(maxsplit=2)[1:]
func = 'kitten'
return func, [args[0]] + (to_cmdline(args[1]) if len(args) > 1 else [])
return func, parts
return 'kitten', args[1:]


@func_with_args('open_url')
Expand Down
3 changes: 3 additions & 0 deletions kitty_tests/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ def ac(which=0):
self.ae((ac().func, ac(1).func), ('new_window', 'launch'))
self.ae(ac(1).args, ('--moo', 'XXX'))

opts = p('clear_all_shortcuts y', 'action_alias ss kitten "space 1"', 'map f1 ss "space 2"')
self.ae(ac().args, ('space 1', 'space 2'))

opts = p('kitty_mod alt')
self.ae(opts.kitty_mod, to_modifiers('alt'))
self.ae(next(keys_for_func(opts, 'next_layout')).mods, opts.kitty_mod)
Expand Down

0 comments on commit 909bccb

Please sign in to comment.