Prevent incoming output from bypassing auto-read toggle
This commit is contained in:
@@ -27,6 +27,8 @@ class command:
|
||||
return
|
||||
if not self.env["runtime"]["ScreenManager"].is_delta():
|
||||
return
|
||||
if not self.env["screen"].get("new_delta_is_typing", False):
|
||||
return
|
||||
|
||||
x_move = (
|
||||
self.env["screen"]["new_cursor"]["x"]
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
# Fenrir TTY screen reader
|
||||
# By Chrys, Storm Dragon, and contributors.
|
||||
|
||||
version = "2026.07.12"
|
||||
version = "2026.07.19"
|
||||
code_name = "testing"
|
||||
|
||||
@@ -344,6 +344,7 @@ def test_large_insertion_echo_speaks_pasted_cursor_text():
|
||||
"old_cursor": {"x": 2, "y": 0},
|
||||
"new_cursor": {"x": 13, "y": 0},
|
||||
"new_delta": "hello world",
|
||||
"new_delta_is_typing": True,
|
||||
},
|
||||
}
|
||||
command = large_insertion_module.command()
|
||||
@@ -359,6 +360,41 @@ def test_large_insertion_echo_speaks_pasted_cursor_text():
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_large_insertion_echo_ignores_incoming_cursor_progress():
|
||||
large_insertion_module = _load_large_insertion_module()
|
||||
output_manager = Mock(present_text=Mock())
|
||||
settings_manager = Mock()
|
||||
settings_manager.get_setting_as_bool.return_value = False
|
||||
input_manager = Mock()
|
||||
input_manager.get_last_deepest_input.return_value = []
|
||||
input_manager.get_last_event.return_value = None
|
||||
screen_manager = Mock(
|
||||
is_screen_change=Mock(return_value=False),
|
||||
is_delta=Mock(return_value=True),
|
||||
)
|
||||
env = {
|
||||
"runtime": {
|
||||
"InputManager": input_manager,
|
||||
"OutputManager": output_manager,
|
||||
"ScreenManager": screen_manager,
|
||||
"SettingsManager": settings_manager,
|
||||
},
|
||||
"screen": {
|
||||
"old_cursor": {"x": 0, "y": 0},
|
||||
"new_cursor": {"x": 12, "y": 0},
|
||||
"new_delta": "upgrading 1/3",
|
||||
"new_delta_is_typing": False,
|
||||
},
|
||||
}
|
||||
command = large_insertion_module.command()
|
||||
command.initialize(env)
|
||||
|
||||
command.run()
|
||||
|
||||
output_manager.present_text.assert_not_called()
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_large_insertion_echo_defers_recent_tab_to_tab_completion():
|
||||
large_insertion_module = _load_large_insertion_module()
|
||||
|
||||
Reference in New Issue
Block a user