mirror of
https://github.com/swaywm/sway.git
synced 2026-04-27 06:46:25 -04:00
cmd_exec{,_always}: close standard in for child
This just closes the standard input for processes started with the exec and exec_always commands. This prevents interactive programs like vi(m) from taking over input on the getty. Standard output and standard error are kept open, which allows for the output/errors to be captured along with the sway log.
This commit is contained in:
parent
b4b274cdce
commit
bc1b118b95
1 changed files with 1 additions and 0 deletions
|
|
@ -61,6 +61,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
|
|||
close(fd[0]);
|
||||
if ((child = fork()) == 0) {
|
||||
close(fd[1]);
|
||||
close(STDIN_FILENO);
|
||||
execl("/bin/sh", "/bin/sh", "-c", cmd, (void *)NULL);
|
||||
_exit(0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue