Open a compose project in a terminal or editor #20
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
com.docker.compose.project.working_dirlabel.Approach notes (Nye, review; tested on Docker 26 + rootless Podman 5.4.2)
#20 Open a compose project in terminal / editor
Reuse:
WORKING_DIR_LABELalready insrc/window/data.rs(com.docker.compose.project.working_dir); it's written by the compose client, so it's there on Podman too when using docker compose.Tested here: terminals start in the spawning process's cwd:
Command::new(term).current_dir(dir)opened xfce4-terminal andx-terminal-emulator(Debian wrapper) in/tmp/k20 dir(with a space). So no per-terminal flags are needed.Terminal pick order: user setting (command string) >
xdg-terminal-exec>$TERMINAL>x-terminal-emulator(Debian/Ubuntu) > first found ofptyxis gnome-terminal konsole xfce4-terminal kitty alacritty wezterm foot xterm.Editor: there is no XDG "code editor" default (
xdg-mime query default text/plain= mousepad here, which can't open a folder;inode/directory= file manager). So: user setting > first found ofcode codium zed subl kate(flatpak run com.visualstudio.codeif the flatpak is installed), passing the dir as the argument. If none: hide "Open in editor" and offer "Open folder" viaxdg-open <dir>.Must-dos:
Path::new(dir).is_dir()is false.wait()s, orsetsid) so no zombies pile up.sh -c(paths with spaces/quotes).{dir}if present, else rely on current_dir.