From 6b4ddbb969baceb86b51d6154ec1f041e609aabf Mon Sep 17 00:00:00 2001 From: Chapman Pendery Date: Thu, 26 Oct 2023 22:46:05 -0700 Subject: [PATCH] fix: where starting input goes between command executions in session duration Signed-off-by: Chapman Pendery --- src/commands/root.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/commands/root.ts b/src/commands/root.ts index ebe6a93..0c74385 100644 --- a/src/commands/root.ts +++ b/src/commands/root.ts @@ -30,8 +30,9 @@ export const action = async (options: RootCommandOptions) => { let executed = false; const commands = []; let result: ExecuteShellCommandTTYResult = { code: 0 }; + let startingCommand = options.command; while (options.duration === "session" || !executed) { - const commandToExecute = await render(options.command); + const commandToExecute = await render(startingCommand); if (commandToExecute == null) { result = { code: 0 }; @@ -41,6 +42,7 @@ export const action = async (options: RootCommandOptions) => { commands.push(commandToExecute); result = await executeShellCommandTTY(shell, commandToExecute); executed = true; + startingCommand = undefined; } await saveCommand(commands);