From 7cf3573b4fa6cf1f3503d96b0294e360f7d68777 Mon Sep 17 00:00:00 2001 From: Pranav Peshwe Date: Sat, 17 Jun 2023 16:56:56 +0530 Subject: [PATCH] Adding support for printing command to stdout without saving to a file. --- up.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/up.go b/up.go index e83cceb..3d71ade 100644 --- a/up.go +++ b/up.go @@ -290,6 +290,12 @@ func main() { tui.Fini() writeScript(shell, commandEditor.String(), tui) return + case key(tcell.KeyCtrlO), + ctrlKey(tcell.KeyCtrlO): + // Write only to stdout (i.e don't persist to file) + tui.Fini() + os.Stdout.WriteString(commandEditor.String()) + return } } }