Chat Fixes
This commit is contained in:
+35
-3
@@ -751,8 +751,8 @@ async function bareOsRunChatTui(ctx, argv0) {
|
||||
EDIT_ANSI_RESET +
|
||||
'\r\n\r\n' +
|
||||
'Send with Enter. Scroll transcript with \u2191/\u2193 or PgUp/PgDn.\r\n' +
|
||||
'Edit input with \u2190/\u2192 Home/End Backspace Delete.\r\n' +
|
||||
'^R refresh proc strip ^L redraw ^Q / ^X / Ctrl+C exit\r\n' +
|
||||
'Input: Backspace/Delete, \u2190/\u2192, Home/End, ^A/^E line start/end, ^U kill to start, ^K kill to end.\r\n' +
|
||||
'^R refresh strip ^L redraw ^Q / ^X / Ctrl+C exit\r\n' +
|
||||
'`chat send TEXT` / `chat who` / `chat history` remain for scripts.\r\n\r\n' +
|
||||
'Press any key.\r\n'
|
||||
bareEditWrite(ctx, stdout, out + '\x1b[?25h')
|
||||
@@ -826,7 +826,7 @@ async function bareOsRunChatTui(ctx, argv0) {
|
||||
const hint2 =
|
||||
bareEditSgr('dim', useColor) +
|
||||
bareChatTruncateVis(
|
||||
'Enter send \u2191\u2193 scroll \u2190\u2192 edit line Home/End',
|
||||
'Enter send \u2191\u2193 transcript Backspace / ^A ^E ^U ^K',
|
||||
cols
|
||||
) +
|
||||
EDIT_ANSI_RESET
|
||||
@@ -911,6 +911,16 @@ async function bareOsRunChatTui(ctx, argv0) {
|
||||
|
||||
if (ev.type === 'ctrl') {
|
||||
if (ev.code === 'interrupt') break
|
||||
/** Backspace — key-parse uses `code: 'backspace'` for bytes 8 and 127 (not numeric). */
|
||||
if (ev.code === 'backspace') {
|
||||
if (inputCursor > 0) {
|
||||
inputBuf =
|
||||
inputBuf.slice(0, inputCursor - 1) + inputBuf.slice(inputCursor)
|
||||
inputCursor--
|
||||
}
|
||||
draw()
|
||||
continue
|
||||
}
|
||||
if (ev.code === 'delete') {
|
||||
if (inputCursor < inputBuf.length) {
|
||||
inputBuf =
|
||||
@@ -931,6 +941,28 @@ async function bareOsRunChatTui(ctx, argv0) {
|
||||
draw()
|
||||
continue
|
||||
}
|
||||
/** Readline-style shortcuts (ASCII control chars). */
|
||||
if (code === 1) {
|
||||
inputCursor = 0
|
||||
draw()
|
||||
continue
|
||||
}
|
||||
if (code === 5) {
|
||||
inputCursor = inputBuf.length
|
||||
draw()
|
||||
continue
|
||||
}
|
||||
if (code === 21) {
|
||||
inputBuf = inputBuf.slice(inputCursor)
|
||||
inputCursor = 0
|
||||
draw()
|
||||
continue
|
||||
}
|
||||
if (code === 11) {
|
||||
inputBuf = inputBuf.slice(0, inputCursor)
|
||||
draw()
|
||||
continue
|
||||
}
|
||||
if (code === 8 || code === 127) {
|
||||
if (inputCursor > 0) {
|
||||
inputBuf =
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"schema": 2,
|
||||
"profileId": "bare-os-posix-like",
|
||||
"generatedAt": "2026-04-22T00:14:10.259Z",
|
||||
"generatedAt": "2026-04-22T01:20:04.173Z",
|
||||
"note": "Sparse POSIX Issue 7 coverage hints for /bin utilities. Omitted command names are not yet profiled here.",
|
||||
"commandIndex": [
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"atMs": 1776816850258,
|
||||
"atMs": 1776820804172,
|
||||
"commands": [
|
||||
"arch",
|
||||
"awk",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -191,8 +191,8 @@ async function bareOsRunChatTui(ctx, argv0) {
|
||||
EDIT_ANSI_RESET +
|
||||
'\r\n\r\n' +
|
||||
'Send with Enter. Scroll transcript with \u2191/\u2193 or PgUp/PgDn.\r\n' +
|
||||
'Edit input with \u2190/\u2192 Home/End Backspace Delete.\r\n' +
|
||||
'^R refresh proc strip ^L redraw ^Q / ^X / Ctrl+C exit\r\n' +
|
||||
'Input: Backspace/Delete, \u2190/\u2192, Home/End, ^A/^E line start/end, ^U kill to start, ^K kill to end.\r\n' +
|
||||
'^R refresh strip ^L redraw ^Q / ^X / Ctrl+C exit\r\n' +
|
||||
'`chat send TEXT` / `chat who` / `chat history` remain for scripts.\r\n\r\n' +
|
||||
'Press any key.\r\n'
|
||||
bareEditWrite(ctx, stdout, out + '\x1b[?25h')
|
||||
@@ -266,7 +266,7 @@ async function bareOsRunChatTui(ctx, argv0) {
|
||||
const hint2 =
|
||||
bareEditSgr('dim', useColor) +
|
||||
bareChatTruncateVis(
|
||||
'Enter send \u2191\u2193 scroll \u2190\u2192 edit line Home/End',
|
||||
'Enter send \u2191\u2193 transcript Backspace / ^A ^E ^U ^K',
|
||||
cols
|
||||
) +
|
||||
EDIT_ANSI_RESET
|
||||
@@ -351,6 +351,16 @@ async function bareOsRunChatTui(ctx, argv0) {
|
||||
|
||||
if (ev.type === 'ctrl') {
|
||||
if (ev.code === 'interrupt') break
|
||||
/** Backspace — key-parse uses `code: 'backspace'` for bytes 8 and 127 (not numeric). */
|
||||
if (ev.code === 'backspace') {
|
||||
if (inputCursor > 0) {
|
||||
inputBuf =
|
||||
inputBuf.slice(0, inputCursor - 1) + inputBuf.slice(inputCursor)
|
||||
inputCursor--
|
||||
}
|
||||
draw()
|
||||
continue
|
||||
}
|
||||
if (ev.code === 'delete') {
|
||||
if (inputCursor < inputBuf.length) {
|
||||
inputBuf =
|
||||
@@ -371,6 +381,28 @@ async function bareOsRunChatTui(ctx, argv0) {
|
||||
draw()
|
||||
continue
|
||||
}
|
||||
/** Readline-style shortcuts (ASCII control chars). */
|
||||
if (code === 1) {
|
||||
inputCursor = 0
|
||||
draw()
|
||||
continue
|
||||
}
|
||||
if (code === 5) {
|
||||
inputCursor = inputBuf.length
|
||||
draw()
|
||||
continue
|
||||
}
|
||||
if (code === 21) {
|
||||
inputBuf = inputBuf.slice(inputCursor)
|
||||
inputCursor = 0
|
||||
draw()
|
||||
continue
|
||||
}
|
||||
if (code === 11) {
|
||||
inputBuf = inputBuf.slice(0, inputCursor)
|
||||
draw()
|
||||
continue
|
||||
}
|
||||
if (code === 8 || code === 127) {
|
||||
if (inputCursor > 0) {
|
||||
inputBuf =
|
||||
|
||||
@@ -751,8 +751,8 @@ async function bareOsRunChatTui(ctx, argv0) {
|
||||
EDIT_ANSI_RESET +
|
||||
'\r\n\r\n' +
|
||||
'Send with Enter. Scroll transcript with \u2191/\u2193 or PgUp/PgDn.\r\n' +
|
||||
'Edit input with \u2190/\u2192 Home/End Backspace Delete.\r\n' +
|
||||
'^R refresh proc strip ^L redraw ^Q / ^X / Ctrl+C exit\r\n' +
|
||||
'Input: Backspace/Delete, \u2190/\u2192, Home/End, ^A/^E line start/end, ^U kill to start, ^K kill to end.\r\n' +
|
||||
'^R refresh strip ^L redraw ^Q / ^X / Ctrl+C exit\r\n' +
|
||||
'`chat send TEXT` / `chat who` / `chat history` remain for scripts.\r\n\r\n' +
|
||||
'Press any key.\r\n'
|
||||
bareEditWrite(ctx, stdout, out + '\x1b[?25h')
|
||||
@@ -826,7 +826,7 @@ async function bareOsRunChatTui(ctx, argv0) {
|
||||
const hint2 =
|
||||
bareEditSgr('dim', useColor) +
|
||||
bareChatTruncateVis(
|
||||
'Enter send \u2191\u2193 scroll \u2190\u2192 edit line Home/End',
|
||||
'Enter send \u2191\u2193 transcript Backspace / ^A ^E ^U ^K',
|
||||
cols
|
||||
) +
|
||||
EDIT_ANSI_RESET
|
||||
@@ -911,6 +911,16 @@ async function bareOsRunChatTui(ctx, argv0) {
|
||||
|
||||
if (ev.type === 'ctrl') {
|
||||
if (ev.code === 'interrupt') break
|
||||
/** Backspace — key-parse uses `code: 'backspace'` for bytes 8 and 127 (not numeric). */
|
||||
if (ev.code === 'backspace') {
|
||||
if (inputCursor > 0) {
|
||||
inputBuf =
|
||||
inputBuf.slice(0, inputCursor - 1) + inputBuf.slice(inputCursor)
|
||||
inputCursor--
|
||||
}
|
||||
draw()
|
||||
continue
|
||||
}
|
||||
if (ev.code === 'delete') {
|
||||
if (inputCursor < inputBuf.length) {
|
||||
inputBuf =
|
||||
@@ -931,6 +941,28 @@ async function bareOsRunChatTui(ctx, argv0) {
|
||||
draw()
|
||||
continue
|
||||
}
|
||||
/** Readline-style shortcuts (ASCII control chars). */
|
||||
if (code === 1) {
|
||||
inputCursor = 0
|
||||
draw()
|
||||
continue
|
||||
}
|
||||
if (code === 5) {
|
||||
inputCursor = inputBuf.length
|
||||
draw()
|
||||
continue
|
||||
}
|
||||
if (code === 21) {
|
||||
inputBuf = inputBuf.slice(inputCursor)
|
||||
inputCursor = 0
|
||||
draw()
|
||||
continue
|
||||
}
|
||||
if (code === 11) {
|
||||
inputBuf = inputBuf.slice(0, inputCursor)
|
||||
draw()
|
||||
continue
|
||||
}
|
||||
if (code === 8 || code === 127) {
|
||||
if (inputCursor > 0) {
|
||||
inputBuf =
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"schema": 2,
|
||||
"profileId": "bare-os-posix-like",
|
||||
"generatedAt": "2026-04-22T00:14:10.259Z",
|
||||
"generatedAt": "2026-04-22T01:20:04.173Z",
|
||||
"note": "Sparse POSIX Issue 7 coverage hints for /bin utilities. Omitted command names are not yet profiled here.",
|
||||
"commandIndex": [
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"atMs": 1776816850258,
|
||||
"atMs": 1776820804172,
|
||||
"commands": [
|
||||
"arch",
|
||||
"awk",
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user