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

Open
opened 2026-02-16 17:35:57 -05:00 by yindo · 5 comments
Owner

Originally created by @shariqriazz on GitHub (Nov 2, 2025).

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.

Originally created by @shariqriazz on GitHub (Nov 2, 2025). 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.
yindo added the opentui label 2026-02-16 17:35:57 -05:00
Author
Owner

@shariqriazz commented on GitHub (Nov 2, 2025):

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

@shariqriazz commented on GitHub (Nov 2, 2025): The error is gone now i ssh'd again and installed shell integration while in server, then restarted the terminal.
Author
Owner

@thdxr commented on GitHub (Nov 2, 2025):

"installed shell integration" what does this mean?

@thdxr commented on GitHub (Nov 2, 2025): "installed shell integration" what does this mean?
Author
Owner

@shariqriazz commented on GitHub (Nov 2, 2025):

"installed shell integration" what does this mean?

Image
@shariqriazz commented on GitHub (Nov 2, 2025): > "installed shell integration" what does this mean? <img width="698" height="476" alt="Image" src="https://github.com/user-attachments/assets/7d8618b2-7410-4c24-894e-9b788d32ce99" />
Author
Owner

@przemyslawsokol commented on GitHub (Nov 5, 2025):

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 MenuiTerm2Install 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 commented on GitHub (Nov 5, 2025): 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
Author
Owner

@jschmdt commented on GitHub (Nov 11, 2025):

@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 commented on GitHub (Nov 11, 2025): @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**: <img width="682" height="637" alt="Image" src="https://github.com/user-attachments/assets/05a2754d-e3bf-4692-928b-ea84cf875eac" /> --- ✅ Here's a Screenshot from **Visual Studio Code » zsh**: <img width="743" height="381" alt="Image" src="https://github.com/user-attachments/assets/fd4f3f12-71db-4fd3-b09c-4a0077756e59" /> --- ✅ Here's a Screenshot from **Visual Studio Code » bash**: <img width="735" height="375" alt="Image" src="https://github.com/user-attachments/assets/c9a51ef5-04b8-4791-9767-556e4ef99d61" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2496