Add clipboard_control to query_terminal

This commit is contained in:
Kovid Goyal 2021-07-24 07:26:12 +05:30
parent 6d45a94125
commit 31da01d4df
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -87,7 +87,7 @@ class TerminalVersion(Query):
@query
class AllowHyperlinks(Query):
name: str = 'allow_hyperlinks'
help_text: str = 'yes, no or ask'
help_text: str = 'The :opt:`setting <allow_hyperlinks>` for allowing hyperlinks can be yes, no or ask'
@staticmethod
def get_result(opts: Options) -> str:
@ -152,6 +152,16 @@ class FontSize(Query):
return f'{opts.font_size:g}'
@query
class ClipboardControl(Query):
name: str = 'clipboard_control'
help_text: str = 'The :opt:`setting <clipboard_control>` for allowing reads/writes to/from the clipboard'
@staticmethod
def get_result(opts: Options) -> str:
return ' '.join(opts.clipboard_control)
def get_result(name: str) -> Optional[str]:
from kitty.fast_data_types import get_options
q = all_queries.get(name)