More work on porting rc commands

This commit is contained in:
Kovid Goyal
2022-08-30 21:05:31 +05:30
parent a4b2e2a196
commit 192eccc6cc
4 changed files with 25 additions and 4 deletions

View File

@@ -261,6 +261,7 @@ class RemoteCommand:
options_class: Type[RCOptions] = RCOptions
protocol_spec: str = ''
argspec = args_count = args_completion = ArgsHandling()
field_to_option_map: Optional[Dict[str, str]] = None
def __init__(self) -> None:
self.desc = self.desc or self.short_desc

View File

@@ -69,6 +69,8 @@ type=bool-set
Get text from the window this command is run in, rather than the active window.
'''
field_to_option_map = {'wrap_markers': 'add_wrap_markers', 'cursor': 'add_cursor'}
def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType:
return {
'match': opts.match,

View File

@@ -47,6 +47,11 @@ class Launch(RemoteCommand):
logo_position/str: Window logo position as string or empty string to use default
logo_alpha/float: Window logo alpha or -1 to use default
self/bool: Boolean, if True use tab the command was run in
os_window_title/str: Title for OS Window
os_window_name/str: WM_NAME for OS Window
os_window_class/str: WM_CLASS for OS Window
color/list.str: list of color specifications such as foreground=red
watcher/list.str: list of paths to watcher files
'''
short_desc = 'Run an arbitrary process in a new window/tab'