(mycli: 'MyCli')
| 201 | |
| 202 | |
| 203 | def set_external_multiplex_window_title(mycli: 'MyCli') -> None: |
| 204 | if not mycli.multiplex_window_title_format: |
| 205 | return |
| 206 | if not os.getenv('TMUX'): |
| 207 | return |
| 208 | if not mycli.prompt_session: |
| 209 | return |
| 210 | title = sanitize_terminal_title( |
| 211 | render_prompt_string( |
| 212 | mycli, |
| 213 | mycli.multiplex_window_title_format, |
| 214 | mycli.prompt_session.app.render_counter, |
| 215 | ) |
| 216 | ) |
| 217 | try: |
| 218 | subprocess.run( |
| 219 | ['tmux', 'rename-window', title], |
| 220 | check=False, |
| 221 | stdin=subprocess.DEVNULL, |
| 222 | stdout=subprocess.DEVNULL, |
| 223 | stderr=subprocess.DEVNULL, |
| 224 | ) |
| 225 | except FileNotFoundError: |
| 226 | pass |
| 227 | |
| 228 | |
| 229 | def set_external_multiplex_pane_title(mycli: 'MyCli') -> None: |
no test coverage detected