0

I'm writing this question because I'm trying to launch a web browser called vimb using dmenu, but by first running it through a program called tabbed. For context, vimb is a minimal browser I've taken a liking to but does not support tabs innately. For that I'd need to run it through a second application called tabbed. In a normal terminal instance it works perfectly, like so:

tabbed vimb -e

However, when running that same command using dmenu, it immediately opens and closes a window.

As a side note, doing this also messes up some of my scripts (which also use dmenu). For example, I have a custom script which lists my configs and I can select one of them to open up a brand new terminal instance and edit them. When running the above command in dmenu, those scripts also experience a similar phenomenon. In their case, they open a terminal instance but immediately close it.

I have no idea where on my system I can check to see whats going on. Digging through /var/logs did very little for me as well.

Does anyone here have an idea of where I could begin troubleshooting this issue? I recall a long time ago having this same issue in a different window manager, so I don't believe it's that. But I'd like to know what you all think.

Update: So I was curious to see if there was some sort of error that gets produced that I'm not seeing. So in dmenu I ran:

tabbed vimb -e >> ~/.foo

and it just...worked. Can anyone explain why this is happening?

1 Answers1

0

It seems like what's happening is that the command is being run from a shell and the application dies after the shell runs the command. The '&' is telling the shell to background the process and then when the shell exists normally it won't be killed.

You won't need to do this for things that don't need to keep running, like toggle a setting or changing volume. Or for applications that can self demonize or detect they're already running like chromium.

This question: Difference between nohup, disown and &

Has more detail on how '&' works and job control on shells. It should be doable to do some testing on your shell as well.

tabbed vimb -e

And you shouldn't see a prompt if you then in the same shell type Ctrl + c it should close the window and give a new prompt.

Now try to type:

tabbed vimb -e &

And you should see a new shell prompt and exiting the shell won't kill the browser.

(some shells like zsh handle '&' differently than bash)

  • Thank you for that. That really does help to understand. I also recognized I edited my comment heavily so I apologize if I had you answering the original comment and not my edited version.

    I've also been experimenting with running a command like this as a keybinding from sxhkd, which also had trouble running a command like this. Running tabbed vimb -e & works with dmenu, but not as a keybinding. I figured out redirecting the output to /dev/null works wonderfully though. Weird that. Thank you for your help all the same.

    – LiveAndLetLove Apr 30 '20 at 16:02
  • From a brief look it seems like tabbed is running vmib so idk how that is mean to interact with shells and such. Just different reasons to keep processes around in the end. – Livinglifeback Apr 30 '20 at 16:37