SSH session with iTerm2 auto-writes 'iTerm2 3.6.5Gi-1;invalid payload' in agent panel
https://github.com/user-attachments/assets/80f9d788-02e9-4c71-aab3-a68f262ef719
Issue Description
When SSHing into a Linux server using iTerm2 and running opencode, the text 'iTerm2 3.6.5Gi-1;invalid payload' is automatically written in the agent panel where I would normally type my request.
Environment
- Local: macOS with iTerm2 3.6.5
- Remote: Linux server (accessed via SSH)
- opencode version: latest
Steps to Reproduce
- SSH into a Linux server from iTerm2
- Run opencode
- Observe the auto-written text in the agent panel
Expected Behavior
The agent panel should be empty and ready for user input.
Actual Behavior
Text 'iTerm2 3.6.5Gi-1;invalid payload' is automatically inserted.
Video
[Video demonstration will be attached manually]
This appears to be related to iTerm2 shell integration or terminal emulation when running over SSH.
The error is gone now i ssh'd again and installed shell integration while in server, then restarted the terminal.
"installed shell integration" what does this mean?
"installed shell integration" what does this mean?
I've had similar issues in iTerm2. OpenCode sometimes starts with a text field filled with a Gi=1;invalid payload.
It seems I don't have Shell Integration installed, since the ~/.iterm2_shell_integration.zsh file is missing (I use Zsh). What's more interesting is that the Main Menu → iTerm2 → Install Shell Integration option is disabled/grayed out. I haven't looked into it deeply, but I saw a suggestion that this iTerm2 issue (inability to install shell integration) might be caused by a conflict with Oh My Zsh (which I also use).
I can also confirm that the main issue (Gi=1;invalid payload inserted in the text field) occurs only in OpenCode version 1.0.x
@falconepl For me as well, see screenshot below. I'm on macOS Tahoe 26.1 (latest), OpenCode 1.55 & iTerm 3.6.5 – but I have installed the iTerm Shell integration. So the Shell Integration may not be related to this issue. I have not encountered this weird message in Visual Studio Code: neither in zsh nor in bash.
❌ Screenshot from iTerm 3.6.5 (Shell Integration installed) » zsh:
✅ Here's a Screenshot from Visual Studio Code » zsh:
✅ Here's a Screenshot from Visual Studio Code » bash: