You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are trying to integrate the shell to run the dev command. But unfortunately the shell integration is not working on fish shell.
Is there any way to integrate it on fish shell??
A partial workaround for fish is to use direnv. Install it, and drop a file .envrc with the following content in your project folder:
source <(pkgx --internal.activate $(realpath .))
This will act very similarly to the dev command -- it will resolve the environment and activate it using pkgx, and deactivate it once you navigate outside of the folder. This should even have greater IDE support since direnv has been around for a while and has battle-tested extensions for most IDEs.
It depends on https://github.com/edc/bass for sourcing bash scripts, and the dev command does not auto-deactivate (it's probably doable with function ... --on-variable PWD -- https://fishshell.com/docs/current/cmds/function.html -- but that would be harder to serve through bass given that it does not port over bash functions -- as said above, I recommend using direnv for this use case). env is called envx not to bother with Unix env compatibility.
@JanPokorny Thanks for the workaround with direnv. Unfortunately this requires a .envrc file in every project folder.
Looking forward to a native Fish solution as I would like to give this shell a try. Unfortunately I have no experience with Fish and its scripting so I can't help here.
@svenjacobs You could just run echo 'source <(pkgx --internal.activate $(realpath .))' >>.envrc && echo '.envrc' >>.git/info/exclude in every project folder and be done with it. You could alias it to dev-setup or something and just use that instead of dev.
Sure, but I don't want to add a file to every project that my colleagues don't need 😉 Of course I could add the file to the global .gitignore but as I said a native solution would be much appreciated 😃
Activity
mxcl commentedon Nov 2, 2023
This is being built pkgxdev/pkgx#838, help welcome as I am not familiar with fish.
philipgiuliani commentedon Nov 9, 2023
Whats missing in pkgxdev/pkgx#838 for the task to be complete?
mxcl commentedon Nov 9, 2023
Been a week so i don't recall precisely (sadly I am super busy with CEO duties RN)
If you checkout the code and try to
SHELL=fish eval deno task run --shellcodewe then need the shellcode functions to workI should be able to resume work on this next week, but feel free to get it working.
IMO if
xworks that's enough for now, we can then makedevwork after. But as saiddevis probs easiest.All the code is in
shellcode.tsJanPokorny commentedon Mar 21, 2024
A partial workaround for
fishis to usedirenv. Install it, and drop a file.envrcwith the following content in your project folder:This will act very similarly to the
devcommand -- it will resolve the environment and activate it usingpkgx, and deactivate it once you navigate outside of the folder. This should even have greater IDE support sincedirenvhas been around for a while and has battle-tested extensions for most IDEs.JanPokorny commentedon May 13, 2024
Here's a "poor man's" implementation for the shell integration in Fish:
It depends on https://github.com/edc/bass for sourcing bash scripts, and the
devcommand does not auto-deactivate (it's probably doable withfunction ... --on-variable PWD-- https://fishshell.com/docs/current/cmds/function.html -- but that would be harder to serve throughbassgiven that it does not port over bash functions -- as said above, I recommend usingdirenvfor this use case).envis calledenvxnot to bother with Unixenvcompatibility.svenjacobs commentedon May 13, 2024
@JanPokorny Thanks for the workaround with
direnv. Unfortunately this requires a.envrcfile in every project folder.Looking forward to a native Fish solution as I would like to give this shell a try. Unfortunately I have no experience with Fish and its scripting so I can't help here.
JanPokorny commentedon May 13, 2024
@svenjacobs You could just run
echo 'source <(pkgx --internal.activate $(realpath .))' >>.envrc && echo '.envrc' >>.git/info/excludein every project folder and be done with it. You could alias it todev-setupor something and just use that instead ofdev.svenjacobs commentedon May 14, 2024
Sure, but I don't want to add a file to every project that my colleagues don't need 😉 Of course I could add the file to the global
.gitignorebut as I said a native solution would be much appreciated 😃JanPokorny commentedon May 14, 2024
@svenjacobs The snippet I posted above adds the file to a local ignore file .git/info/exclude