Description
When pasting multiple shell commands into shell mode, OpenCode does not preserve the newline as a real shell command separator. The pasted newline appears to be escaped or flattened before execution, so the second command becomes part of the first command's argument.
This differs from normal shell behavior, where a newline between commands is a valid command separator.
I also tested the same input in Claude Code and Pi, and both preserve the newline semantics and execute the commands correctly.
Why this matters
Pasting multi-line shell snippets from documentation is a common CLI workflow.
Plugins
@mohak34/opencode-notifier@latest, opencode-btw
OpenCode version
1.14.44
Steps to reproduce
- Open OpenCode.
- Enter shell mode.
- Paste the following two-line command block:
curl -O https://raw.githubusercontent.com/BerriAI/litellm/main/docker-compose.yml
curl -O https://raw.githubusercontent.com/BerriAI/litellm/main/prometheus.yml
- Check the downloaded files:
$ ls
$ cat docker-compose.ymlncurl
Expected behavior
The pasted input should preserve the real newline between commands, equivalent to running:
curl -O https://raw.githubusercontent.com/BerriAI/litellm/main/docker-compose.yml
curl -O https://raw.githubusercontent.com/BerriAI/litellm/main/prometheus.yml
Expected result:
docker-compose.yml
prometheus.yml
Actual behavior
The newline is not preserved as a shell command separator. Instead, it appears to be escaped or flattened and interpreted as part of the command argument.
Observed result:
$ ls
docker-compose.ymlncurl prometheus.yml
$ cat docker-compose.ymlncurl
404: Not Found
This suggests the command may be executed as:
curl -O https://raw.githubusercontent.com/BerriAI/litellm/main/docker-compose.yml\ncurl -O https://raw.githubusercontent.com/BerriAI/litellm/main/prometheus.yml
Screenshot and/or share link
Operating System
NixOS 26.05 (Yarara) x86_64
Terminal
ghostty 1.3.1
Description
When pasting multiple shell commands into shell mode, OpenCode does not preserve the newline as a real shell command separator. The pasted newline appears to be escaped or flattened before execution, so the second command becomes part of the first command's argument.
This differs from normal shell behavior, where a newline between commands is a valid command separator.
I also tested the same input in Claude Code and Pi, and both preserve the newline semantics and execute the commands correctly.
Why this matters
Pasting multi-line shell snippets from documentation is a common CLI workflow.
Plugins
@mohak34/opencode-notifier@latest, opencode-btw
OpenCode version
1.14.44
Steps to reproduce
Expected behavior
The pasted input should preserve the real newline between commands, equivalent to running:
Expected result:
Actual behavior
The newline is not preserved as a shell command separator. Instead, it appears to be escaped or flattened and interpreted as part of the command argument.
Observed result:
This suggests the command may be executed as:
curl -O https://raw.githubusercontent.com/BerriAI/litellm/main/docker-compose.yml\ncurl -O https://raw.githubusercontent.com/BerriAI/litellm/main/prometheus.ymlScreenshot and/or share link
Operating System
NixOS 26.05 (Yarara) x86_64
Terminal
ghostty 1.3.1