aboutsummaryrefslogtreecommitdiffstats
path: root/ui/src/components
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@atuin.sh>2024-07-25 16:08:53 +0100
committerGitHub <noreply@github.com>2024-07-25 16:08:53 +0100
commitc408465549d23b2097867baff2ea038e991eea40 (patch)
treea0c2cf95e022fb13f2ea7d38a74cbb29459fe3b9 /ui/src/components
parentfix(gui): do not hardcode db path (#2309) (diff)
downloadatuin-c408465549d23b2097867baff2ea038e991eea40.zip
fix(gui): double return on mac/linux (#2311)
Diffstat (limited to 'ui/src/components')
-rw-r--r--ui/src/components/runbooks/editor/blocks/RunBlock/index.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/src/components/runbooks/editor/blocks/RunBlock/index.tsx b/ui/src/components/runbooks/editor/blocks/RunBlock/index.tsx
index b3a96166..25faa211 100644
--- a/ui/src/components/runbooks/editor/blocks/RunBlock/index.tsx
+++ b/ui/src/components/runbooks/editor/blocks/RunBlock/index.tsx
@@ -10,6 +10,7 @@ import { Play, Square } from "lucide-react";
import { useState } from "react";
import { extensions } from "./extensions";
+import { platform } from "@tauri-apps/plugin-os";
import { invoke } from "@tauri-apps/api/core";
import Terminal from "./terminal.tsx";
@@ -72,7 +73,10 @@ const RunBlock = ({
if (currentRunbook) incRunbookPty(currentRunbook);
- let val = !value.endsWith("\n") ? value + "\r\n" : value;
+ let isWindows = platform() == "windows";
+ let cmdEnd = isWindows ? "\r\n" : "\n";
+
+ let val = !value.endsWith("\n") ? value + cmdEnd : value;
await invoke("pty_write", { pid: pty, data: val });
}
};