0

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?

3
  • I'm not on a machine with rxvt-unicode right now, but the behavior you describe seems to be exactly what -hold is 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? Commented Jan 23, 2024 at 16:02
  • @Wieland Yes -- removing the '-hold' flag allows me to kill both the terminal window and the running process of htop with a single hit of Q. But running neofetch or another command that just outputs something leads to the command executing and the terminal immediately closing by itself -- not desirable. Commented Jan 23, 2024 at 16:38
  • @Wieland But checking again, this seems to be the behavior of dmenu -- running neofetch as terminal or terminal-hold leads to the terminal window immediately closing after execution. So maybe there is no way around this: if we are to run shell commands via rofi, we have to accept that the terminal window has to be "manually" closed. Commented Jan 23, 2024 at 16:46

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.