opencode icon indicating copy to clipboard operation
opencode copied to clipboard

SSH session with iTerm2 auto-writes 'iTerm2 3.6.5Gi-1;invalid payload' in agent panel

Open shariqriazz opened this issue 1 year ago • 5 comments

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

  1. SSH into a Linux server from iTerm2
  2. Run opencode
  3. 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.

shariqriazz avatar Nov 02 '25 18:11 shariqriazz

The error is gone now i ssh'd again and installed shell integration while in server, then restarted the terminal.

shariqriazz avatar Nov 02 '25 18:11 shariqriazz

"installed shell integration" what does this mean?

thdxr avatar Nov 02 '25 18:11 thdxr

"installed shell integration" what does this mean?

Image

shariqriazz avatar Nov 02 '25 22:11 shariqriazz

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

przemyslawsokol avatar Nov 05 '25 18:11 przemyslawsokol

@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:

Image

✅ Here's a Screenshot from Visual Studio Code » zsh:

Image

✅ Here's a Screenshot from Visual Studio Code » bash:

Image

jschmdt avatar Nov 12 '25 02:11 jschmdt