Skip to content

Conversation

@dcadenas
Copy link
Contributor

@dcadenas dcadenas commented Oct 30, 2025

Summary

Create directories directly from the picker by typing a name and pressing Enter (or Ctrl+Enter if matches exist). Supports git init and cloning from GitHub/GitLab URLs.

Changes

  • Show dynamic hint for creation options
  • Convention-based hook at ~/.config/tms/create-hook
  • Hook can return custom directory name via stdout
  • Default hook: creates directory with git init
  • Enhanced hook: detects and clones GitHub/GitLab URLs
  • Ctrl+Enter to force creation when matches exist
  • Auto-creates hook on first use

Hook Features

Git URL detection:

  • Type https://github.com/user/repo → clones repo → opens session "repo"
  • Type https://gitlab.com/user/project → clones → opens "project"

Customizable output:

  • Hook returns directory name via stdout (optional)
  • Falls back to typed name if no output
  • Enables URL → repo name transformation

Force creation:

  • No matches: Enter creates
  • Matches exist: Ctrl+Enter creates, Enter selects match
  • Compact hints: [^↵: create foo, ↵: open foobar]

Testing

All tests pass. Tested with git init, GitHub/GitLab clones, and force creation.

@dcadenas
Copy link
Contributor Author

This relates to #114

@dcadenas dcadenas force-pushed the feat/picker-directory-creation branch 6 times, most recently from 3793207 to f0d037f Compare November 6, 2025 15:27
Create directories directly from the picker. Hook template embedded in binary,
written to ~/.config/tms/create-hook on first use.

Features:
* Dynamic hints: [^↵: create foo, ↵: open bar]
* Ctrl+Enter to force creation when matches exist
* GitHub/GitLab URL cloning with progress messages
* Hook stdout for custom directory names
* Auto-creates hook template on first use
@dcadenas dcadenas force-pushed the feat/picker-directory-creation branch from f0d037f to ba8553e Compare November 6, 2025 15:36
- Add SSH URL parsing (git@host:user/repo.git) to clone-repo command
- Fix missing #, escape in tmux format string for LastAttached sorting
- Add SSH URL pattern to default create-hook template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant