diff --git a/frontend/src/ts/commandline/commandline.ts b/frontend/src/ts/commandline/commandline.ts index acceb130b..f5305a594 100644 --- a/frontend/src/ts/commandline/commandline.ts +++ b/frontend/src/ts/commandline/commandline.ts @@ -430,7 +430,11 @@ async function showCommands(): Promise { await updateActiveCommand(); }); command.addEventListener("click", async () => { + const previous = activeIndex; activeIndex = parseInt(command.getAttribute("data-index") ?? "0"); + if (previous !== activeIndex) { + await updateActiveCommand(); + } await runActiveCommand(); }); }