blun-king-cli 7.2.1 → 7.2.2
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/lib/chat.js +9 -3
- package/package.json +1 -1
package/lib/chat.js
CHANGED
|
@@ -40,7 +40,7 @@ var SLASH_COMMANDS = [
|
|
|
40
40
|
var slashNames = SLASH_COMMANDS.map(function (c) { return c[0]; });
|
|
41
41
|
|
|
42
42
|
// ── Layout Constants ─────────────────────────────────────
|
|
43
|
-
var INPUT_PANEL_HEIGHT =
|
|
43
|
+
var INPUT_PANEL_HEIGHT = 7; // 2 gap + top-frame + input + blank + status + bottom-frame
|
|
44
44
|
|
|
45
45
|
function getRows() { return process.stdout.rows || 24; }
|
|
46
46
|
function getCols() { return process.stdout.columns || 80; }
|
|
@@ -102,7 +102,7 @@ function startChat() {
|
|
|
102
102
|
var rows = getRows();
|
|
103
103
|
var cols = getCols();
|
|
104
104
|
var t = ui.getTheme();
|
|
105
|
-
var panelTop = rows - INPUT_PANEL_HEIGHT +
|
|
105
|
+
var panelTop = rows - INPUT_PANEL_HEIGHT + 3; // +3 to leave 2 empty rows at top of panel area
|
|
106
106
|
var inner = cols - 2;
|
|
107
107
|
|
|
108
108
|
// Permission label
|
|
@@ -184,6 +184,8 @@ function startChat() {
|
|
|
184
184
|
// ── Process command ──────────────────────────────────
|
|
185
185
|
function processCommand(input) {
|
|
186
186
|
if (!input) return;
|
|
187
|
+
// Case-insensitive commands
|
|
188
|
+
if (input.startsWith("/")) input = input.toLowerCase();
|
|
187
189
|
|
|
188
190
|
// ── Commands ───────────────────────────────────
|
|
189
191
|
if (input === "/exit" || input === "/quit") {
|
|
@@ -455,8 +457,12 @@ function startChat() {
|
|
|
455
457
|
// Reset scroll region for inquirer to work properly
|
|
456
458
|
var rows = getRows();
|
|
457
459
|
process.stdout.write(setScrollRegion(1, rows));
|
|
458
|
-
process.
|
|
460
|
+
process.stdout.write(cursorTo(rows - INPUT_PANEL_HEIGHT, 1));
|
|
461
|
+
process.stdout.write(showCursor());
|
|
462
|
+
try { process.stdin.setRawMode(false); } catch (e) {}
|
|
459
463
|
process.stdin.removeAllListeners("data");
|
|
464
|
+
process.stdin.pause();
|
|
465
|
+
process.stdin.resume();
|
|
460
466
|
|
|
461
467
|
fn(function () {
|
|
462
468
|
// Re-enter TUI mode
|