mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-06 16:05:05 +02:00
A new watcher option for kitty.conf that replaces the old --watcher cli flag
Applies to all windows, not just initial ones.
This commit is contained in:
15
kitty/cli.py
15
kitty/cli.py
@@ -571,15 +571,6 @@ def parse_cmdline(oc: Options, disabled: OptionSpecSeq, ans: Any, args: Optional
|
||||
return leftover_args
|
||||
|
||||
|
||||
WATCHER_DEFINITION = '''
|
||||
--watcher -w
|
||||
type=list
|
||||
Path to a python file. Appropriately named functions in this file will be called
|
||||
for various events, such as when the window is resized, focused or closed. See the section
|
||||
on watchers in the launch command documentation :doc:`launch`. Relative paths are
|
||||
resolved relative to the kitty config directory.'''
|
||||
|
||||
|
||||
def options_spec() -> str:
|
||||
if not hasattr(options_spec, 'ans'):
|
||||
OPTIONS = '''
|
||||
@@ -627,11 +618,6 @@ Path to a file containing the startup :italic:`session` (tabs, windows, layout,
|
||||
Use - to read from STDIN. See the README file for details and an example.
|
||||
|
||||
|
||||
{watcher}
|
||||
Note that this watcher will be added only to all initially created windows, not new windows
|
||||
created after startup.
|
||||
|
||||
|
||||
--hold
|
||||
type=bool-set
|
||||
Remain open after child process exits. Note that this only affects the first
|
||||
@@ -731,7 +717,6 @@ type=bool-set
|
||||
'''
|
||||
setattr(options_spec, 'ans', OPTIONS.format(
|
||||
appname=appname, config_help=CONFIG_HELP.format(appname=appname, conf_name=appname),
|
||||
watcher=WATCHER_DEFINITION
|
||||
))
|
||||
ans: str = getattr(options_spec, 'ans')
|
||||
return ans
|
||||
|
||||
Reference in New Issue
Block a user