StatusBar component with Python API
Thanks for filing an issue! Please answer the questions below so I can help you.
- iTerm2 version: latest (Build 3.4.18)
- OS version: macOS Ventura 13.0.1
- It's a performance issue
Install a StatusBar component built with the current python script:
import iterm2
async def main(connection):
app = await iterm2.async_get_app(connection)
component = iterm2.StatusBarComponent(
short_description='test',
detailed_description='test',
knobs=[],
exemplar='test',
update_cadence=1,
identifier='test.test'
)
@iterm2.StatusBarRPC
async def tick(knobs):
window = app.current_terminal_window
tab = window.current_tab
session = app.get_session_by_id(tab.active_session_id)
tty = await session.async_get_variable('tty')
print(tty)
return tty
await component.async_register(connection, tick)
iterm2.run_forever(main)
Detailed steps to reproduce the problem:
- Install the script
- Add the status bar component to the status bar
- Create 2 or 3 panes in a single window
- Open the logs of the scripts
What happened: In the logs we can see that there's one print per pane
What should have happened: There should be one print per window (since the status bar is attached to a window)
Edited by Julien Barbay