You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/features/shell-integration.md
+25-33Lines changed: 25 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,59 +43,51 @@ Maximum time to wait for shell integration to initialize before executing comman
43
43
#### Terminal Command Delay
44
44
<imgsrc="/img/shell-integration/shell-integration-2.png"alt="Terminal command delay slider set to 0ms"width="600" />
45
45
46
-
Adds a delay after command execution to ensure full output capture. Implemented using `PROMPT_COMMAND='sleep N'` in bash/zsh or `start-sleep` in PowerShell. Originally a workaround for VSCode bug #237208, may not be needed on most systems. Default: 0ms (disabled).
46
+
Adds a small pause after running commands to help Roo capture all output correctly. This is helpful if Roo seems to miss parts of command output or reacts before commands finish. Default: 0ms (disabled).
Appends a unique counter to PowerShell commands to prevent duplicate command issues. Enable this if PowerShell fails to execute identical consecutive commands.
53
+
Helps PowerShell run the same command multiple times in a row. Enable this if you notice Roo can't run identical commands consecutively in PowerShell.
54
54
55
55
#### Clear ZSH EOL Mark
56
56
<imgsrc="/img/shell-integration/shell-integration-4.png"alt="Clear ZSH EOL mark checkbox"width="600" />
57
57
58
-
Sets `PROMPT_EOL_MARK=""` to clear ZSH end-of-line marks, preventing issues with command output when output ends with special characters like '%'.
58
+
Prevents ZSH from adding special characters at the end of output lines that can confuse Roo when reading terminal results.
59
59
60
60
#### Oh My Zsh Integration
61
61
<imgsrc="/img/shell-integration/shell-integration-5.png"alt="Enable Oh My Zsh integration checkbox"width="600" />
62
62
63
-
Sets `ITERM_SHELL_INTEGRATION_INSTALLED="Yes"` to enable proper integration with Oh My Zsh. Experimental feature for users of Oh My Zsh.
63
+
Makes Roo work better with the popular Oh My Zsh shell customization framework. Turn this on if you use Oh My Zsh and experience terminal issues.
Creates a temporary directory for ZDOTDIR to handle ZSH shell integration properly while preserving your ZSH configuration.
73
+
Helps Roo work with custom ZSH configurations without interfering with your personal shell settings and customizations.
74
74
75
75
## How Shell Integration Works
76
76
77
-
Shell integration uses terminal sequences to mark different stages of command execution:
77
+
Shell integration connects Roo to your terminal's command execution process in real-time:
78
78
79
-
1.**Activation**: When you open a terminal, your shell sends an activation sequence (`\x1b]633;A\x07`).
79
+
1.**Connection**: When you open a terminal, VS Code establishes a special connection with your shell.
80
80
81
-
2.**Command Lifecycle**: VSCode tracks each command using Operating System Command (OSC) sequences:
82
-
- OSC 633;A - Mark prompt start
83
-
- OSC 633;B - Mark command start
84
-
- OSC 633;C - Mark command executed
85
-
- OSC 633;D - Mark command finished with exit code
86
-
- OSC 633;E - Set command line
87
-
- OSC 633;P - Set properties like current working directory
81
+
2.**Command Tracking**: VS Code monitors your terminal activities by detecting:
82
+
- When a new prompt appears
83
+
- When you enter a command
84
+
- When the command starts running
85
+
- When the command finishes (and whether it succeeded or failed)
86
+
- What directory you're currently in
88
87
89
-
3.**Shell-Specific Implementation**:
88
+
3.**Different Shells, Same Result**: Each shell type (Bash, Zsh, PowerShell, Fish) implements this slightly differently behind the scenes, but they all provide the same functionality to Roo.
| PowerShell |`prompt` function |`PSConsoleHostReadLine`|`prompt` function |
96
-
| Fish |`fish_prompt`|`fish_preexec`|`fish_prompt`|
97
-
98
-
4.**Output Capture**: Roo Code captures command text, working directory, start/end times, exit codes, and output streams.
90
+
4.**Information Gathering**: Roo can see what commands are running, where they're running, how long they take, whether they succeed, and their complete output - all without you having to copy and paste anything.
99
91
100
92
## Troubleshooting Shell Integration
101
93
@@ -188,28 +180,28 @@ Visual indicators of active shell integration:
188
180
189
181
### Ctrl+C Behavior
190
182
191
-
**Issue**: If text is in the terminal when Roo runs a command, shell integration sends Ctrl+C first, breaking output capture.
183
+
**Issue**: If text is already typed in the terminal when Roo tries to run a command, Roo will press Ctrl+C first to clear the line, which can interrupt running processes.
192
184
193
-
**Workaround**: Ensure terminal prompt is clean before letting Roo run commands.
185
+
**Workaround**: Make sure your terminal prompt is empty (no partial commands typed) before asking Roo to execute terminal commands.
194
186
195
187
### Multi-line Command Issues
196
188
197
-
**Issue**: Multi-line commands produce unexpected behavior with phantom output from previous commands.
189
+
**Issue**: Commands that span multiple lines can confuse Roo and may show output from previous commands mixed in with current output.
198
190
199
-
**Workaround**: Use command chaining with `&&`instead of multiple lines (e.g., `echo a && echo b`).
191
+
**Workaround**: Instead of multi-line commands, use command chaining with `&&`to keep everything on one line (e.g., `echo a && echo b` instead of typing each command on a separate line).
200
192
201
193
### PowerShell-Specific Issues
202
194
203
-
1.**Output Buffering**: PowerShell may emit completion markers before output is fully processed.
204
-
2.**Duplicate Commands**: PowerShell fails to execute identical consecutive commands.
195
+
1.**Premature Completion**: PowerShell sometimes tells Roo a command is finished before all the output has been shown.
196
+
2.**Repeated Commands**: PowerShell may refuse to run the same command twice in a row.
205
197
206
-
**Workaround**: Enable the "PowerShell counter workaround" setting and set a terminal command delay of 150ms.
198
+
**Workaround**: Enable the "PowerShell counter workaround" setting and set a terminal command delay of 150ms in the settings to give commands more time to complete.
207
199
208
200
### Incomplete Terminal Output
209
201
210
-
**Issue**: VSCode may not capture complete command output.
202
+
**Issue**: Sometimes VS Code doesn't show or capture all the output from a command.
211
203
212
-
**Workaround**: Close and reopen the terminal, then run the command again.
204
+
**Workaround**: If you notice missing output, try closing and reopening the terminal tab, then run the command again. This refreshes the terminal connection.
0 commit comments