-
-
Notifications
You must be signed in to change notification settings - Fork 87
Description
The Issue
Consider this init.lua:
version = '1.0.1'
xplr.config.modes.builtin.go_to.key_bindings.on_key["x"] = {
help = "open externally",
messages = {
{
BashExecSilently0 = [[
while IFS= read -r -d '' PTH; do
xdg-open "${PTH:?}" > /dev/null 2>&1 &
disown
done < "${XPLR_PIPE_RESULT_OUT:?}"
]]
},
"PopMode",
},
}Which slightly modifies the gx keybind in order to run xdg-open as a background process by using
& and disown.
When we open a terminal, type xplr into the shell and then use gx to open a file externally,
some external program will open separately and stay open even when we quit xplr and then exit the
terminal as expected. However, when we open xplr directly in a terminal by passing the command to
run directly to the terminal emulator, then open some file externally and then exit xplr (which will
now immediately close the terminal too, as there is no shell), the external program will be killed.
External programs I've tried:
- Zathura for a
pdffile - nsxiv for a
pngfile
Terminal emulators I've tried:
foot xplr -c init.luaxterm -e "xplr -c init.lua"ghostty -e xplr -c init.lua
All exhibit this behavior.
As I can reproduce this across such a wide variety of terminals and external programs, I suspect
that it's some issue with xplr or perhaps my configuration. It might also be some other factor I'm
unaware of (sytemd messing with things, maybe?).
System Information
- OS: NixOS on
nixos-unstable-small - xplr: version
1.0.1from nixpkgs