fix: where starting input goes between command executions in session duration

Signed-off-by: Chapman Pendery <cpendery@vt.edu>
This commit is contained in:
Chapman Pendery
2023-10-26 22:47:42 -07:00
parent 5aa8fec4f9
commit 6b4ddbb969
+3 -1
View File
@@ -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);