worktree-launcher 1.5.5 → 1.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +17 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -844,11 +844,17 @@ function showAIToolSelector(branchName) {
844
844
  content: "[Esc] cancel",
845
845
  style: { fg: "cyan" }
846
846
  });
847
- form.focus();
848
847
  screen.render();
848
+ const cleanup = () => {
849
+ screen.unkey(["1"], onKey1);
850
+ screen.unkey(["2"], onKey2);
851
+ screen.unkey(["3"], onKey3);
852
+ screen.unkey(["escape"], onEscape);
853
+ };
849
854
  const selectTool = async (tool) => {
850
855
  if (handled) return;
851
856
  handled = true;
857
+ cleanup();
852
858
  form.destroy();
853
859
  screen.render();
854
860
  try {
@@ -862,14 +868,19 @@ function showAIToolSelector(branchName) {
862
868
  const cancel = () => {
863
869
  if (handled) return;
864
870
  handled = true;
871
+ cleanup();
865
872
  form.destroy();
866
873
  screen.render();
867
874
  worktreeList.focus();
868
875
  };
869
- form.key(["1"], () => selectTool("claude"));
870
- form.key(["2"], () => selectTool("codex"));
871
- form.key(["3"], () => selectTool(null));
872
- form.key(["escape"], cancel);
876
+ const onKey1 = () => selectTool("claude");
877
+ const onKey2 = () => selectTool("codex");
878
+ const onKey3 = () => selectTool(null);
879
+ const onEscape = () => cancel();
880
+ screen.key(["1"], onKey1);
881
+ screen.key(["2"], onKey2);
882
+ screen.key(["3"], onKey3);
883
+ screen.key(["escape"], onEscape);
873
884
  }
874
885
  async function createNewWorktree(branchName, tool) {
875
886
  setStatus(`Creating ${branchName}...`);
@@ -982,7 +993,7 @@ async function deleteSelected() {
982
993
 
983
994
  // src/index.ts
984
995
  var program = new Command();
985
- program.name("wt").description("CLI tool to streamline git worktrees with AI coding assistants").version("1.5.5").action(async () => {
996
+ program.name("wt").description("CLI tool to streamline git worktrees with AI coding assistants").version("1.5.6").action(async () => {
986
997
  await interactiveCommand();
987
998
  });
988
999
  program.command("new <branch-name>").description("Create a new worktree and launch AI assistant").option("-i, --install", "Run package manager install after creating worktree").option("-s, --skip-launch", "Create worktree without launching AI assistant").option("-p, --push", "Push branch to remote (visible on GitHub)").action(async (branchName, options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "worktree-launcher",
3
- "version": "1.5.5",
3
+ "version": "1.5.6",
4
4
  "description": "CLI tool for managing git worktrees with AI coding assistants",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",