After some experimentation I discovered that the terminal title can only adopt new values and a change to set it back to a previous value is always lost.
My agent tells me that this is because dispatch_osc is decorated with @lru_cache - but it has a side-effect, calling terminal.set_title(data), which is skipped on cache hit.
After some experimentation I discovered that the terminal title can only adopt new values and a change to set it back to a previous value is always lost.
My agent tells me that this is because
dispatch_oscis decorated with@lru_cache- but it has a side-effect, callingterminal.set_title(data), which is skipped on cache hit.