Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion for cleaner symbolic link on fnm_multishells #1374

Open
secondetik opened this issue Jan 27, 2025 · 0 comments
Open

Suggestion for cleaner symbolic link on fnm_multishells #1374

secondetik opened this issue Jan 27, 2025 · 0 comments

Comments

@secondetik
Copy link

secondetik commented Jan 27, 2025

I notice that fnm env command will always create a new symlink to default directory in fnm_multishells directory. This is not a huge of a deal as it's just a few bytes, but I think it's still better to remove the symlink when the terminal exits as they'll keep piling up unused as we initialize new terminal.

Right now, I can simply add something like trap "rm -rf $FNM_MULTISHELL_PATH" EXIT so the symlink will be removed when the shell exits.

In relate to it, I find that fnm env command can be improved by :

  • Either it only generate pure script that doesn't create symlink as side-effect (create the symlink on the script using ln) or fully commit on creating the symlink and set up all the script in one process without requiring you to do eval.
  • Remove previous symlink when fnm env command invoked as it won't be used anymore and be replaced by new one.
  • Add post clean up script (remove symlink when terminal exits), either on fnm env output script or guide the users to add it in their shell init script.

That are my suggestions if I'm not mistaken on how the command designed.

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

No branches or pull requests

1 participant