Sample Header Ad - 728x90

Can I force xdg-open to use a new terminal when opening a terminal app?

1 vote
1 answer
316 views
I would like xdg-open to open a new terminal when I run it on a file from the terminal and it opens, for example, nvim. My default text editor for text/plain is set to nvim.desktop. When I open a text/plain file from dolphin, it correctly opens nvim in a new terminal. But when I run xdg-open on that same file from a terminal, it opens nvim in the current terminal instead of starting a new one. How can I force xdg-open to open programs with a Terminal=true flag in their .desktop file in a new terminal when I run xdg-open from a terminal? I already tried { cat | xdg-open ~/file.txt 2>&1 >>/dev/null ; } & disown (file.txt is present in the home directory) but nothing happens, nvim is not even running if I type pgrep nvim after... My terminal is konsole, I am using Hyprland as window manager. Edit: I found out gio open does this correctly, so for now I will just use that. (I'll consider making it the answer, but I'll just wait a couple of days to see if I get an answer for xdg-open.)
Asked by vosjedev (11 rep)
Jun 4, 2024, 06:45 AM
Last activity: Jun 4, 2024, 07:19 AM