Closed fonskip closed 3 months ago
If you do not want to source shell init files, another workaround would be to add an option in the app (similar to "Set Preferred Terminal") that would be : "Set Distrobox Executable". It requires the same tweaks for running the distrobox command correctly, though.
Hello, BoxBuddy definitely works with a local distrobox install, as this is how I set up my VMs:
Do you have a problem with the way you have distrobox installed? If so, how have you installed it?
Hi, it looks like it’s specific to Debian. I encountered the issue with distrobox installed manually on Debian 12.5. Tested it on Arch and Fedora Workstation and it was OK.
I think Debian does not add ~/.local/bin to the users’ PATHs by default.
But there’s actually a workaround as you can set your flatpak PATH in Flatseal or using flatpak override
. I guess the issue can be closed then.
Install method Flatpak
Distrobox Version 1.7.2.1
Your Host OS Debian 12.5
Describe your Issue https://github.com/Dvlv/BoxBuddyRS/blob/bd4df8390a2419f102260f9f3567eb4ecffe942a/src/utils.rs#L217C8-L217C31
The
has_distrobox_installed
function does not use the user’s PATH (because std::process::Command::output is not invoked in an interactive shell). Thus, if your distrobox is installed in a non-OS PATH (e.g. : in.local/bin/
), it is not recognized by the function.Solution proposal I suggest changing the
which distrobox
toenv $SHELL -ic "which distrobox"
in order to run the command in an interactive shell (works with zsh, fish and bash, at least) :let output = get_command_output(String::from("env"), Some(&["$SHELL -ic", "which distrobox"]));
(note that this line hasn’t been testing, only the concept of sourcing the PATH with -ic is tested).This would also require to get the output of the which command and store it somewhere in order to be able to invoke distrobox later. If you agree with such a solution, I could try and make a PR with something tested.