| 524 | } |
| 525 | |
| 526 | bool trySyncLiveInputFromRemoteLine(const String &line, bool renderUpdatedPrompt) { |
| 527 | String liveInput = getTerminalLiveInput(); |
| 528 | if (liveInput.isEmpty()) return false; |
| 529 | |
| 530 | String promptPrefix = getCurrentPromptPrefix(); |
| 531 | String payload = line; |
| 532 | if (!promptPrefix.isEmpty() && line.startsWith(promptPrefix)) { |
| 533 | payload = line.substring(promptPrefix.length()); |
| 534 | } else if (!line.startsWith(liveInput)) return false; |
| 535 | |
| 536 | payload.trim(); |
| 537 | if (payload.isEmpty() || !payload.startsWith(liveInput)) return false; |
| 538 | |
| 539 | bool awaiting = false; |
| 540 | withClientLock([&]() { awaiting = awaitingTabDebugResponse; }); |
| 541 | if (awaiting && payload == liveInput) return true; |
| 542 | |
| 543 | syncCommandBufferFromRemote(payload); |
| 544 | withClientLock([&]() { awaitingTabDebugResponse = false; }); |
| 545 | if (renderUpdatedPrompt) redrawCurrentCommandLine(); |
| 546 | return true; |
| 547 | } |
| 548 | |
| 549 | bool isLikelyCompletionSuffix(const String &text) { |
| 550 | if (text.isEmpty()) return false; |
no test coverage detected