Feature hasn't been suggested before.
Describe the enhancement you want to request
Description
Problem
Currently, when using the ! command to enter shell mode in opencode TUI, the shell session exits immediately after executing a single command. This requires users to repeatedly type ! to execute multiple shell commands, which disrupts workflow efficiency.
Current Behavior
- Type
! to enter shell mode
- Execute a command (e.g.,
ls -la)
- Shell automatically exits and returns to opencode TUI
- Must type
! again for the next command
Expected Behavior
Option to keep shell session persistent:
- Type
! to enter shell mode
- Execute multiple commands without re-entering shell mode
- Use
exit or ctrl+d to manually exit shell mode
Use Cases
- Rapid file system exploration requiring multiple
ls, cd, find commands
- Git operations requiring multiple commands (
git status, git log, git diff)
- Development workflow with multiple build/test commands
- System administration tasks requiring multiple shell commands
Proposed Solutions
- Persistent Shell Mode Toggle: Add a configuration option to enable persistent shell mode
- Shell Mode Indicator: Visual indicator showing when in shell mode
- Graceful Exit: Use
exit command or ctrl+d to leave persistent shell mode
- Command History: Maintain shell command history across sessions
Implementation Ideas
- Environment variable:
OPENCODE_PERSISTENT_SHELL=true
- Config file option:
tui.persistent_shell: true
- Command toggle:
/persistent-shell to enable/disable mode
- Visual indicator in status bar when in persistent shell mode
Benefits
- Improved workflow efficiency for multi-command operations
- Reduced context switching between opencode and shell
- Better user experience for shell-heavy workflows
- Maintains opencode's integration benefits while providing shell flexibility
Operating System
All platforms (Linux, macOS, Windows)
Terminal
All supported terminals
OpenCode Version
Latest version (1.x)
Additional Notes
This issue is related to the current shell mode implementation where the ! command provides temporary shell access but exits after each command execution. The request is to enhance this feature to support persistent shell sessions for improved developer productivity.
References
Feature hasn't been suggested before.
Describe the enhancement you want to request
Description
Problem
Currently, when using the
!command to enter shell mode in opencode TUI, the shell session exits immediately after executing a single command. This requires users to repeatedly type!to execute multiple shell commands, which disrupts workflow efficiency.Current Behavior
!to enter shell models -la)!again for the next commandExpected Behavior
Option to keep shell session persistent:
!to enter shell modeexitorctrl+dto manually exit shell modeUse Cases
ls,cd,findcommandsgit status,git log,git diff)Proposed Solutions
exitcommand orctrl+dto leave persistent shell modeImplementation Ideas
OPENCODE_PERSISTENT_SHELL=truetui.persistent_shell: true/persistent-shellto enable/disable modeBenefits
Operating System
All platforms (Linux, macOS, Windows)
Terminal
All supported terminals
OpenCode Version
Latest version (1.x)
Additional Notes
This issue is related to the current shell mode implementation where the
!command provides temporary shell access but exits after each command execution. The request is to enhance this feature to support persistent shell sessions for improved developer productivity.References