mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
Gracefully handle when user exits command early
This commit is contained in:
@@ -138,6 +138,8 @@ const ChatView = ({ messages, isHidden, vscodeThemeName, showAnnouncement, hideA
|
||||
break
|
||||
case "text":
|
||||
break
|
||||
case "command_output":
|
||||
break
|
||||
case "completion_result":
|
||||
break
|
||||
}
|
||||
@@ -324,7 +326,7 @@ const ChatView = ({ messages, isHidden, vscodeThemeName, showAnnouncement, hideA
|
||||
|
||||
const placeholderText = useMemo(() => {
|
||||
if (messages.at(-1)?.ask === "command_output") {
|
||||
return "Type input for command stdin..."
|
||||
return "Type input to command stdin..."
|
||||
}
|
||||
return task ? "Type a message..." : "Type your task here..."
|
||||
}, [task, messages])
|
||||
|
||||
@@ -35,7 +35,7 @@ export function combineCommandSequences(messages: ClaudeMessage[]): ClaudeMessag
|
||||
// Stop if we encounter the next command
|
||||
break
|
||||
}
|
||||
if (messages[j].type === "ask" && messages[j].ask === "command_output") {
|
||||
if (messages[j].ask === "command_output" || messages[j].say === "command_output") {
|
||||
if (!didAddOutput) {
|
||||
// Add a newline before the first output
|
||||
combinedText += `\n${COMMAND_OUTPUT_STRING}`
|
||||
@@ -57,7 +57,7 @@ export function combineCommandSequences(messages: ClaudeMessage[]): ClaudeMessag
|
||||
|
||||
// Second pass: remove command_outputs and replace original commands with combined ones
|
||||
return messages
|
||||
.filter((msg) => !(msg.type === "ask" && msg.ask === "command_output"))
|
||||
.filter((msg) => !(msg.ask === "command_output" || msg.say === "command_output"))
|
||||
.map((msg) => {
|
||||
if (msg.type === "ask" && msg.ask === "command") {
|
||||
const combinedCommand = combinedCommands.find((cmd) => cmd.ts === msg.ts)
|
||||
|
||||
Reference in New Issue
Block a user