mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 03:10:46 +08:00
Audit WebCRT commands from device stdout after tab completion.
ZTE tab redraws the input line via carriage return; parse the last prompt line from PTY stdout on Enter instead of stdin keystrokes. Also remove remaining ?? in AuditPage. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
a9c7e81793
commit
6ea14e6d5e
5 changed files with 110 additions and 13 deletions
|
|
@ -97,6 +97,12 @@ export function normalizeAuditLine(line: string): string {
|
|||
|
||||
function currentCommandLine(term: Terminal): string {
|
||||
const buf = term.buffer.active;
|
||||
for (let y = buf.cursorY; y >= Math.max(0, buf.cursorY - 3); y -= 1) {
|
||||
const line = buf.getLine(y);
|
||||
if (!line) continue;
|
||||
const text = normalizeAuditLine(line.translateToString(true));
|
||||
if (/[#>\]]\s*\S/.test(text) || /#[^\s]/.test(text)) return text;
|
||||
}
|
||||
const line = buf.getLine(buf.cursorY);
|
||||
if (!line) return "";
|
||||
return normalizeAuditLine(line.translateToString(true));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue