@oxecli/oxe 1.0.30 → 1.0.31
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/ui.js +4 -2
- package/package.json +1 -1
package/dist/ui.js
CHANGED
|
@@ -715,8 +715,10 @@ export function askBottomPrompt(label = "You", prefix = "❯", history = []) {
|
|
|
715
715
|
process.stdin.setEncoding("utf-8");
|
|
716
716
|
process.stdin.on("data", (d) => chunks.push(Buffer.from(String(d))));
|
|
717
717
|
process.stdin.on("end", () => {
|
|
718
|
-
const text = Buffer.concat(chunks).toString();
|
|
719
|
-
|
|
718
|
+
const text = Buffer.concat(chunks).toString().replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
719
|
+
// Piped input commonly ends with the transport newline from the
|
|
720
|
+
// shell. Preserve every newline the user supplied before it.
|
|
721
|
+
resolve([text.endsWith("\n") ? text.slice(0, -1) : text, []]);
|
|
720
722
|
});
|
|
721
723
|
return;
|
|
722
724
|
}
|