Skip to content

Conversation

@josephschmitt
Copy link
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 4 times, most recently from f7d472e to 3c5b702 Compare February 8, 2026 05:06
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.
@josephschmitt josephschmitt force-pushed the feat/add-pj-cable-channel branch from 3c5b702 to 04950ac Compare February 8, 2026 15:06
The pj projects includes Windows builds which should work natively in PowerShell too. The Windows version replaces the tmux commands with wt commands
@josephschmitt josephschmitt force-pushed the feat/add-pj-cable-channel branch from ac079a3 to b44c820 Compare February 8, 2026 15:12
@josephschmitt
Copy link
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
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
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
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

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