Skip to content

Commit 84ba285

Browse files
committed
docs(cc_notifier): clarify switched-away scenarios and focus command args
- document three switched-away detection scenarios in send_local_notification_if_needed - add iterm2_session_id parameter description to create_focus_command
1 parent 120292b commit 84ba285

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

cc_notifier.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,13 @@ def send_local_notification_if_needed(
254254
tmux_session_id: str = "",
255255
iterm2_session_id: str = "",
256256
) -> None:
257-
"""Send local notification if user switched away from original window."""
257+
"""Send local notification if user switched away from original window.
258+
259+
Detects three "switched away" scenarios:
260+
- User switched to a different window entirely
261+
- User switched iTerm2 tabs within the same window
262+
- User detached/switched tmux sessions within the same window
263+
"""
258264
# Without Hammerspoon, check tmux session before sending
259265
if original_window_id == "UNAVAILABLE":
260266
if tmux_session_id and is_tmux_session_attached(tmux_session_id):
@@ -595,8 +601,12 @@ def create_focus_command(
595601
596602
If the window cannot be found or focused, shows an error notification.
597603
604+
When iterm2_session_id is provided, chains an AppleScript command after
605+
the Hammerspoon focus to restore the specific iTerm2 tab/session.
606+
598607
Args:
599608
window_id: The window ID to focus
609+
iterm2_session_id: Optional iTerm2 session ID for tab restoration
600610
601611
Returns:
602612
List of command arguments for subprocess execution

0 commit comments

Comments
 (0)