Allow the URL hints kitten to insert the selected URL into the terminal
This commit is contained in:
parent
2cf8c6aea7
commit
75b5130d96
@ -212,6 +212,8 @@ OPTIONS = partial('''\
|
|||||||
default=default
|
default=default
|
||||||
What program to use to open matched URLs. Defaults
|
What program to use to open matched URLs. Defaults
|
||||||
to the default URL open program for the operating system.
|
to the default URL open program for the operating system.
|
||||||
|
Use a value of - to paste the URL into the terminal window
|
||||||
|
instead.
|
||||||
|
|
||||||
|
|
||||||
--regex
|
--regex
|
||||||
@ -239,4 +241,9 @@ def main(args):
|
|||||||
|
|
||||||
def handle_result(args, data, target_window_id, boss):
|
def handle_result(args, data, target_window_id, boss):
|
||||||
program = data['program']
|
program = data['program']
|
||||||
boss.open_url(data['url'], None if program == 'default' else program)
|
if program == '-':
|
||||||
|
w = boss.window_id_map.get(target_window_id)
|
||||||
|
if w is not None:
|
||||||
|
w.paste(data['url'])
|
||||||
|
else:
|
||||||
|
boss.open_url(data['url'], None if program == 'default' else program)
|
||||||
|
|||||||
@ -432,9 +432,11 @@ map ctrl+shift+backspace restore_font_size
|
|||||||
map ctrl+shift+f11 toggle_fullscreen
|
map ctrl+shift+f11 toggle_fullscreen
|
||||||
map ctrl+shift+u input_unicode_character
|
map ctrl+shift+u input_unicode_character
|
||||||
map ctrl+shift+f2 edit_config_file
|
map ctrl+shift+f2 edit_config_file
|
||||||
# Open a currently visible URL using the keyboard. The program used to open the URL is specified in open_url_with.
|
# Open a currently visible URL using the keyboard. The program used to open the
|
||||||
# You can customize how the URLs are detected and opened by specifying command line options to
|
# URL is specified in open_url_with. You can customize how the URLs are
|
||||||
# url_hints. For example:
|
# detected and opened by specifying command line options to url_hints. The
|
||||||
|
# special value of - for --program will cause the selected URL to be inserted
|
||||||
|
# into the terminal. For example:
|
||||||
# map ctrl+shift+e run_kitten text url_hints --program firefox --regex "http://[^ ]+"
|
# map ctrl+shift+e run_kitten text url_hints --program firefox --regex "http://[^ ]+"
|
||||||
map ctrl+shift+e run_kitten text url_hints
|
map ctrl+shift+e run_kitten text url_hints
|
||||||
# Open the kitty shell in a new window/tab/overlay/os_window to control kitty using commands.
|
# Open the kitty shell in a new window/tab/overlay/os_window to control kitty using commands.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user