joshmedeski / sesh

Smart session manager for the terminal
MIT License
417 stars 17 forks source link

Inconsistent session naming #33

Closed TomDeneire closed 5 months ago

TomDeneire commented 5 months ago

I work with a large monorepo which has its git root at /home/tdeneire/Dropbox/brocade/source.

When I create a session in directory /home/tdeneire/Dropbox/brocade/source/data/universe/errorhandling, for instance, this session gets named source/home/tdeneire/projects/brocade/source/data/universe/errorhandling, whereas I would expect something like source/data/universe/errorhandling. So, it's the full, absolute path of the directory, instead of a path relative to the git root folder.

See screenshots (where you see two other examples of sessions in the same git folder).

image

image

It also happens in another repo:

image

At first, I suspected it might have something to do with the fact that these directories have symlinks:

/home/tdeneire/projects/brocade => /home/tdeneire/Dropbox/brocade /home/tdeneire/projects/websites => /home/tdeneire/Dropbox/websites /home/tdeneire/projects/code => /home/tdeneire/Dropbox/code

But there are other directories that are in similar directories that are named just fine:

image

joshmedeski commented 5 months ago

The culprit here is symlinks. I'll start working on supporting this workflow.

joshmedeski commented 5 months ago

I added symbolic link support in v0.6.2 update sesh and let me know if you get consistent session naming!

TomDeneire commented 5 months ago

Alas, still seeing the same problem here!

image

joshmedeski commented 5 months ago

Can you clarify which folder is a symbolic link? I know if you point zoxide to the non-symlinks you'll have a decent experience for now.

joshmedeski commented 5 months ago

It looks like it might be: ~/projects/code is a symbolic link

when you try and open ~/projects/code/subfolder the symbolic link logic breaks

TomDeneire commented 5 months ago

Indeed, ~/projects/code is a symlink to /home/tdeneire/Dropbox/code. However, I did not know about _ZO_RESOLVE_SYMLINKS and you're right, it does avoid the problem. So I've set that and am now using sesh fulltime instead of the t script! Thanks for your work, Josh.

joshmedeski commented 5 months ago

Great! I'll mark this as resolved, glad to hear you made the switch