groundcrew-cli 0.16.2 → 0.16.3

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.
Files changed (3) hide show
  1. package/dist/index.js +11 -18
  2. package/package.json +1 -1
  3. package/src/index.ts +18 -20
package/dist/index.js CHANGED
@@ -521,13 +521,17 @@ function readMultilineInput(sessionId, projectName, gitCtx) {
521
521
  };
522
522
  const submit = () => {
523
523
  const text = fullText();
524
- const lastRow = lines.length - 1;
525
- const rowsDown = lastRow - crow;
526
524
  const buf = [];
527
- if (rowsDown > 0) buf.push(`\x1B[${rowsDown}B`);
528
- buf.push("\r");
529
- const endCol = padWidth + lines[lastRow].length;
530
- if (endCol > 0) buf.push(`\x1B[${endCol}C`);
525
+ if (lastTermRow > 0) buf.push(`\x1B[${lastTermRow}A`);
526
+ buf.push("\r\x1B[J");
527
+ for (let i = 0; i < lines.length; i++) {
528
+ if (i > 0) buf.push("\n");
529
+ if (i === 0) {
530
+ buf.push(dim(`[${sessionId}]`) + " " + bold(">") + " " + lines[i]);
531
+ } else {
532
+ buf.push(" ".repeat(padWidth) + lines[i]);
533
+ }
534
+ }
531
535
  buf.push("\n");
532
536
  process.stdout.write(buf.join(""));
533
537
  lastTermRow = 0;
@@ -676,15 +680,10 @@ function readMultilineInput(sessionId, projectName, gitCtx) {
676
680
  switch (codepoint) {
677
681
  case 99:
678
682
  if (fullText() || lines.length > 1 || lines[0].length > 0) {
679
- const lastRow = lines.length - 1;
680
- const rowsDown = lastRow - crow;
681
- if (rowsDown > 0) process.stdout.write(`\x1B[${rowsDown}B`);
682
- process.stdout.write("\r\n");
683
683
  lines.length = 0;
684
684
  lines.push("");
685
685
  crow = 0;
686
686
  ccol = 0;
687
- lastTermRow = 0;
688
687
  render();
689
688
  } else {
690
689
  process.stdout.write("\r\n");
@@ -760,17 +759,11 @@ function readMultilineInput(sessionId, projectName, gitCtx) {
760
759
  continue;
761
760
  }
762
761
  if (str[i] === "") {
763
- const hasText = fullText();
764
- if (hasText || lines.length > 1 || lines[0].length > 0) {
765
- const lastRow = lines.length - 1;
766
- const rowsDown = lastRow - crow;
767
- if (rowsDown > 0) process.stdout.write(`\x1B[${rowsDown}B`);
768
- process.stdout.write("\r\n");
762
+ if (fullText() || lines.length > 1 || lines[0].length > 0) {
769
763
  lines.length = 0;
770
764
  lines.push("");
771
765
  crow = 0;
772
766
  ccol = 0;
773
- lastTermRow = 0;
774
767
  render();
775
768
  } else {
776
769
  process.stdout.write("\r\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "groundcrew-cli",
3
- "version": "0.16.2",
3
+ "version": "0.16.3",
4
4
  "description": "CLI companion for Groundcrew — queue tasks, send feedback, monitor your Copilot agent from another terminal.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/index.ts CHANGED
@@ -688,14 +688,20 @@ function readMultilineInput(sessionId: string, projectName: string, gitCtx: { br
688
688
 
689
689
  const submit = () => {
690
690
  const text = fullText();
691
- // Move cursor to end of input for clean output
692
- const lastRow = lines.length - 1;
693
- const rowsDown = lastRow - crow;
691
+ // Erase the separator + input area, then re-draw only the prompt (no separator in history)
694
692
  const buf: string[] = [];
695
- if (rowsDown > 0) buf.push(`\x1b[${rowsDown}B`);
696
- buf.push("\r");
697
- const endCol = padWidth + lines[lastRow].length;
698
- if (endCol > 0) buf.push(`\x1b[${endCol}C`);
693
+ if (lastTermRow > 0) buf.push(`\x1b[${lastTermRow}A`);
694
+ buf.push("\r\x1b[J"); // clear from separator line down
695
+
696
+ // Re-draw only the input lines (no separator)
697
+ for (let i = 0; i < lines.length; i++) {
698
+ if (i > 0) buf.push("\n");
699
+ if (i === 0) {
700
+ buf.push(dim(`[${sessionId}]`) + " " + bold(">") + " " + lines[i]);
701
+ } else {
702
+ buf.push(" ".repeat(padWidth) + lines[i]);
703
+ }
704
+ }
699
705
  buf.push("\n");
700
706
  process.stdout.write(buf.join(""));
701
707
  lastTermRow = 0;
@@ -830,12 +836,9 @@ function readMultilineInput(sessionId: string, projectName: string, gitCtx: { br
830
836
  switch (codepoint) {
831
837
  case 99: // Ctrl+C
832
838
  if (fullText() || lines.length > 1 || lines[0].length > 0) {
833
- const lastRow = lines.length - 1;
834
- const rowsDown = lastRow - crow;
835
- if (rowsDown > 0) process.stdout.write(`\x1b[${rowsDown}B`);
836
- process.stdout.write("\r\n");
839
+ // Clear input in-place (no scrollback residue)
837
840
  lines.length = 0; lines.push("");
838
- crow = 0; ccol = 0; lastTermRow = 0;
841
+ crow = 0; ccol = 0;
839
842
  render();
840
843
  } else {
841
844
  process.stdout.write("\r\n");
@@ -883,15 +886,10 @@ function readMultilineInput(sessionId: string, projectName: string, gitCtx: { br
883
886
 
884
887
  // Ctrl+C — clear input or exit
885
888
  if (str[i] === "\x03") {
886
- const hasText = fullText();
887
- if (hasText || lines.length > 1 || lines[0].length > 0) {
888
- // Move past current rendering to below last line, start fresh
889
- const lastRow = lines.length - 1;
890
- const rowsDown = lastRow - crow;
891
- if (rowsDown > 0) process.stdout.write(`\x1b[${rowsDown}B`);
892
- process.stdout.write("\r\n");
889
+ if (fullText() || lines.length > 1 || lines[0].length > 0) {
890
+ // Clear input in-place (no scrollback residue)
893
891
  lines.length = 0; lines.push("");
894
- crow = 0; ccol = 0; lastTermRow = 0;
892
+ crow = 0; ccol = 0;
895
893
  render();
896
894
  } else {
897
895
  process.stdout.write("\r\n");