awesome

Welcome to awesome bug tracking system.
Tasklist

FS#193 - executing through awesome-menu leaves shell process.

Attached to Project: awesome
Opened by Alex (acornejo) - Thursday, 15 May 2008, 23:13 GMT
Last edited by Julien Danjou (jd) - Monday, 28 July 2008, 15:33 GMT
Task Type Bug Report
Category awesome-2
Status Closed
Assigned To No-one
Operating System Linux
Severity Medium
Priority Normal
Reported Version 2.3
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

I am not sure if this is a bug, but I find this behaviour unnecessary.

When programs are launched using awesome-menu, they are executed as a child process of a bash shell instead of replacing the shell itself.

More concretely I have the following binding in awesomerc:

key { modkey = {"Mod4"} key = "r" command = "spawn" arg = "cat ~/.apps | awesome-menu -e 'exec ' Execute:"

If I execute pidgin for example, and then perform ps auxf, I get the following output:

myuser 7295 0.0 0.0 3812 1236 ? Ss 13:16 0:00 /bin/bash -c cat ~/.apps | awesome-menu -e 'exec ' Execute:
myuser 7297 0.1 0.9 69332 31612 ? Sl 13:16 0:23 \_ pidgin

The cat command along with the pipe clearly needed a shell, however I would expect the pidgin process to replace the shell process instead of forking and creating a new process.
This task depends upon

Closed by  Julien Danjou (jd)
Monday, 28 July 2008, 15:33 GMT
Reason for closing:  Fixed
Additional comments about closing:  commit 6d84d8246bb68ee1243060b16cbc127ad91e3040
Author: Julien Danjou <julien@danjou.info>
Date: Mon Jul 28 17:33:22 2008 +0200

awesomerc: fix subprocess ( FS#193 )

Signed-off-by: Julien Danjou <julien@danjou.info>
Comment by Nelson A. de Oliveira (naoliv) - Thursday, 22 May 2008, 00:38 GMT
Same thing here (using liferea as an example):

naoliv 2249 0.0 0.0 3788 1092 ? Ss May01 0:00 /bin/bash -c find /usr/bin -type f -executable ! -empty | awesome-menu -e 'exec ' Execute:
naoliv 2251 0.0 3.0 163832 64060 ? Sl May01 19:27 \_ /usr/bin/liferea-bin
Comment by Anatoly Škodin (tczy) - Thursday, 12 June 2008, 07:15 GMT
This is not a bug, really. The default .awesomerc should contain an ampersand after the command, like this:

key
{
modkey = {"Mod4"}
key = "F1"
command = "spawn"
arg = "ls -R /usr/share/man/man? | grep .gz | cut -d. -f1 | awesome-menu -e 'xterm -e man ' 'man:' &"
}

(My Mod4+F1 command, C shell.)
Comment by Anatoly Škodin (tczy) - Thursday, 12 June 2008, 07:19 GMT
Fact is (as much as I can see, heh), the "spawn" command just executes the shell, the user's default one. whatever put in the arg should abide by that shell's syntax.
Comment by Artem Savkov (sm00th_trac3r) - Friday, 13 June 2008, 09:45 GMT
typing the command in awesome-menu with "&" solves the problem, but it is kinda bad to type extra-char each time, so i patched awesome-menu.c a little so it adds "&"-char automatically.
works fine for me, though i haven't tested it a lot. the patch is in the attachment

Loading...