I'm trying to switch from using dmenu to rofi on my system, on which
I use i3wm. I have the following keybinding:
bindsym $mod+Ctrl+d exec --no-startup-id rofi -combi-modi
window#drun#run -show combi -show-icons
I use urxvt as my default terminal, and it's the one that's specified
in my config.rasi file for rofi to use.
The problem I have is when I launch rofi, and try to do something like
htop SHIFT RET to run htop in a terminal window.
When I'm done with htop, I hit Q and the process ends, but I'm left
with a blank terminal window. Hitting Q again doesn't kill it, nor
does Ctrl-C. I have to kill the window via my i3 keybinding
$mod+Shift+Q.
It's a similar situation with a command like neofetch, or ls -l,
except now the first Q doesn't kill the process as it has already
completed – the terminal window is not blank but contains the output of
those commands.
My run-shell-command is "{terminal} -hold -e {cmd}".
I don't get this behavior when running these commands via dmenu. For
instance, htop is in the dmenu-recent/terminal file, and hitting Q
kills the process and the terminal window at the same time. This is the
behavior I would like to replicate with rofi – is this possible?
-holdis documented to achieve: -hold|+hold -- Turn on/off hold window after exit support. If enabled, urxvt will not immediately destroy its window when the program executed within it exits. Instead, it will wait till it is being killed or closed by the user; resource hold. (from pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod). Have you tried removing the -hold flag?htopwith a single hit ofQ. But runningneofetchor another command that just outputs something leads to the command executing and the terminal immediately closing by itself -- not desirable.dmenu-- runningneofetchasterminalorterminal-holdleads to the terminal window immediately closing after execution. So maybe there is no way around this: if we are to run shell commands viarofi, we have to accept that the terminal window has to be "manually" closed.