Skip to content

feat(cable): add pj channel for project directory finding#902

Open
josephschmitt wants to merge 2 commits into
alexpasmantier:mainfrom
josephschmitt:feat/add-pj-cable-channel
Open

feat(cable): add pj channel for project directory finding#902
josephschmitt wants to merge 2 commits into
alexpasmantier:mainfrom
josephschmitt:feat/add-pj-cable-channel

Conversation

@josephschmitt
Copy link
Copy Markdown
Contributor

@josephschmitt josephschmitt commented Feb 8, 2026

📺 PR Description

Adds a new cable channel for pj, a fast project directory finder that searches your filesystem for project directories.
image

Works with monorepos by deeply looking for nested projects, too:
image

  • Two source modes: default and --no-nested
  • Preview using ls
  • Actions: expand path, open in $EDITOR, connect to tmux session, open new tmux tab, clear cache
  • Keybindings for all actions

Two of the actions require tmux to work. Given they’re optional and not the primary (nor even secondary) actions, I figured it was ok to not list tmux as a requirement. Let me know if you disagree.

Checklist

  • my commits and PR title follow the conventional commits format
  • if this is a new feature, I have added tests to consolidate the feature and prevent regressions
  • if this is a bug fix, I have added a test that reproduces the bug (if applicable)
  • I have added a reasonable amount of documentation to the code where appropriate

@josephschmitt josephschmitt force-pushed the feat/add-pj-cable-channel branch 6 times, most recently from ac079a3 to b44c820 Compare February 8, 2026 15:12
@josephschmitt
Copy link
Copy Markdown
Contributor Author

I wanted to use the native {regex_replace} for the tilde expansion, but it doesn’t seem to be working, so I used sed instead. Opened an issue regarding regex_replace here: #900

@josephschmitt
Copy link
Copy Markdown
Contributor Author

I wanted to use the native {regex_replace} for the tilde expansion, but it doesn’t seem to be working, so I used sed instead. Opened an issue regarding regex_replace here: #900

Turns out the docs were just outdated. However it also turns out that the replace syntax can't read the $HOME env var, so sed remains the best path forward here.

@alexpasmantier
Copy link
Copy Markdown
Owner

Cool!

A better solution in my opinion might be to make pj output resolved absolute paths by default (or behind a flag).

@josephschmitt
Copy link
Copy Markdown
Contributor Author

josephschmitt commented Feb 8, 2026

Cool!

A better solution in my opinion might be to make pj output resolved absolute paths by default (or behind a flag).

@alexpasmantier so it does by default, the --shorten flag is what returns ~ instead of absolute paths.

What I was struggling to get working (which you can see via some of the issues I opened) is to get display to show colored ansi icons AND the shortened home directory but then output to display the fully resolved path.

At first I tried using plain pj --icons --ansi which would just give me the absolute paths. But when I used the display template syntax to then replace $HOME with ~, the ANSI coloring on the icons broke.

So what I ended up with instead was to have command use the results from pj --icons --ansi --shorten and then replace them in output since that does seem to work well with ANSI coloring.

I’m open to suggestions, I really would much rather do it how you said. But displaying tilde for the home directory instead of the full path is such a nicer UX and cleans up the list so much that this felt worth it

@josephschmitt
Copy link
Copy Markdown
Contributor Author

@alexpasmantier Lmk if you have any other feedback or concerns, happy to address

@alexpasmantier
Copy link
Copy Markdown
Owner

Sorry for the delay, would you mind adding a small screenshot of the channel for the documentation? 😊

@alexpasmantier alexpasmantier force-pushed the main branch 2 times, most recently from 717b552 to d802a21 Compare February 12, 2026 22:01
@josephschmitt
Copy link
Copy Markdown
Contributor Author

@alexpasmantier I have a couple of screenshots in the PR. Should they go somewhere in the code itself? Is there an assets folder? Or maybe a command I can run to generate the docs for this? happy to add!

Add a new cable channel for `pj`, a fast project directory finder.
Includes source commands, preview with `ls`, and actions for expanding
paths, opening in $EDITOR, connecting to tmux sessions, opening new
tmux tabs, and clearing the pj cache.
The pj projects includes Windows builds which should work natively in PowerShell too. The Windows version replaces the tmux commands with wt commands
@alexpasmantier alexpasmantier force-pushed the feat/add-pj-cable-channel branch from 532ddc6 to 7f99e1b Compare April 14, 2026 22:59
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.

2 participants