Closed
Description
for window in session.list_windows():
if window.name == "test_window":
target_window = window
break
if target_window == None:
target_window = session.new_window(attach=True, window_name="test_window")
target_window.select_window()
target_window.panes[0].send_keys("exec zsh")
The code above will crash, when the window exists and we then check the if target_window == None
because of:
def __eq__(self, other: object) -> bool:
assert isinstance(other, Window)
return self.window_id == other.window_id
I guess it would be better to remove the assert and return false. Should I do a PR?
Metadata
Metadata
Assignees
Labels
No labels