Changesets · Branches · Tags · Compare
| Changeset | e8ee99375f3e2e44c19e8ff7d33e207a9dd625dc48487a1aecbcdfd7cc3ef676 |
|---|---|
| Author | Patrick Erichsen <patrick.a.erichsen@gmail.com> · 2025-07-09 08:49 -07:00 |
| Committer | GitHub <noreply@github.com> · 2025-07-09 08:49 -07:00 |
| Parents | d1910f72e429, 3a41b87ed10f |
1 file changed
modified gui/src/redux/thunks/moveTerminalProcessToBackground.ts +10 −3
| @@ -10,9 +10,10 @@ | ||
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | 12 | * This thunk is used to move a terminal command to the background |
| 13 | - * when the user clicks the "Continue" button in the UI | |
| 13 | + * when the user clicks the "Move to background" link in the UI | |
| 14 | 14 | * |
| 15 | - * It marks the command as visually complete without stopping | |
| 15 | + * It preserves all existing terminal output, marks the command as | |
| 16 | + * visually complete, and stops listening to further output from | |
| 16 | 17 | * the already running process |
| 17 | 18 | */ |
| 18 | 19 | export const moveTerminalProcessToBackground = createAsyncThunk< |
| @@ -39,6 +40,12 @@ | ||
| 39 | 40 | return; |
| 40 | 41 | } |
| 41 | 42 | |
| 43 | + // Find existing terminal output to preserve it | |
| 44 | + const existingOutput = toolCall.output?.find( | |
| 45 | + (item) => item.name === "Terminal", | |
| 46 | + ); | |
| 47 | + const existingContent = existingOutput?.content || ""; | |
| 48 | + | |
| 42 | 49 | const status = |
| 43 | 50 | "Command moved to background. Further output will be ignored."; |
| 44 | 51 | |
| @@ -46,7 +53,7 @@ | ||
| 46 | 53 | { |
| 47 | 54 | name: "Terminal", |
| 48 | 55 | description: "Terminal command output", |
| 49 | - content: "\n" + status, | |
| 56 | + content: existingContent + (existingContent ? "\n\n" : "") + status, | |
| 50 | 57 | status: status, |
| 51 | 58 | }, |
| 52 | 59 | ]; |