iTerm crashes when trying to export a profile that contains status bar components that were generated via the Python API
Thanks for filing an issue! Please answer the questions below so I can help you.
- iTerm2 version: 3.4.20
- OS version: Ventura 13.5.2 (22G91)
- Attach ~/Library/Preferences/com.googlecode.iterm2.plist here (drag-drop from finder into this window)
- Attach a debug log, if possible. Instructions at https://iterm2.com/debuglog
- Attach a screen capture video if it would make the reproduction steps clearer.
- Are you reporting a performance issue, excessive CPU usage, or a hang? Please attach a sample. Instructions at https://gitlab.com/gnachman/iterm2/wikis/HowToSample
- Are you reporting a crash? Please attach the crash log. Instructions at https://gitlab.com/gnachman/iterm2/wikis/crash-logs
- Are you reporting excessive memory usage? Please attach a heap analysis: https://gitlab.com/gnachman/iterm2/wikis/heapshot
PLEASE ATTACH YOUR PLIST FILE FOR BUG REPORTS! Seriously! I'll probably ask you for it if you don’t.
Detailed steps to reproduce the problem:
- Create a status bar component using the Python API (code sample below)
- Add the component to your status bar
- Try to export your profile as json
What happened: iTerm reliably crashes when adding a status bar component that is generated via a script.
What should have happened: It should export the profile as json
iTerm2-2023-10-02-105548.ips com.googlecode.iterm2.plist
Code sample for creating a status bar component.
# Register an Ask Ava status bar component.
# Note: this doesn't actually put it in the status bar. It just makes it available for the user to drag in.
async def register_status_bar_ask_ava():
print("Registering ask ava")
knobs = []
component = iterm2.StatusBarComponent(
short_description="Ask Ava for help",
detailed_description="Ask Ava for help on your last command output or selected text",
exemplar="🥑 Ask Ava",
knobs=knobs,
update_cadence=None,
identifier="com.iterm2.askava.ask-ava-status-bar-component",
icons=[])
@iterm2.StatusBarRPC
async def coro_ask(knobs):
# This function is required but is only needed if the status bar updates. Ours doesn't.
return "🥑 Ask Ava"
@iterm2.RPC
async def click_ask_ava(session_id):
await ask_ava()
await component.async_register(connection, coro_ask, onclick=click_ask_ava)
await register_status_bar_ask_ava()