-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca4d730
commit 0f2de0a
Showing
12 changed files
with
1,013 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from typing import List | ||
from typing import Iterable | ||
from kitty.boss import Boss | ||
from kitty.fast_data_types import get_options | ||
from kitty.debug_config import debug_config | ||
from kittens.tui.handler import result_handler | ||
import re | ||
import os | ||
import inspect | ||
|
||
ksb_dir = os.path.dirname( | ||
os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))) | ||
|
||
|
||
def main(): | ||
raise SystemExit('Must be run as kitten kitty_debug_config') | ||
|
||
|
||
@result_handler(type_of_input=None, no_ui=True, has_ready_notification=False) | ||
def handle_result(args: List[str], | ||
result: str, | ||
target_window_id: int, | ||
boss: Boss) -> None: | ||
del args[0] | ||
# boss.run_background_process(['touch', 'yip'], '/Users/mike/tmp') | ||
kitten_args = [ | ||
'--no-nvim-args', | ||
'--config', | ||
'ksb_example_get_text_last_non_empty_output_plain' | ||
] | ||
boss.run_kitten_with_metadata( | ||
'/Users/mike/gitrepos/kitty-scrollback.nvim/python/kitty_scrollback_nvim.py', | ||
kitten_args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from typing import List | ||
from kitty.boss import Boss | ||
from kittens.tui.handler import result_handler | ||
|
||
|
||
def main(): | ||
raise SystemExit('Must be run as kitten kitty_scroll_prompt') | ||
|
||
|
||
@result_handler(type_of_input=None, no_ui=True, has_ready_notification=False) | ||
def handle_result(args: List[str], | ||
result: str, | ||
target_window_id: int, | ||
boss: Boss) -> None: | ||
w = boss.window_id_map.get(target_window_id) | ||
if w is not None: | ||
print(w.child.environ) # this prints an empty dictionary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from typing import List | ||
from kitty.boss import Boss | ||
from kittens.tui.handler import result_handler | ||
from kitty.key_encoding import CTRL, SHIFT | ||
from kitty.fast_data_types import PRESS, send_mouse_event | ||
from kitty.fast_data_types import click_mouse_cmd_output, move_cursor_to_mouse_if_in_prompt | ||
|
||
|
||
def main(): | ||
raise SystemExit('Must be run as kitten kitty_scroll_prompt') | ||
|
||
|
||
@result_handler(type_of_input=None, no_ui=True, has_ready_notification=False) | ||
def handle_result(args: List[str], | ||
result: str, | ||
target_window_id: int, | ||
boss: Boss) -> None: | ||
del args[0] | ||
direction = -1 # default to one previous | ||
if len(args) > 0: | ||
direction = int(args[0]) | ||
select_cmd_output = False | ||
if len(args) > 1: | ||
select_cmd_output = (args[1].lower() == 'true') | ||
w = boss.window_id_map.get(target_window_id) | ||
if w is not None: | ||
if direction == 0: | ||
click_mouse_cmd_output(w.os_window_id, | ||
w.tab_id, | ||
w.id, | ||
select_cmd_output) | ||
w.mouse_handle_click('prompt') | ||
else: | ||
w.scroll_to_prompt(direction) | ||
w.mouse_handle_click('prompt') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.