@taj-special/dravix-code 1.4.8 → 1.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +0 -0
- package/dist/cli/repl.js +29 -9
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
File without changes
|
package/dist/cli/repl.js
CHANGED
|
@@ -865,10 +865,17 @@ async function askPermission(label, key, alwaysAllowed, noAlways, diffShown, pre
|
|
|
865
865
|
});
|
|
866
866
|
}
|
|
867
867
|
async function readLine(prompt, cwd) {
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
868
|
+
const rows = process.stdout.rows ?? 24;
|
|
869
|
+
const cols = process.stdout.columns ?? 80;
|
|
870
|
+
const sR = rows - 2;
|
|
871
|
+
const iR = rows - 1;
|
|
872
|
+
let SEP = colors.dim(' ' + '─'.repeat(Math.max(cols - 4, 40)));
|
|
873
|
+
// Ensure scroll region is active for chat history (top rows)
|
|
874
|
+
process.stdout.write(`\x1b[1;${rows - 3}r`);
|
|
875
|
+
// Render fixed bottom container (separator + input bar)
|
|
876
|
+
process.stdout.write(`\x1b[${sR};1H\x1b[2K${SEP}`);
|
|
877
|
+
process.stdout.write(`\x1b[${iR};1H\x1b[2K${prompt}`);
|
|
878
|
+
process.stdout.write(`\x1b[${iR};5H`);
|
|
872
879
|
return new Promise((resolve) => {
|
|
873
880
|
let prefix = '';
|
|
874
881
|
let pasteBlock = null;
|
|
@@ -894,6 +901,8 @@ async function readLine(prompt, cwd) {
|
|
|
894
901
|
let tabPreWord = '';
|
|
895
902
|
function onResize() {
|
|
896
903
|
const newCols = process.stdout.columns ?? 80;
|
|
904
|
+
const newRows = process.stdout.rows ?? 24;
|
|
905
|
+
process.stdout.write(`\x1b[1;${newRows - 3}r`);
|
|
897
906
|
SEP = colors.dim(' ' + '─'.repeat(Math.max(newCols - 4, 40)));
|
|
898
907
|
if (atMode) {
|
|
899
908
|
drawPicker();
|
|
@@ -1262,18 +1271,23 @@ async function readLine(prompt, cwd) {
|
|
|
1262
1271
|
const lns = parts.length > 0 ? parts : (text ? [text] : []);
|
|
1263
1272
|
cleanup();
|
|
1264
1273
|
const rows = process.stdout.rows ?? 24;
|
|
1274
|
+
const cols = process.stdout.columns ?? 80;
|
|
1265
1275
|
const sR = rows - 2;
|
|
1266
1276
|
const iR = rows - 1;
|
|
1267
|
-
|
|
1277
|
+
const scrBottom = rows - 3;
|
|
1278
|
+
// Clear fixed bottom input line
|
|
1268
1279
|
process.stdout.write(`\x1b[${iR};1H\x1b[2K`);
|
|
1269
|
-
process.stdout.write(`\x1b[${sR};1H`);
|
|
1270
1280
|
if (!text) {
|
|
1281
|
+
process.stdout.write(`\x1b[${sR};1H\x1b[2K${SEP}`);
|
|
1282
|
+
process.stdout.write(`\x1b[${iR};1H\x1b[2K${prompt}`);
|
|
1283
|
+
process.stdout.write(`\x1b[${iR};5H`);
|
|
1271
1284
|
resolve(null);
|
|
1272
1285
|
return;
|
|
1273
1286
|
}
|
|
1274
|
-
const cols = process.stdout.columns ?? 80;
|
|
1275
1287
|
const msgBg = chalk.bgHex('#334155').hex('#f1f5f9');
|
|
1276
1288
|
const fillMsg = (raw) => (' > ' + raw + ' ').padEnd(cols);
|
|
1289
|
+
// Move to bottom of scroll region to append user message into chat
|
|
1290
|
+
process.stdout.write(`\x1b[${scrBottom};1H\n`);
|
|
1277
1291
|
if (pasteBlock !== null) {
|
|
1278
1292
|
const disp = [
|
|
1279
1293
|
prefix ? prefix : '',
|
|
@@ -1285,6 +1299,7 @@ async function readLine(prompt, cwd) {
|
|
|
1285
1299
|
else {
|
|
1286
1300
|
process.stdout.write(msgBg(fillMsg(text)) + '\n');
|
|
1287
1301
|
}
|
|
1302
|
+
process.stdout.write(`\x1b[${scrBottom};1H`);
|
|
1288
1303
|
resolve({ text, lines: lns });
|
|
1289
1304
|
}
|
|
1290
1305
|
function onData(data) {
|
|
@@ -1344,9 +1359,14 @@ async function readLine(prompt, cwd) {
|
|
|
1344
1359
|
closeSlashPicker();
|
|
1345
1360
|
if (tabMode)
|
|
1346
1361
|
closeTabPicker();
|
|
1362
|
+
const curRows = process.stdout.rows ?? 24;
|
|
1363
|
+
const curSR = curRows - 2;
|
|
1364
|
+
const curIR = curRows - 1;
|
|
1347
1365
|
console.clear();
|
|
1348
|
-
process.stdout.write(
|
|
1349
|
-
process.stdout.write(
|
|
1366
|
+
process.stdout.write(`\x1b[1;${curRows - 3}r`);
|
|
1367
|
+
process.stdout.write(`\x1b[${curSR};1H\x1b[2K${SEP}`);
|
|
1368
|
+
process.stdout.write(`\x1b[${curIR};1H\x1b[2K${prompt}`);
|
|
1369
|
+
process.stdout.write(`\x1b[${curIR};5H`);
|
|
1350
1370
|
return;
|
|
1351
1371
|
}
|
|
1352
1372
|
// ── @ picker mode ─────────────────────────────────────────
|