fleetbo-cockpit-cli 1.0.130 → 1.0.131
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/cli.js +19 -9
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -641,9 +641,22 @@ if (command === 'alex') {
|
|
|
641
641
|
|
|
642
642
|
let inputBuffer = "";
|
|
643
643
|
let isProcessing = false;
|
|
644
|
+
let hintTimer = null;
|
|
644
645
|
let submitTimer = null;
|
|
645
646
|
|
|
647
|
+
const showHint = () => {
|
|
648
|
+
if (hintTimer) clearTimeout(hintTimer);
|
|
649
|
+
hintTimer = setTimeout(() => {
|
|
650
|
+
hintTimer = null;
|
|
651
|
+
if (inputBuffer.trim() !== "" && !isProcessing) {
|
|
652
|
+
rl.setPrompt("\x1b[90m ↵ again to send\x1b[0m");
|
|
653
|
+
rl.prompt();
|
|
654
|
+
}
|
|
655
|
+
}, 400);
|
|
656
|
+
};
|
|
657
|
+
|
|
646
658
|
const doSubmit = async () => {
|
|
659
|
+
if (hintTimer) { clearTimeout(hintTimer); hintTimer = null; }
|
|
647
660
|
if (submitTimer) { clearTimeout(submitTimer); submitTimer = null; }
|
|
648
661
|
if (isProcessing || inputBuffer.trim() === "") return;
|
|
649
662
|
|
|
@@ -679,19 +692,16 @@ if (command === 'alex') {
|
|
|
679
692
|
}
|
|
680
693
|
|
|
681
694
|
if (trimmedLine !== "") {
|
|
682
|
-
// Ligne non-vide : annule
|
|
683
|
-
// était en attente (cas paste avec ligne vide interne)
|
|
695
|
+
// Ligne non-vide : annule submit en attente (paste avec ligne vide interne)
|
|
684
696
|
if (submitTimer) { clearTimeout(submitTimer); submitTimer = null; }
|
|
685
697
|
inputBuffer += (inputBuffer ? "\n" : "") + line;
|
|
686
|
-
//
|
|
687
|
-
|
|
688
|
-
rl.prompt();
|
|
698
|
+
// Hint affiché 400ms après la dernière ligne — jamais pendant un paste
|
|
699
|
+
showHint();
|
|
689
700
|
} else {
|
|
690
701
|
if (inputBuffer.trim() !== "") {
|
|
691
|
-
// Ligne vide
|
|
692
|
-
// Si une ligne non-vide arrive
|
|
693
|
-
|
|
694
|
-
// Si rien n'arrive → vraie Entrée manuelle → soumet
|
|
702
|
+
// Ligne vide : annule le hint, attend 400ms pour soumettre
|
|
703
|
+
// Si une ligne non-vide arrive → submitTimer annulé (paste continue)
|
|
704
|
+
if (hintTimer) { clearTimeout(hintTimer); hintTimer = null; }
|
|
695
705
|
if (submitTimer) clearTimeout(submitTimer);
|
|
696
706
|
submitTimer = setTimeout(() => doSubmit(), 400);
|
|
697
707
|
} else {
|