dvcrn / dvcrn/quicktree

Automatically cd into worktree directory after creation

Open
#3 0 comments 1 reaction 1 assignee Assigned to @Copilot View on GitHub
Dominant language
JavaScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Summary
Currently, when creating a new worktree or when an existing worktree is found, quicktree prints a `cd` command that the user needs to manually execute. This should be improved to automatically change the current shell's directory to the worktree.

## Current behavior
- When creating a new worktree: prints `cd /path/to/worktree` (line 218)
- When finding an existing worktree: prints `cd /path/to/worktree` (line 201)

## Proposed behavior
Automatically change the current shell's working directory to the worktree path after creation or when an existing worktree is found.

## Implementation considerations
Since quicktree is a Node.js script running as a subprocess, it cannot directly change the parent shell's directory. Possible solutions:
1. Use a shell function wrapper that sources quicktree output
2. Output shell commands that can be evaluated by the parent shell
3. Integration with shell configuration files

## Test plan
- [ ] Test creating a new worktree - should automatically cd into it
- [ ] Test when an existing worktree is found - should automatically cd into it
- [ ] Test with different shells (bash, zsh, fish)
- [ ] Ensure backward compatibility for users who rely on the current behavior

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.