Skip to content

Commit b2b82db

Browse files
committed
refactor: remove unused terminal helper
1 parent 2f9f09b commit b2b82db

2 files changed

Lines changed: 0 additions & 20 deletions

File tree

app/paste_service.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@ def _detect_active_window_class() -> Optional[str]:
9595
return window_class or None
9696

9797

98-
def _is_terminal_active() -> bool:
99-
window_class = _detect_active_window_class()
100-
return bool(window_class and window_class in _KNOWN_TERMINAL_WINDOW_CLASSES)
101-
102-
10398
class PasteServiceError(Exception):
10499
"""Raised when clipboard write or key injection fails hard."""
105100

tests/test_paste_service.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
PasteService,
1616
PasteServiceError,
1717
_detect_active_window_class,
18-
_is_terminal_active,
1918
)
2019

2120

@@ -81,20 +80,6 @@ def test_returns_none_if_display_not_set(self):
8180
run_mock.assert_not_called()
8281

8382

84-
class TestIsTerminalActive:
85-
def test_returns_true_for_terminal_window(self):
86-
with patch("app.paste_service._detect_active_window_class", return_value="konsole"):
87-
assert _is_terminal_active() is True
88-
89-
def test_returns_false_for_non_terminal_window(self):
90-
with patch("app.paste_service._detect_active_window_class", return_value="firefox"):
91-
assert _is_terminal_active() is False
92-
93-
def test_returns_false_when_detection_is_none(self):
94-
with patch("app.paste_service._detect_active_window_class", return_value=None):
95-
assert _is_terminal_active() is False
96-
97-
9883
class TestYdotoolPaste:
9984
def test_sends_ctrl_shift_v_when_terminal_active(self):
10085
service = PasteService(autopaste=True, key_delay_ms=135)

0 commit comments

Comments
 (0)