This commit is contained in:
Raven Scott
2026-04-21 20:17:19 -04:00
parent 17af3ac65f
commit ecd01cea50
25 changed files with 2913 additions and 269 deletions
+18
View File
@@ -186,6 +186,24 @@ function bareEditCup(row1, col1) {
return '\x1b[' + r + ';' + c + 'H'
}
/**
* @param {Record<string, unknown>} ctx
* @param {import('stream').Writable} stdout
* @param {string} s
*/
function bareEditWrite(ctx, stdout, s) {
if (!stdout || typeof stdout.write !== 'function') return
try {
stdout.write(s)
} catch {
try {
ctx.console?.error?.('edit: stdout write failed')
} catch {
/* ignore */
}
}
}
/** TTY key parsing for /bin/edit: consume one logical key from a mutable byte queue. */
/**
+18
View File
@@ -186,6 +186,24 @@ function bareEditCup(row1, col1) {
return '\x1b[' + r + ';' + c + 'H'
}
/**
* @param {Record<string, unknown>} ctx
* @param {import('stream').Writable} stdout
* @param {string} s
*/
function bareEditWrite(ctx, stdout, s) {
if (!stdout || typeof stdout.write !== 'function') return
try {
stdout.write(s)
} catch {
try {
ctx.console?.error?.('edit: stdout write failed')
} catch {
/* ignore */
}
}
}
/** TTY key parsing for /bin/edit: consume one logical key from a mutable byte queue. */
/**
+1022 -19
View File
File diff suppressed because it is too large Load Diff
+20 -18
View File
@@ -186,6 +186,24 @@ function bareEditCup(row1, col1) {
return '\x1b[' + r + ';' + c + 'H'
}
/**
* @param {Record<string, unknown>} ctx
* @param {import('stream').Writable} stdout
* @param {string} s
*/
function bareEditWrite(ctx, stdout, s) {
if (!stdout || typeof stdout.write !== 'function') return
try {
stdout.write(s)
} catch {
try {
ctx.console?.error?.('edit: stdout write failed')
} catch {
/* ignore */
}
}
}
/** Syntax highlighting for /bin/edit (line-oriented, best-effort). */
const EDIT_KW_JS =
@@ -981,7 +999,7 @@ function bareEditTryConsumeKey(q) {
return { type: 'key', ch: bareEditUtf8DecodeKey(chunk) }
}
/** Full-screen TUI for /bin/edit (raw TTY, fish suspend/resume). */
/** Stdin chunk queue + async key reader for edit/chat TUIs (requires edit-key-parse.js first). */
/**
* @param {unknown} chunk
@@ -1094,23 +1112,7 @@ function bareEditCreateStdinReader(stdin) {
}
}
/**
* @param {Record<string, unknown>} ctx
* @param {import('stream').Writable} stdout
* @param {string} s
*/
function bareEditWrite(ctx, stdout, s) {
if (!stdout || typeof stdout.write !== 'function') return
try {
stdout.write(s)
} catch {
try {
ctx.console?.error?.('edit: stdout write failed')
} catch {
/* ignore */
}
}
}
/** Full-screen TUI for /bin/edit (stdin/key helpers in edit-stream-read.js; bareEditWrite in edit-ansi.js). */
/**
* @param {Record<string, unknown>} ctx
+20 -18
View File
@@ -186,6 +186,24 @@ function bareEditCup(row1, col1) {
return '\x1b[' + r + ';' + c + 'H'
}
/**
* @param {Record<string, unknown>} ctx
* @param {import('stream').Writable} stdout
* @param {string} s
*/
function bareEditWrite(ctx, stdout, s) {
if (!stdout || typeof stdout.write !== 'function') return
try {
stdout.write(s)
} catch {
try {
ctx.console?.error?.('edit: stdout write failed')
} catch {
/* ignore */
}
}
}
/** Syntax highlighting for /bin/edit (line-oriented, best-effort). */
const EDIT_KW_JS =
@@ -981,7 +999,7 @@ function bareEditTryConsumeKey(q) {
return { type: 'key', ch: bareEditUtf8DecodeKey(chunk) }
}
/** Full-screen TUI for /bin/edit (raw TTY, fish suspend/resume). */
/** Stdin chunk queue + async key reader for edit/chat TUIs (requires edit-key-parse.js first). */
/**
* @param {unknown} chunk
@@ -1094,23 +1112,7 @@ function bareEditCreateStdinReader(stdin) {
}
}
/**
* @param {Record<string, unknown>} ctx
* @param {import('stream').Writable} stdout
* @param {string} s
*/
function bareEditWrite(ctx, stdout, s) {
if (!stdout || typeof stdout.write !== 'function') return
try {
stdout.write(s)
} catch {
try {
ctx.console?.error?.('edit: stdout write failed')
} catch {
/* ignore */
}
}
}
/** Full-screen TUI for /bin/edit (stdin/key helpers in edit-stream-read.js; bareEditWrite in edit-ansi.js). */
/**
* @param {Record<string, unknown>} ctx